diff --git a/core/prelude/operators/as.carbon b/core/prelude/operators/as.carbon index 5d40d43e5fe9..03d365463d7d 100644 --- a/core/prelude/operators/as.carbon +++ b/core/prelude/operators/as.carbon @@ -19,10 +19,6 @@ interface ImplicitAs(Dest:! type) { // TODO: These impls should live with Core.Int, but currently that's a builtin // not a class type, so there is no other library these can go in. -impl IntLiteral() as ImplicitAs(i32) { - fn Convert[self: Self]() -> i32 = "int.convert_checked"; -} - impl forall [N:! IntLiteral()] IntLiteral() as ImplicitAs(Int(N)) { fn Convert[self: Self]() -> Int(N) = "int.convert_checked"; } @@ -31,10 +27,6 @@ impl forall [N:! IntLiteral()] IntLiteral() as ImplicitAs(UInt(N)) { fn Convert[self: Self]() -> UInt(N) = "int.convert_checked"; } -impl i32 as ImplicitAs(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; -} - impl forall [N:! IntLiteral()] Int(N) as ImplicitAs(IntLiteral()) { fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; } @@ -44,10 +36,6 @@ impl forall [N:! IntLiteral()] UInt(N) as ImplicitAs(IntLiteral()) { } // TODO: Remove these once ImplicitAs extends As. -impl IntLiteral() as As(i32) { - fn Convert[self: Self]() -> i32 = "int.convert_checked"; -} - impl forall [N:! IntLiteral()] IntLiteral() as As(Int(N)) { fn Convert[self: Self]() -> Int(N) = "int.convert_checked"; } @@ -56,10 +44,6 @@ impl forall [N:! IntLiteral()] IntLiteral() as As(UInt(N)) { fn Convert[self: Self]() -> UInt(N) = "int.convert_checked"; } -impl i32 as As(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; -} - impl forall [N:! IntLiteral()] Int(N) as As(IntLiteral()) { fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; } diff --git a/core/prelude/types.carbon b/core/prelude/types.carbon index 60181a143bb9..bb4b9ebb9db2 100644 --- a/core/prelude/types.carbon +++ b/core/prelude/types.carbon @@ -12,7 +12,6 @@ export import library "prelude/types/bool"; // import library "prelude/types/i32"; fn IntLiteral() -> type = "int_literal.make_type"; -fn Int32() -> type = "int.make_type_32"; fn Int(size: IntLiteral()) -> type = "int.make_type_signed"; fn UInt(size: IntLiteral()) -> type = "int.make_type_unsigned"; fn Float(size: IntLiteral()) -> type = "float.make_type"; diff --git a/core/prelude/types/i32.carbon b/core/prelude/types/i32.carbon index 7cd2c00611de..540ebc5733ca 100644 --- a/core/prelude/types/i32.carbon +++ b/core/prelude/types/i32.carbon @@ -4,7 +4,7 @@ package Core library "prelude/types/i32"; -// For Int32(): +// For Int(): import library "prelude/types"; import library "prelude/operators"; diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index 143eac7a400b..83bb60bb9c6e 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -1010,7 +1010,6 @@ class TypeCompleter { case SemIR::BuiltinInstKind::Invalid: case SemIR::BuiltinInstKind::BoolType: case SemIR::BuiltinInstKind::IntLiteralType: - case SemIR::BuiltinInstKind::IntType: case SemIR::BuiltinInstKind::FloatType: case SemIR::BuiltinInstKind::NamespaceType: case SemIR::BuiltinInstKind::BoundMethodType: @@ -1368,6 +1367,17 @@ auto Context::GetGenericInterfaceType(SemIR::InterfaceId interface_id, *this, interface_id, enclosing_specific_id); } +auto Context::GetInt32Type() -> SemIR::TypeId { + auto bit_width_const_id = TryEvalInst( + *this, SemIR::InstId::Invalid, + SemIR::IntValue{ + .type_id = GetBuiltinType(SemIR::BuiltinInstKind::IntLiteralType), + .int_id = ints().Add(32)}); + return GetCompleteTypeImpl( + *this, SemIR::IntKind::Signed, + constant_values().GetInstId(bit_width_const_id)); +} + auto Context::GetInterfaceType(SemIR::InterfaceId interface_id, SemIR::SpecificId specific_id) -> SemIR::TypeId { return GetTypeImpl( diff --git a/toolchain/check/context.h b/toolchain/check/context.h index 4b23fb0b0845..0d28c53f0ad9 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -406,6 +406,9 @@ class Context { SemIR::SpecificId enclosing_specific_id) -> SemIR::TypeId; + // Returns the type `i32`. + auto GetInt32Type() -> SemIR::TypeId; + // Gets the facet type corresponding to a particular interface. auto GetInterfaceType(SemIR::InterfaceId interface_id, SemIR::SpecificId specific_id) -> SemIR::TypeId; diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index 3c7622aeda51..4eadf9d1118d 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -153,9 +153,9 @@ static auto MakeElementAccessInst(Context& context, SemIR::LocId loc_id, // index so that we don't need an integer literal instruction here, and // remove this special case. auto index_id = block.template AddInst( - loc_id, - {.type_id = context.GetBuiltinType(SemIR::BuiltinInstKind::IntType), - .int_id = context.ints().AddUnsigned(llvm::APInt(32, i))}); + loc_id, {.type_id = context.GetBuiltinType( + SemIR::BuiltinInstKind::IntLiteralType), + .int_id = context.ints().Add(static_cast(i))}); return block.template AddInst( loc_id, {elem_type_id, aggregate_id, index_id}); } else { diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index 30511c36ab40..a8ab7ffc3b08 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -1057,10 +1057,6 @@ static auto MakeConstantForBuiltinCall(Context& context, SemIRLoc loc, SemIR::InstId::BuiltinIntLiteralType); } - case SemIR::BuiltinFunctionKind::IntMakeType32: { - return context.constant_values().Get(SemIR::InstId::BuiltinIntType); - } - case SemIR::BuiltinFunctionKind::IntMakeTypeSigned: { return MakeIntTypeResult(context, loc, SemIR::IntKind::Signed, arg_ids[0], phase); diff --git a/toolchain/check/handle_function.cpp b/toolchain/check/handle_function.cpp index 9cb4c230be0f..5326dd396cb4 100644 --- a/toolchain/check/handle_function.cpp +++ b/toolchain/check/handle_function.cpp @@ -300,8 +300,7 @@ static auto BuildFunctionDecl(Context& context, !function_info.param_patterns_id.is_valid() || !context.inst_blocks().Get(function_info.param_patterns_id).empty() || (return_type_id.is_valid() && - return_type_id != - context.GetBuiltinType(SemIR::BuiltinInstKind::IntType) && + return_type_id != context.GetInt32Type() && return_type_id != context.GetTupleType({}))) { CARBON_DIAGNOSTIC(InvalidMainRunSignature, Error, "invalid signature for `Main.Run` function; expected " diff --git a/toolchain/check/handle_if_expr.cpp b/toolchain/check/handle_if_expr.cpp index 524a1c07703e..d08190ca8819 100644 --- a/toolchain/check/handle_if_expr.cpp +++ b/toolchain/check/handle_if_expr.cpp @@ -38,9 +38,8 @@ static auto DecayIntLiteralToSizedInt(Context& context, Parse::NodeId node_id, -> SemIR::InstId { if (context.types().GetInstId(context.insts().Get(operand_id).type_id()) == SemIR::InstId::BuiltinIntLiteralType) { - operand_id = ConvertToValueOfType( - context, node_id, operand_id, - context.GetBuiltinType(SemIR::BuiltinInstKind::IntType)); + operand_id = ConvertToValueOfType(context, node_id, operand_id, + context.GetInt32Type()); } return operand_id; } diff --git a/toolchain/check/handle_index.cpp b/toolchain/check/handle_index.cpp index ea68858275af..ef3de125a6f2 100644 --- a/toolchain/check/handle_index.cpp +++ b/toolchain/check/handle_index.cpp @@ -133,8 +133,7 @@ auto HandleParseNode(Context& context, Parse::IndexExprId node_id) -> bool { case CARBON_KIND(SemIR::ArrayType array_type): { auto index_loc_id = context.insts().GetLocId(index_inst_id); auto cast_index_id = ConvertToValueOfType( - context, index_loc_id, index_inst_id, - context.GetBuiltinType(SemIR::BuiltinInstKind::IntType)); + context, index_loc_id, index_inst_id, context.GetInt32Type()); auto array_cat = SemIR::GetExprCategory(context.sem_ir(), operand_inst_id); if (array_cat == SemIR::ExprCategory::Value) { diff --git a/toolchain/check/handle_literal.cpp b/toolchain/check/handle_literal.cpp index eb19cdc80620..7e3237e14d60 100644 --- a/toolchain/check/handle_literal.cpp +++ b/toolchain/check/handle_literal.cpp @@ -32,7 +32,6 @@ auto HandleParseNode(Context& context, Parse::BoolLiteralTrueId node_id) // integer value, which is assumed to be unsigned. static auto MakeIntLiteral(Context& context, Parse::NodeId node_id, IntId int_id) -> SemIR::InstId { - // We rely on the lexer having normalized the `int_id` to a canonical width. return context.AddInst( node_id, {.type_id = context.GetBuiltinType( SemIR::BuiltinInstKind::IntLiteralType), @@ -134,14 +133,6 @@ auto HandleParseNode(Context& context, Parse::IntTypeLiteralId node_id) -> bool { auto tok_id = context.parse_tree().node_token(node_id); auto size_id = context.tokens().GetTypeLiteralSize(tok_id); - // Special case: `i32` has a custom builtin for now. - // TODO: Remove this special case. - if (context.ints().Get(size_id) == 32) { - auto fn_inst_id = context.LookupNameInCore(node_id, "Int32"); - auto type_inst_id = PerformCall(context, node_id, fn_inst_id, {}); - context.node_stack().Push(node_id, type_inst_id); - return true; - } return HandleIntOrUnsignedIntTypeLiteral(context, node_id, SemIR::IntKind::Signed, size_id); } diff --git a/toolchain/check/testdata/alias/fail_builtins.carbon b/toolchain/check/testdata/alias/fail_builtins.carbon index 71afaa86988b..90957397d3e5 100644 --- a/toolchain/check/testdata/alias/fail_builtins.carbon +++ b/toolchain/check/testdata/alias/fail_builtins.carbon @@ -22,15 +22,17 @@ alias b = bool; // CHECK:STDOUT: --- fail_builtins.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -44,7 +46,8 @@ alias b = bool; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc15: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15) [template = constants.%i32] // CHECK:STDOUT: %a: = bind_alias a, [template = ] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %b: = bind_alias b, [template = ] diff --git a/toolchain/check/testdata/array/array_in_place.carbon b/toolchain/check/testdata/array/array_in_place.carbon index b1e9b6a0d285..9a94dd1bac86 100644 --- a/toolchain/check/testdata/array/array_in_place.carbon +++ b/toolchain/check/testdata/array/array_in_place.carbon @@ -17,24 +17,26 @@ fn G() { // CHECK:STDOUT: --- array_in_place.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32, i32) [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32, %i32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, %tuple.type.2 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %tuple.type.2 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%tuple.type.2, %tuple.type.2) [template] -// CHECK:STDOUT: %.5: i32 = int_value 0 [template] -// CHECK:STDOUT: %.6: i32 = int_value 1 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -51,16 +53,19 @@ fn G() { // CHECK:STDOUT: %return.patt: %tuple.type.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_25.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_12, %int.make_type_32.loc11_17, %int.make_type_32.loc11_22) -// CHECK:STDOUT: %.loc11_25.2: type = value_of_initializer %int.make_type_32.loc11_12 [template = i32] -// CHECK:STDOUT: %.loc11_25.3: type = converted %int.make_type_32.loc11_12, %.loc11_25.2 [template = i32] -// CHECK:STDOUT: %.loc11_25.4: type = value_of_initializer %int.make_type_32.loc11_17 [template = i32] -// CHECK:STDOUT: %.loc11_25.5: type = converted %int.make_type_32.loc11_17, %.loc11_25.4 [template = i32] -// CHECK:STDOUT: %.loc11_25.6: type = value_of_initializer %int.make_type_32.loc11_22 [template = i32] -// CHECK:STDOUT: %.loc11_25.7: type = converted %int.make_type_32.loc11_22, %.loc11_25.6 [template = i32] +// CHECK:STDOUT: %.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_12: init type = call constants.%Int(%.loc11_12) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_17: init type = call constants.%Int(%.loc11_17) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_22: init type = call constants.%Int(%.loc11_22) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_12, %int.make_type_signed.loc11_17, %int.make_type_signed.loc11_22) +// CHECK:STDOUT: %.loc11_25.2: type = value_of_initializer %int.make_type_signed.loc11_12 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.3: type = converted %int.make_type_signed.loc11_12, %.loc11_25.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.4: type = value_of_initializer %int.make_type_signed.loc11_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.5: type = converted %int.make_type_signed.loc11_17, %.loc11_25.4 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.6: type = value_of_initializer %int.make_type_signed.loc11_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.7: type = converted %int.make_type_signed.loc11_22, %.loc11_25.6 [template = constants.%i32] // CHECK:STDOUT: %.loc11_25.8: type = converted %.loc11_25.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param @@ -72,36 +77,39 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc14_12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_25.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc14_12, %int.make_type_32.loc14_17, %int.make_type_32.loc14_22) -// CHECK:STDOUT: %.loc14_28: Core.IntLiteral = int_value 2 [template = constants.%.1] -// CHECK:STDOUT: %.loc14_25.2: type = value_of_initializer %int.make_type_32.loc14_12 [template = i32] -// CHECK:STDOUT: %.loc14_25.3: type = converted %int.make_type_32.loc14_12, %.loc14_25.2 [template = i32] -// CHECK:STDOUT: %.loc14_25.4: type = value_of_initializer %int.make_type_32.loc14_17 [template = i32] -// CHECK:STDOUT: %.loc14_25.5: type = converted %int.make_type_32.loc14_17, %.loc14_25.4 [template = i32] -// CHECK:STDOUT: %.loc14_25.6: type = value_of_initializer %int.make_type_32.loc14_22 [template = i32] -// CHECK:STDOUT: %.loc14_25.7: type = converted %int.make_type_32.loc14_22, %.loc14_25.6 [template = i32] +// CHECK:STDOUT: %.loc14_12: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_12: init type = call constants.%Int(%.loc14_12) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_17: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_17: init type = call constants.%Int(%.loc14_17) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_22: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_22: init type = call constants.%Int(%.loc14_22) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_25.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_12, %int.make_type_signed.loc14_17, %int.make_type_signed.loc14_22) +// CHECK:STDOUT: %.loc14_28: Core.IntLiteral = int_value 2 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_25.2: type = value_of_initializer %int.make_type_signed.loc14_12 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_25.3: type = converted %int.make_type_signed.loc14_12, %.loc14_25.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_25.4: type = value_of_initializer %int.make_type_signed.loc14_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_25.5: type = converted %int.make_type_signed.loc14_17, %.loc14_25.4 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_25.6: type = value_of_initializer %int.make_type_signed.loc14_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_25.7: type = converted %int.make_type_signed.loc14_22, %.loc14_25.6 [template = constants.%i32] // CHECK:STDOUT: %.loc14_25.8: type = converted %.loc14_25.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc14_29: type = array_type %.loc14_28, %tuple.type.2 [template = constants.%.2] -// CHECK:STDOUT: %v.var: ref %.2 = var v -// CHECK:STDOUT: %v: ref %.2 = bind_name v, %v.var +// CHECK:STDOUT: %.loc14_29: type = array_type %.loc14_28, %tuple.type.2 [template = constants.%.3] +// CHECK:STDOUT: %v.var: ref %.3 = var v +// CHECK:STDOUT: %v: ref %.3 = bind_name v, %v.var // CHECK:STDOUT: %F.ref.loc14_34: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %.loc14_42.3: ref %tuple.type.2 = splice_block %.loc14_42.2 { -// CHECK:STDOUT: %.loc14_42.1: i32 = int_value 0 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_42.1: Core.IntLiteral = int_value 0 [template = constants.%.6] // CHECK:STDOUT: %.loc14_42.2: ref %tuple.type.2 = array_index %v.var, %.loc14_42.1 // CHECK:STDOUT: } // CHECK:STDOUT: %F.call.loc14_35: init %tuple.type.2 = call %F.ref.loc14_34() to %.loc14_42.3 // CHECK:STDOUT: %F.ref.loc14_39: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %.loc14_42.6: ref %tuple.type.2 = splice_block %.loc14_42.5 { -// CHECK:STDOUT: %.loc14_42.4: i32 = int_value 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc14_42.4: Core.IntLiteral = int_value 1 [template = constants.%.7] // CHECK:STDOUT: %.loc14_42.5: ref %tuple.type.2 = array_index %v.var, %.loc14_42.4 // CHECK:STDOUT: } // CHECK:STDOUT: %F.call.loc14_40: init %tuple.type.2 = call %F.ref.loc14_39() to %.loc14_42.6 // CHECK:STDOUT: %.loc14_42.7: %tuple.type.3 = tuple_literal (%F.call.loc14_35, %F.call.loc14_40) -// CHECK:STDOUT: %.loc14_42.8: init %.2 = array_init (%F.call.loc14_35, %F.call.loc14_40) to %v.var -// CHECK:STDOUT: %.loc14_43: init %.2 = converted %.loc14_42.7, %.loc14_42.8 +// CHECK:STDOUT: %.loc14_42.8: init %.3 = array_init (%F.call.loc14_35, %F.call.loc14_40) to %v.var +// CHECK:STDOUT: %.loc14_43: init %.3 = converted %.loc14_42.7, %.loc14_42.8 // CHECK:STDOUT: assign %v.var, %.loc14_43 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/array_vs_tuple.carbon b/toolchain/check/testdata/array/array_vs_tuple.carbon index 77501f3193a2..00a6339c2143 100644 --- a/toolchain/check/testdata/array/array_vs_tuple.carbon +++ b/toolchain/check/testdata/array/array_vs_tuple.carbon @@ -19,33 +19,38 @@ fn G() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.6: i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.30: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.31: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 1 [template] -// CHECK:STDOUT: %.33: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 2 [template] -// CHECK:STDOUT: %.35: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.36: i32 = int_value 3 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.32, %.34, %.36) [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.28: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.34: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.35: = specific_function %.34, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.36: %i32 = int_value 3 [template] +// CHECK:STDOUT: %array: %.3 = tuple_value (%.30, %.33, %.36) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (type, type, type) [template] -// CHECK:STDOUT: %tuple.type.3: type = tuple_type (i32, i32, i32) [template] -// CHECK:STDOUT: %tuple: %tuple.type.3 = tuple_value (%.32, %.34, %.36) [template] +// CHECK:STDOUT: %tuple.type.3: type = tuple_type (%i32, %i32, %i32) [template] +// CHECK:STDOUT: %tuple: %tuple.type.3 = tuple_value (%.30, %.33, %.36) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -63,78 +68,88 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_16: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_32.loc13, %.loc13_11.1 [template = i32] -// CHECK:STDOUT: %.loc13_17: type = array_type %.loc13_16, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %.loc13_22: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc13_25: Core.IntLiteral = int_value 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc13_28: Core.IntLiteral = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc13_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_16: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc13_11.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_11.3: type = converted %int.make_type_signed.loc13, %.loc13_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_17: type = array_type %.loc13_16, %i32 [template = constants.%.3] +// CHECK:STDOUT: %a.var: ref %.3 = var a +// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var +// CHECK:STDOUT: %.loc13_22: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc13_25: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc13_28: Core.IntLiteral = int_value 3 [template = constants.%.2] // CHECK:STDOUT: %.loc13_29.1: %tuple.type.1 = tuple_literal (%.loc13_22, %.loc13_25, %.loc13_28) -// CHECK:STDOUT: %.loc13_29.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_29.3: = bound_method %.loc13_22, %.loc13_29.2 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc13_29.1: init i32 = call %.loc13_29.3(%.loc13_22) [template = constants.%.32] -// CHECK:STDOUT: %.loc13_29.4: init i32 = converted %.loc13_22, %int.convert_checked.loc13_29.1 [template = constants.%.32] -// CHECK:STDOUT: %.loc13_29.5: i32 = int_value 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc13_29.6: ref i32 = array_index %a.var, %.loc13_29.5 -// CHECK:STDOUT: %.loc13_29.7: init i32 = initialize_from %.loc13_29.4 to %.loc13_29.6 [template = constants.%.32] -// CHECK:STDOUT: %.loc13_29.8: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_29.9: = bound_method %.loc13_25, %.loc13_29.8 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc13_29.2: init i32 = call %.loc13_29.9(%.loc13_25) [template = constants.%.34] -// CHECK:STDOUT: %.loc13_29.10: init i32 = converted %.loc13_25, %int.convert_checked.loc13_29.2 [template = constants.%.34] -// CHECK:STDOUT: %.loc13_29.11: i32 = int_value 1 [template = constants.%.32] -// CHECK:STDOUT: %.loc13_29.12: ref i32 = array_index %a.var, %.loc13_29.11 -// CHECK:STDOUT: %.loc13_29.13: init i32 = initialize_from %.loc13_29.10 to %.loc13_29.12 [template = constants.%.34] -// CHECK:STDOUT: %.loc13_29.14: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_29.15: = bound_method %.loc13_28, %.loc13_29.14 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc13_29.3: init i32 = call %.loc13_29.15(%.loc13_28) [template = constants.%.36] -// CHECK:STDOUT: %.loc13_29.16: init i32 = converted %.loc13_28, %int.convert_checked.loc13_29.3 [template = constants.%.36] -// CHECK:STDOUT: %.loc13_29.17: i32 = int_value 2 [template = constants.%.34] -// CHECK:STDOUT: %.loc13_29.18: ref i32 = array_index %a.var, %.loc13_29.17 -// CHECK:STDOUT: %.loc13_29.19: init i32 = initialize_from %.loc13_29.16 to %.loc13_29.18 [template = constants.%.36] -// CHECK:STDOUT: %.loc13_29.20: init %.2 = array_init (%.loc13_29.7, %.loc13_29.13, %.loc13_29.19) to %a.var [template = constants.%array] -// CHECK:STDOUT: %.loc13_30: init %.2 = converted %.loc13_29.1, %.loc13_29.20 [template = constants.%array] +// CHECK:STDOUT: %.loc13_29.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_29.3: = bound_method %.loc13_22, %.loc13_29.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc13_29.4: = specific_function %.loc13_29.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc13_29.1: init %i32 = call %.loc13_29.4(%.loc13_22) [template = constants.%.30] +// CHECK:STDOUT: %.loc13_29.5: init %i32 = converted %.loc13_22, %int.convert_checked.loc13_29.1 [template = constants.%.30] +// CHECK:STDOUT: %.loc13_29.6: Core.IntLiteral = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc13_29.7: ref %i32 = array_index %a.var, %.loc13_29.6 +// CHECK:STDOUT: %.loc13_29.8: init %i32 = initialize_from %.loc13_29.5 to %.loc13_29.7 [template = constants.%.30] +// CHECK:STDOUT: %.loc13_29.9: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_29.10: = bound_method %.loc13_25, %.loc13_29.9 [template = constants.%.31] +// CHECK:STDOUT: %.loc13_29.11: = specific_function %.loc13_29.10, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc13_29.2: init %i32 = call %.loc13_29.11(%.loc13_25) [template = constants.%.33] +// CHECK:STDOUT: %.loc13_29.12: init %i32 = converted %.loc13_25, %int.convert_checked.loc13_29.2 [template = constants.%.33] +// CHECK:STDOUT: %.loc13_29.13: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc13_29.14: ref %i32 = array_index %a.var, %.loc13_29.13 +// CHECK:STDOUT: %.loc13_29.15: init %i32 = initialize_from %.loc13_29.12 to %.loc13_29.14 [template = constants.%.33] +// CHECK:STDOUT: %.loc13_29.16: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_29.17: = bound_method %.loc13_28, %.loc13_29.16 [template = constants.%.34] +// CHECK:STDOUT: %.loc13_29.18: = specific_function %.loc13_29.17, @Convert.2(constants.%.1) [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc13_29.3: init %i32 = call %.loc13_29.18(%.loc13_28) [template = constants.%.36] +// CHECK:STDOUT: %.loc13_29.19: init %i32 = converted %.loc13_28, %int.convert_checked.loc13_29.3 [template = constants.%.36] +// CHECK:STDOUT: %.loc13_29.20: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc13_29.21: ref %i32 = array_index %a.var, %.loc13_29.20 +// CHECK:STDOUT: %.loc13_29.22: init %i32 = initialize_from %.loc13_29.19 to %.loc13_29.21 [template = constants.%.36] +// CHECK:STDOUT: %.loc13_29.23: init %.3 = array_init (%.loc13_29.8, %.loc13_29.15, %.loc13_29.22) to %a.var [template = constants.%array] +// CHECK:STDOUT: %.loc13_30: init %.3 = converted %.loc13_29.1, %.loc13_29.23 [template = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc13_30 -// CHECK:STDOUT: %int.make_type_32.loc14_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_24.1: %tuple.type.2 = tuple_literal (%int.make_type_32.loc14_11, %int.make_type_32.loc14_16, %int.make_type_32.loc14_21) -// CHECK:STDOUT: %.loc14_24.2: type = value_of_initializer %int.make_type_32.loc14_11 [template = i32] -// CHECK:STDOUT: %.loc14_24.3: type = converted %int.make_type_32.loc14_11, %.loc14_24.2 [template = i32] -// CHECK:STDOUT: %.loc14_24.4: type = value_of_initializer %int.make_type_32.loc14_16 [template = i32] -// CHECK:STDOUT: %.loc14_24.5: type = converted %int.make_type_32.loc14_16, %.loc14_24.4 [template = i32] -// CHECK:STDOUT: %.loc14_24.6: type = value_of_initializer %int.make_type_32.loc14_21 [template = i32] -// CHECK:STDOUT: %.loc14_24.7: type = converted %int.make_type_32.loc14_21, %.loc14_24.6 [template = i32] +// CHECK:STDOUT: %.loc14_11: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_11: init type = call constants.%Int(%.loc14_11) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_16: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_16: init type = call constants.%Int(%.loc14_16) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_21: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_21: init type = call constants.%Int(%.loc14_21) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.1: %tuple.type.2 = tuple_literal (%int.make_type_signed.loc14_11, %int.make_type_signed.loc14_16, %int.make_type_signed.loc14_21) +// CHECK:STDOUT: %.loc14_24.2: type = value_of_initializer %int.make_type_signed.loc14_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.3: type = converted %int.make_type_signed.loc14_11, %.loc14_24.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.4: type = value_of_initializer %int.make_type_signed.loc14_16 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.5: type = converted %int.make_type_signed.loc14_16, %.loc14_24.4 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.6: type = value_of_initializer %int.make_type_signed.loc14_21 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.7: type = converted %int.make_type_signed.loc14_21, %.loc14_24.6 [template = constants.%i32] // CHECK:STDOUT: %.loc14_24.8: type = converted %.loc14_24.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %b.var: ref %tuple.type.3 = var b // CHECK:STDOUT: %b: ref %tuple.type.3 = bind_name b, %b.var -// CHECK:STDOUT: %.loc14_29: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_32: Core.IntLiteral = int_value 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc14_35: Core.IntLiteral = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc14_29: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_32: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc14_35: Core.IntLiteral = int_value 3 [template = constants.%.2] // CHECK:STDOUT: %.loc14_36.1: %tuple.type.1 = tuple_literal (%.loc14_29, %.loc14_32, %.loc14_35) -// CHECK:STDOUT: %.loc14_36.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_36.3: = bound_method %.loc14_29, %.loc14_36.2 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc14_36.1: init i32 = call %.loc14_36.3(%.loc14_29) [template = constants.%.32] -// CHECK:STDOUT: %.loc14_36.4: init i32 = converted %.loc14_29, %int.convert_checked.loc14_36.1 [template = constants.%.32] -// CHECK:STDOUT: %.loc14_36.5: ref i32 = tuple_access %b.var, element0 -// CHECK:STDOUT: %.loc14_36.6: init i32 = initialize_from %.loc14_36.4 to %.loc14_36.5 [template = constants.%.32] -// CHECK:STDOUT: %.loc14_36.7: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_36.8: = bound_method %.loc14_32, %.loc14_36.7 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc14_36.2: init i32 = call %.loc14_36.8(%.loc14_32) [template = constants.%.34] -// CHECK:STDOUT: %.loc14_36.9: init i32 = converted %.loc14_32, %int.convert_checked.loc14_36.2 [template = constants.%.34] -// CHECK:STDOUT: %.loc14_36.10: ref i32 = tuple_access %b.var, element1 -// CHECK:STDOUT: %.loc14_36.11: init i32 = initialize_from %.loc14_36.9 to %.loc14_36.10 [template = constants.%.34] -// CHECK:STDOUT: %.loc14_36.12: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_36.13: = bound_method %.loc14_35, %.loc14_36.12 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc14_36.3: init i32 = call %.loc14_36.13(%.loc14_35) [template = constants.%.36] -// CHECK:STDOUT: %.loc14_36.14: init i32 = converted %.loc14_35, %int.convert_checked.loc14_36.3 [template = constants.%.36] -// CHECK:STDOUT: %.loc14_36.15: ref i32 = tuple_access %b.var, element2 -// CHECK:STDOUT: %.loc14_36.16: init i32 = initialize_from %.loc14_36.14 to %.loc14_36.15 [template = constants.%.36] -// CHECK:STDOUT: %.loc14_36.17: init %tuple.type.3 = tuple_init (%.loc14_36.6, %.loc14_36.11, %.loc14_36.16) to %b.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc14_37: init %tuple.type.3 = converted %.loc14_36.1, %.loc14_36.17 [template = constants.%tuple] +// CHECK:STDOUT: %.loc14_36.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_36.3: = bound_method %.loc14_29, %.loc14_36.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc14_36.4: = specific_function %.loc14_36.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc14_36.1: init %i32 = call %.loc14_36.4(%.loc14_29) [template = constants.%.30] +// CHECK:STDOUT: %.loc14_36.5: init %i32 = converted %.loc14_29, %int.convert_checked.loc14_36.1 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_36.6: ref %i32 = tuple_access %b.var, element0 +// CHECK:STDOUT: %.loc14_36.7: init %i32 = initialize_from %.loc14_36.5 to %.loc14_36.6 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_36.8: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_36.9: = bound_method %.loc14_32, %.loc14_36.8 [template = constants.%.31] +// CHECK:STDOUT: %.loc14_36.10: = specific_function %.loc14_36.9, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc14_36.2: init %i32 = call %.loc14_36.10(%.loc14_32) [template = constants.%.33] +// CHECK:STDOUT: %.loc14_36.11: init %i32 = converted %.loc14_32, %int.convert_checked.loc14_36.2 [template = constants.%.33] +// CHECK:STDOUT: %.loc14_36.12: ref %i32 = tuple_access %b.var, element1 +// CHECK:STDOUT: %.loc14_36.13: init %i32 = initialize_from %.loc14_36.11 to %.loc14_36.12 [template = constants.%.33] +// CHECK:STDOUT: %.loc14_36.14: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_36.15: = bound_method %.loc14_35, %.loc14_36.14 [template = constants.%.34] +// CHECK:STDOUT: %.loc14_36.16: = specific_function %.loc14_36.15, @Convert.2(constants.%.1) [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc14_36.3: init %i32 = call %.loc14_36.16(%.loc14_35) [template = constants.%.36] +// CHECK:STDOUT: %.loc14_36.17: init %i32 = converted %.loc14_35, %int.convert_checked.loc14_36.3 [template = constants.%.36] +// CHECK:STDOUT: %.loc14_36.18: ref %i32 = tuple_access %b.var, element2 +// CHECK:STDOUT: %.loc14_36.19: init %i32 = initialize_from %.loc14_36.17 to %.loc14_36.18 [template = constants.%.36] +// CHECK:STDOUT: %.loc14_36.20: init %tuple.type.3 = tuple_init (%.loc14_36.7, %.loc14_36.13, %.loc14_36.19) to %b.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc14_37: init %tuple.type.3 = converted %.loc14_36.1, %.loc14_36.20 [template = constants.%tuple] // CHECK:STDOUT: assign %b.var, %.loc14_37 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/assign_return_value.carbon b/toolchain/check/testdata/array/assign_return_value.carbon index e32f1f6db904..e1526a12f0a0 100644 --- a/toolchain/check/testdata/array/assign_return_value.carbon +++ b/toolchain/check/testdata/array/assign_return_value.carbon @@ -17,30 +17,33 @@ fn Run() { // CHECK:STDOUT: --- assign_return_value.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32) [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.27) [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.25) [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.29: type = array_type %.28, i32 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.27: type = array_type %.26, %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -58,10 +61,11 @@ fn Run() { // CHECK:STDOUT: %return.patt: %tuple.type.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_16.1: %tuple.type.1 = tuple_literal (%int.make_type_32) -// CHECK:STDOUT: %.loc11_16.2: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_16.3: type = converted %int.make_type_32, %.loc11_16.2 [template = i32] +// CHECK:STDOUT: %.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_12) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_16.1: %tuple.type.1 = tuple_literal (%int.make_type_signed) +// CHECK:STDOUT: %.loc11_16.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_16.3: type = converted %int.make_type_signed, %.loc11_16.2 [template = constants.%i32] // CHECK:STDOUT: %.loc11_16.4: type = converted %.loc11_16.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param @@ -71,38 +75,40 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %tuple.type.2 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_28: Core.IntLiteral = int_value 0 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_28: Core.IntLiteral = int_value 0 [template = constants.%.2] // CHECK:STDOUT: %.loc11_30.1: %tuple.type.3 = tuple_literal (%.loc11_28) -// CHECK:STDOUT: %.loc11_30.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_30.3: = bound_method %.loc11_28, %.loc11_30.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc11_30.3(%.loc11_28) [template = constants.%.27] -// CHECK:STDOUT: %.loc11_30.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc11_30.5: i32 = converted %.loc11_28, %.loc11_30.4 [template = constants.%.27] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.loc11_30.5) [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_30.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_30.3: = bound_method %.loc11_28, %.loc11_30.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc11_30.4: = specific_function %.loc11_30.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc11_30.4(%.loc11_28) [template = constants.%.25] +// CHECK:STDOUT: %.loc11_30.5: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc11_30.6: %i32 = converted %.loc11_28, %.loc11_30.5 [template = constants.%.25] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.loc11_30.6) [template = constants.%tuple] // CHECK:STDOUT: %.loc11_31: %tuple.type.2 = converted %.loc11_30.1, %tuple [template = constants.%tuple] // CHECK:STDOUT: return %.loc11_31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_16: Core.IntLiteral = int_value 1 [template = constants.%.28] -// CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_32, %.loc14_11.1 [template = i32] -// CHECK:STDOUT: %.loc14_17: type = array_type %.loc14_16, i32 [template = constants.%.29] -// CHECK:STDOUT: %t.var: ref %.29 = var t -// CHECK:STDOUT: %t: ref %.29 = bind_name t, %t.var +// CHECK:STDOUT: %.loc14_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_16: Core.IntLiteral = int_value 1 [template = constants.%.26] +// CHECK:STDOUT: %.loc14_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_11.3: type = converted %int.make_type_signed, %.loc14_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_17: type = array_type %.loc14_16, %i32 [template = constants.%.27] +// CHECK:STDOUT: %t.var: ref %.27 = var t +// CHECK:STDOUT: %t: ref %.27 = bind_name t, %t.var // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %F.call: init %tuple.type.2 = call %F.ref() // CHECK:STDOUT: %.loc14_22.1: ref %tuple.type.2 = temporary_storage // CHECK:STDOUT: %.loc14_22.2: ref %tuple.type.2 = temporary %.loc14_22.1, %F.call -// CHECK:STDOUT: %.loc14_22.3: ref i32 = tuple_access %.loc14_22.2, element0 -// CHECK:STDOUT: %.loc14_22.4: i32 = bind_value %.loc14_22.3 -// CHECK:STDOUT: %.loc14_22.5: i32 = int_value 0 [template = constants.%.27] -// CHECK:STDOUT: %.loc14_22.6: ref i32 = array_index %t.var, %.loc14_22.5 -// CHECK:STDOUT: %.loc14_22.7: init i32 = initialize_from %.loc14_22.4 to %.loc14_22.6 -// CHECK:STDOUT: %.loc14_22.8: init %.29 = array_init (%.loc14_22.7) to %t.var -// CHECK:STDOUT: %.loc14_24: init %.29 = converted %F.call, %.loc14_22.8 +// CHECK:STDOUT: %.loc14_22.3: ref %i32 = tuple_access %.loc14_22.2, element0 +// CHECK:STDOUT: %.loc14_22.4: %i32 = bind_value %.loc14_22.3 +// CHECK:STDOUT: %.loc14_22.5: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_22.6: ref %i32 = array_index %t.var, %.loc14_22.5 +// CHECK:STDOUT: %.loc14_22.7: init %i32 = initialize_from %.loc14_22.4 to %.loc14_22.6 +// CHECK:STDOUT: %.loc14_22.8: init %.27 = array_init (%.loc14_22.7) to %t.var +// CHECK:STDOUT: %.loc14_24: init %.27 = converted %F.call, %.loc14_22.8 // CHECK:STDOUT: assign %t.var, %.loc14_24 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/assign_var.carbon b/toolchain/check/testdata/array/assign_var.carbon index 19ca5eed9a6d..d3d5a03cec26 100644 --- a/toolchain/check/testdata/array/assign_var.carbon +++ b/toolchain/check/testdata/array/assign_var.carbon @@ -14,32 +14,37 @@ var b: [i32; 3] = a; // CHECK:STDOUT: --- assign_var.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32, i32) [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32, %i32) [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 1 [template] -// CHECK:STDOUT: %.31: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 2 [template] -// CHECK:STDOUT: %.33: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 3 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.30, %.32, %.34) [template] -// CHECK:STDOUT: %.35: type = array_type %.4, i32 [template] -// CHECK:STDOUT: %.37: i32 = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.26: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.27: = specific_function %.26, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.28: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.29: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.30: = specific_function %.29, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.31: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.32: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 3 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.28, %.31, %.34) [template] +// CHECK:STDOUT: %.35: type = array_type %.5, %i32 [template] +// CHECK:STDOUT: %.37: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -53,71 +58,78 @@ var b: [i32; 3] = a; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_22.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14, %int.make_type_32.loc11_19) -// CHECK:STDOUT: %.loc11_22.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] -// CHECK:STDOUT: %.loc11_22.3: type = converted %int.make_type_32.loc11_9, %.loc11_22.2 [template = i32] -// CHECK:STDOUT: %.loc11_22.4: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] -// CHECK:STDOUT: %.loc11_22.5: type = converted %int.make_type_32.loc11_14, %.loc11_22.4 [template = i32] -// CHECK:STDOUT: %.loc11_22.6: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32] -// CHECK:STDOUT: %.loc11_22.7: type = converted %int.make_type_32.loc11_19, %.loc11_22.6 [template = i32] +// CHECK:STDOUT: %.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%.loc11_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%.loc11_19) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14, %int.make_type_signed.loc11_19) +// CHECK:STDOUT: %.loc11_22.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22.3: type = converted %int.make_type_signed.loc11_9, %.loc11_22.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22.5: type = converted %int.make_type_signed.loc11_14, %.loc11_22.4 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22.6: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22.7: type = converted %int.make_type_signed.loc11_19, %.loc11_22.6 [template = constants.%i32] // CHECK:STDOUT: %.loc11_22.8: type = converted %.loc11_22.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_14: Core.IntLiteral = int_value 3 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_9.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_9.2: type = converted %int.make_type_32.loc12, %.loc12_9.1 [template = i32] -// CHECK:STDOUT: %.loc12_15: type = array_type %.loc12_14, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc12_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_14: Core.IntLiteral = int_value 3 [template = constants.%.5] +// CHECK:STDOUT: %.loc12_9.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_9.3: type = converted %int.make_type_signed.loc12, %.loc12_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_15: type = array_type %.loc12_14, %i32 [template = constants.%.35] // CHECK:STDOUT: %b.var: ref %.35 = var b // CHECK:STDOUT: %b: ref %.35 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_27: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc11_30: Core.IntLiteral = int_value 2 [template = constants.%.3] -// CHECK:STDOUT: %.loc11_33: Core.IntLiteral = int_value 3 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_27: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_30: Core.IntLiteral = int_value 2 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_33: Core.IntLiteral = int_value 3 [template = constants.%.5] // CHECK:STDOUT: %.loc11_34.1: %tuple.type.3 = tuple_literal (%.loc11_27, %.loc11_30, %.loc11_33) -// CHECK:STDOUT: %.loc11_34.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_34.3: = bound_method %.loc11_27, %.loc11_34.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc11_34.1: init i32 = call %.loc11_34.3(%.loc11_27) [template = constants.%.30] -// CHECK:STDOUT: %.loc11_34.4: init i32 = converted %.loc11_27, %int.convert_checked.loc11_34.1 [template = constants.%.30] -// CHECK:STDOUT: %.loc11_34.5: ref i32 = tuple_access file.%a.var, element0 -// CHECK:STDOUT: %.loc11_34.6: init i32 = initialize_from %.loc11_34.4 to %.loc11_34.5 [template = constants.%.30] -// CHECK:STDOUT: %.loc11_34.7: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_34.8: = bound_method %.loc11_30, %.loc11_34.7 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc11_34.2: init i32 = call %.loc11_34.8(%.loc11_30) [template = constants.%.32] -// CHECK:STDOUT: %.loc11_34.9: init i32 = converted %.loc11_30, %int.convert_checked.loc11_34.2 [template = constants.%.32] -// CHECK:STDOUT: %.loc11_34.10: ref i32 = tuple_access file.%a.var, element1 -// CHECK:STDOUT: %.loc11_34.11: init i32 = initialize_from %.loc11_34.9 to %.loc11_34.10 [template = constants.%.32] -// CHECK:STDOUT: %.loc11_34.12: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_34.13: = bound_method %.loc11_33, %.loc11_34.12 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc11_34.3: init i32 = call %.loc11_34.13(%.loc11_33) [template = constants.%.34] -// CHECK:STDOUT: %.loc11_34.14: init i32 = converted %.loc11_33, %int.convert_checked.loc11_34.3 [template = constants.%.34] -// CHECK:STDOUT: %.loc11_34.15: ref i32 = tuple_access file.%a.var, element2 -// CHECK:STDOUT: %.loc11_34.16: init i32 = initialize_from %.loc11_34.14 to %.loc11_34.15 [template = constants.%.34] -// CHECK:STDOUT: %.loc11_34.17: init %tuple.type.2 = tuple_init (%.loc11_34.6, %.loc11_34.11, %.loc11_34.16) to file.%a.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc11_35: init %tuple.type.2 = converted %.loc11_34.1, %.loc11_34.17 [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_34.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_34.3: = bound_method %.loc11_27, %.loc11_34.2 [template = constants.%.26] +// CHECK:STDOUT: %.loc11_34.4: = specific_function %.loc11_34.3, @Convert.2(constants.%.1) [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc11_34.1: init %i32 = call %.loc11_34.4(%.loc11_27) [template = constants.%.28] +// CHECK:STDOUT: %.loc11_34.5: init %i32 = converted %.loc11_27, %int.convert_checked.loc11_34.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_34.6: ref %i32 = tuple_access file.%a.var, element0 +// CHECK:STDOUT: %.loc11_34.7: init %i32 = initialize_from %.loc11_34.5 to %.loc11_34.6 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_34.8: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_34.9: = bound_method %.loc11_30, %.loc11_34.8 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_34.10: = specific_function %.loc11_34.9, @Convert.2(constants.%.1) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc11_34.2: init %i32 = call %.loc11_34.10(%.loc11_30) [template = constants.%.31] +// CHECK:STDOUT: %.loc11_34.11: init %i32 = converted %.loc11_30, %int.convert_checked.loc11_34.2 [template = constants.%.31] +// CHECK:STDOUT: %.loc11_34.12: ref %i32 = tuple_access file.%a.var, element1 +// CHECK:STDOUT: %.loc11_34.13: init %i32 = initialize_from %.loc11_34.11 to %.loc11_34.12 [template = constants.%.31] +// CHECK:STDOUT: %.loc11_34.14: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_34.15: = bound_method %.loc11_33, %.loc11_34.14 [template = constants.%.32] +// CHECK:STDOUT: %.loc11_34.16: = specific_function %.loc11_34.15, @Convert.2(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc11_34.3: init %i32 = call %.loc11_34.16(%.loc11_33) [template = constants.%.34] +// CHECK:STDOUT: %.loc11_34.17: init %i32 = converted %.loc11_33, %int.convert_checked.loc11_34.3 [template = constants.%.34] +// CHECK:STDOUT: %.loc11_34.18: ref %i32 = tuple_access file.%a.var, element2 +// CHECK:STDOUT: %.loc11_34.19: init %i32 = initialize_from %.loc11_34.17 to %.loc11_34.18 [template = constants.%.34] +// CHECK:STDOUT: %.loc11_34.20: init %tuple.type.2 = tuple_init (%.loc11_34.7, %.loc11_34.13, %.loc11_34.19) to file.%a.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_35: init %tuple.type.2 = converted %.loc11_34.1, %.loc11_34.20 [template = constants.%tuple] // CHECK:STDOUT: assign file.%a.var, %.loc11_35 // CHECK:STDOUT: %a.ref: ref %tuple.type.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc12_19.1: ref i32 = tuple_access %a.ref, element0 -// CHECK:STDOUT: %.loc12_19.2: i32 = bind_value %.loc12_19.1 -// CHECK:STDOUT: %.loc12_19.3: i32 = int_value 0 [template = constants.%.37] -// CHECK:STDOUT: %.loc12_19.4: ref i32 = array_index file.%b.var, %.loc12_19.3 -// CHECK:STDOUT: %.loc12_19.5: init i32 = initialize_from %.loc12_19.2 to %.loc12_19.4 -// CHECK:STDOUT: %.loc12_19.6: ref i32 = tuple_access %a.ref, element1 -// CHECK:STDOUT: %.loc12_19.7: i32 = bind_value %.loc12_19.6 -// CHECK:STDOUT: %.loc12_19.8: i32 = int_value 1 [template = constants.%.30] -// CHECK:STDOUT: %.loc12_19.9: ref i32 = array_index file.%b.var, %.loc12_19.8 -// CHECK:STDOUT: %.loc12_19.10: init i32 = initialize_from %.loc12_19.7 to %.loc12_19.9 -// CHECK:STDOUT: %.loc12_19.11: ref i32 = tuple_access %a.ref, element2 -// CHECK:STDOUT: %.loc12_19.12: i32 = bind_value %.loc12_19.11 -// CHECK:STDOUT: %.loc12_19.13: i32 = int_value 2 [template = constants.%.32] -// CHECK:STDOUT: %.loc12_19.14: ref i32 = array_index file.%b.var, %.loc12_19.13 -// CHECK:STDOUT: %.loc12_19.15: init i32 = initialize_from %.loc12_19.12 to %.loc12_19.14 +// CHECK:STDOUT: %.loc12_19.1: ref %i32 = tuple_access %a.ref, element0 +// CHECK:STDOUT: %.loc12_19.2: %i32 = bind_value %.loc12_19.1 +// CHECK:STDOUT: %.loc12_19.3: Core.IntLiteral = int_value 0 [template = constants.%.37] +// CHECK:STDOUT: %.loc12_19.4: ref %i32 = array_index file.%b.var, %.loc12_19.3 +// CHECK:STDOUT: %.loc12_19.5: init %i32 = initialize_from %.loc12_19.2 to %.loc12_19.4 +// CHECK:STDOUT: %.loc12_19.6: ref %i32 = tuple_access %a.ref, element1 +// CHECK:STDOUT: %.loc12_19.7: %i32 = bind_value %.loc12_19.6 +// CHECK:STDOUT: %.loc12_19.8: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_19.9: ref %i32 = array_index file.%b.var, %.loc12_19.8 +// CHECK:STDOUT: %.loc12_19.10: init %i32 = initialize_from %.loc12_19.7 to %.loc12_19.9 +// CHECK:STDOUT: %.loc12_19.11: ref %i32 = tuple_access %a.ref, element2 +// CHECK:STDOUT: %.loc12_19.12: %i32 = bind_value %.loc12_19.11 +// CHECK:STDOUT: %.loc12_19.13: Core.IntLiteral = int_value 2 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_19.14: ref %i32 = array_index file.%b.var, %.loc12_19.13 +// CHECK:STDOUT: %.loc12_19.15: init %i32 = initialize_from %.loc12_19.12 to %.loc12_19.14 // CHECK:STDOUT: %.loc12_19.16: init %.35 = array_init (%.loc12_19.5, %.loc12_19.10, %.loc12_19.15) to file.%b.var // CHECK:STDOUT: %.loc12_20: init %.35 = converted %a.ref, %.loc12_19.16 // CHECK:STDOUT: assign file.%b.var, %.loc12_20 diff --git a/toolchain/check/testdata/array/base.carbon b/toolchain/check/testdata/array/base.carbon index a21780a18713..73ca0377452f 100644 --- a/toolchain/check/testdata/array/base.carbon +++ b/toolchain/check/testdata/array/base.carbon @@ -15,44 +15,46 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: --- base.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %.4: i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.29: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 1 [template] -// CHECK:STDOUT: %array.1: %.2 = tuple_value (%.30) [template] -// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.26: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.27: = specific_function %.26, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.28: %i32 = int_value 1 [template] +// CHECK:STDOUT: %array.1: %.3 = tuple_value (%.28) [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.33: type = array_type %.32, f64 [template] -// CHECK:STDOUT: %.35: f64 = float_literal 11.100000000000001 [template] -// CHECK:STDOUT: %.36: f64 = float_literal 2.2000000000000002 [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.31: type = array_type %.30, f64 [template] +// CHECK:STDOUT: %.33: f64 = float_literal 11.100000000000001 [template] +// CHECK:STDOUT: %.34: f64 = float_literal 2.2000000000000002 [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (f64, f64) [template] -// CHECK:STDOUT: %array.2: %.33 = tuple_value (%.35, %.36) [template] -// CHECK:STDOUT: %.37: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %.38: type = array_type %.37, %empty_tuple.type [template] +// CHECK:STDOUT: %array.2: %.31 = tuple_value (%.33, %.34) [template] +// CHECK:STDOUT: %.35: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.36: type = array_type %.35, %empty_tuple.type [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%empty_tuple.type, %empty_tuple.type, %empty_tuple.type, %empty_tuple.type, %empty_tuple.type) [template] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template] -// CHECK:STDOUT: %.40: i32 = int_value 2 [template] -// CHECK:STDOUT: %.41: i32 = int_value 3 [template] -// CHECK:STDOUT: %.42: i32 = int_value 4 [template] -// CHECK:STDOUT: %array.3: %.38 = tuple_value (%empty_tuple, %empty_tuple, %empty_tuple, %empty_tuple, %empty_tuple) [template] +// CHECK:STDOUT: %.38: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.39: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %array.3: %.36 = tuple_value (%empty_tuple, %empty_tuple, %empty_tuple, %empty_tuple, %empty_tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Float = %import_ref.51 +// CHECK:STDOUT: .Float = %import_ref.38 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -66,54 +68,56 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %.loc12_9.1: Core.IntLiteral = int_value 64 [template = constants.%.31] +// CHECK:STDOUT: %.loc11_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_9.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.3: type = converted %int.make_type_signed, %.loc11_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, %i32 [template = constants.%.3] +// CHECK:STDOUT: %a.var: ref %.3 = var a +// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var +// CHECK:STDOUT: %.loc12_9.1: Core.IntLiteral = int_value 64 [template = constants.%.29] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc12_9.1) [template = f64] -// CHECK:STDOUT: %.loc12_14: Core.IntLiteral = int_value 2 [template = constants.%.32] +// CHECK:STDOUT: %.loc12_14: Core.IntLiteral = int_value 2 [template = constants.%.30] // CHECK:STDOUT: %.loc12_9.2: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc12_9.3: type = converted %float.make_type, %.loc12_9.2 [template = f64] -// CHECK:STDOUT: %.loc12_15: type = array_type %.loc12_14, f64 [template = constants.%.33] -// CHECK:STDOUT: %b.var: ref %.33 = var b -// CHECK:STDOUT: %b: ref %.33 = bind_name b, %b.var +// CHECK:STDOUT: %.loc12_15: type = array_type %.loc12_14, f64 [template = constants.%.31] +// CHECK:STDOUT: %b.var: ref %.31 = var b +// CHECK:STDOUT: %b: ref %.31 = bind_name b, %b.var // CHECK:STDOUT: %.loc13_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc13_13: Core.IntLiteral = int_value 5 [template = constants.%.37] +// CHECK:STDOUT: %.loc13_13: Core.IntLiteral = int_value 5 [template = constants.%.35] // CHECK:STDOUT: %.loc13_10.2: type = converted %.loc13_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc13_14: type = array_type %.loc13_13, %empty_tuple.type [template = constants.%.38] -// CHECK:STDOUT: %c.var: ref %.38 = var c -// CHECK:STDOUT: %c: ref %.38 = bind_name c, %c.var +// CHECK:STDOUT: %.loc13_14: type = array_type %.loc13_13, %empty_tuple.type [template = constants.%.36] +// CHECK:STDOUT: %c.var: ref %.36 = var c +// CHECK:STDOUT: %c: ref %.36 = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %.loc11_22.1: %tuple.type.1 = tuple_literal (%.loc11_20) -// CHECK:STDOUT: %.loc11_22.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_22.3: = bound_method %.loc11_20, %.loc11_22.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc11_22.3(%.loc11_20) [template = constants.%.30] -// CHECK:STDOUT: %.loc11_22.4: init i32 = converted %.loc11_20, %int.convert_checked [template = constants.%.30] -// CHECK:STDOUT: %.loc11_22.5: i32 = int_value 0 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_22.6: ref i32 = array_index file.%a.var, %.loc11_22.5 -// CHECK:STDOUT: %.loc11_22.7: init i32 = initialize_from %.loc11_22.4 to %.loc11_22.6 [template = constants.%.30] -// CHECK:STDOUT: %.loc11_22.8: init %.2 = array_init (%.loc11_22.7) to file.%a.var [template = constants.%array.1] -// CHECK:STDOUT: %.loc11_23: init %.2 = converted %.loc11_22.1, %.loc11_22.8 [template = constants.%array.1] +// CHECK:STDOUT: %.loc11_22.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_22.3: = bound_method %.loc11_20, %.loc11_22.2 [template = constants.%.26] +// CHECK:STDOUT: %.loc11_22.4: = specific_function %.loc11_22.3, @Convert.2(constants.%.1) [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc11_22.4(%.loc11_20) [template = constants.%.28] +// CHECK:STDOUT: %.loc11_22.5: init %i32 = converted %.loc11_20, %int.convert_checked [template = constants.%.28] +// CHECK:STDOUT: %.loc11_22.6: Core.IntLiteral = int_value 0 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_22.7: ref %i32 = array_index file.%a.var, %.loc11_22.6 +// CHECK:STDOUT: %.loc11_22.8: init %i32 = initialize_from %.loc11_22.5 to %.loc11_22.7 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_22.9: init %.3 = array_init (%.loc11_22.8) to file.%a.var [template = constants.%array.1] +// CHECK:STDOUT: %.loc11_23: init %.3 = converted %.loc11_22.1, %.loc11_22.9 [template = constants.%array.1] // CHECK:STDOUT: assign file.%a.var, %.loc11_23 -// CHECK:STDOUT: %.loc12_20: f64 = float_literal 11.100000000000001 [template = constants.%.35] -// CHECK:STDOUT: %.loc12_26: f64 = float_literal 2.2000000000000002 [template = constants.%.36] +// CHECK:STDOUT: %.loc12_20: f64 = float_literal 11.100000000000001 [template = constants.%.33] +// CHECK:STDOUT: %.loc12_26: f64 = float_literal 2.2000000000000002 [template = constants.%.34] // CHECK:STDOUT: %.loc12_30.1: %tuple.type.2 = tuple_literal (%.loc12_20, %.loc12_26) -// CHECK:STDOUT: %.loc12_30.2: i32 = int_value 0 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_30.2: Core.IntLiteral = int_value 0 [template = constants.%.5] // CHECK:STDOUT: %.loc12_30.3: ref f64 = array_index file.%b.var, %.loc12_30.2 -// CHECK:STDOUT: %.loc12_30.4: init f64 = initialize_from %.loc12_20 to %.loc12_30.3 [template = constants.%.35] -// CHECK:STDOUT: %.loc12_30.5: i32 = int_value 1 [template = constants.%.30] +// CHECK:STDOUT: %.loc12_30.4: init f64 = initialize_from %.loc12_20 to %.loc12_30.3 [template = constants.%.33] +// CHECK:STDOUT: %.loc12_30.5: Core.IntLiteral = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %.loc12_30.6: ref f64 = array_index file.%b.var, %.loc12_30.5 -// CHECK:STDOUT: %.loc12_30.7: init f64 = initialize_from %.loc12_26 to %.loc12_30.6 [template = constants.%.36] -// CHECK:STDOUT: %.loc12_30.8: init %.33 = array_init (%.loc12_30.4, %.loc12_30.7) to file.%b.var [template = constants.%array.2] -// CHECK:STDOUT: %.loc12_31: init %.33 = converted %.loc12_30.1, %.loc12_30.8 [template = constants.%array.2] +// CHECK:STDOUT: %.loc12_30.7: init f64 = initialize_from %.loc12_26 to %.loc12_30.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc12_30.8: init %.31 = array_init (%.loc12_30.4, %.loc12_30.7) to file.%b.var [template = constants.%array.2] +// CHECK:STDOUT: %.loc12_31: init %.31 = converted %.loc12_30.1, %.loc12_30.8 [template = constants.%array.2] // CHECK:STDOUT: assign file.%b.var, %.loc12_31 // CHECK:STDOUT: %.loc13_20.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc13_24.1: %empty_tuple.type = tuple_literal () @@ -121,28 +125,28 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: %.loc13_32.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc13_36.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc13_38.1: %tuple.type.3 = tuple_literal (%.loc13_20.1, %.loc13_24.1, %.loc13_28.1, %.loc13_32.1, %.loc13_36.1) -// CHECK:STDOUT: %.loc13_38.2: i32 = int_value 0 [template = constants.%.4] +// CHECK:STDOUT: %.loc13_38.2: Core.IntLiteral = int_value 0 [template = constants.%.5] // CHECK:STDOUT: %.loc13_38.3: ref %empty_tuple.type = array_index file.%c.var, %.loc13_38.2 // CHECK:STDOUT: %.loc13_20.2: init %empty_tuple.type = tuple_init () to %.loc13_38.3 [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc13_38.4: init %empty_tuple.type = converted %.loc13_20.1, %.loc13_20.2 [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc13_38.5: i32 = int_value 1 [template = constants.%.30] +// CHECK:STDOUT: %.loc13_38.5: Core.IntLiteral = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %.loc13_38.6: ref %empty_tuple.type = array_index file.%c.var, %.loc13_38.5 // CHECK:STDOUT: %.loc13_24.2: init %empty_tuple.type = tuple_init () to %.loc13_38.6 [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc13_38.7: init %empty_tuple.type = converted %.loc13_24.1, %.loc13_24.2 [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc13_38.8: i32 = int_value 2 [template = constants.%.40] +// CHECK:STDOUT: %.loc13_38.8: Core.IntLiteral = int_value 2 [template = constants.%.30] // CHECK:STDOUT: %.loc13_38.9: ref %empty_tuple.type = array_index file.%c.var, %.loc13_38.8 // CHECK:STDOUT: %.loc13_28.2: init %empty_tuple.type = tuple_init () to %.loc13_38.9 [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc13_38.10: init %empty_tuple.type = converted %.loc13_28.1, %.loc13_28.2 [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc13_38.11: i32 = int_value 3 [template = constants.%.41] +// CHECK:STDOUT: %.loc13_38.11: Core.IntLiteral = int_value 3 [template = constants.%.38] // CHECK:STDOUT: %.loc13_38.12: ref %empty_tuple.type = array_index file.%c.var, %.loc13_38.11 // CHECK:STDOUT: %.loc13_32.2: init %empty_tuple.type = tuple_init () to %.loc13_38.12 [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc13_38.13: init %empty_tuple.type = converted %.loc13_32.1, %.loc13_32.2 [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc13_38.14: i32 = int_value 4 [template = constants.%.42] +// CHECK:STDOUT: %.loc13_38.14: Core.IntLiteral = int_value 4 [template = constants.%.39] // CHECK:STDOUT: %.loc13_38.15: ref %empty_tuple.type = array_index file.%c.var, %.loc13_38.14 // CHECK:STDOUT: %.loc13_36.2: init %empty_tuple.type = tuple_init () to %.loc13_38.15 [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc13_38.16: init %empty_tuple.type = converted %.loc13_36.1, %.loc13_36.2 [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc13_38.17: init %.38 = array_init (%.loc13_38.4, %.loc13_38.7, %.loc13_38.10, %.loc13_38.13, %.loc13_38.16) to file.%c.var [template = constants.%array.3] -// CHECK:STDOUT: %.loc13_39: init %.38 = converted %.loc13_38.1, %.loc13_38.17 [template = constants.%array.3] +// CHECK:STDOUT: %.loc13_38.17: init %.36 = array_init (%.loc13_38.4, %.loc13_38.7, %.loc13_38.10, %.loc13_38.13, %.loc13_38.16) to file.%c.var [template = constants.%array.3] +// CHECK:STDOUT: %.loc13_39: init %.36 = converted %.loc13_38.1, %.loc13_38.17 [template = constants.%array.3] // CHECK:STDOUT: assign file.%c.var, %.loc13_39 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/canonicalize_index.carbon b/toolchain/check/testdata/array/canonicalize_index.carbon index 8feef2b8a96b..2b6356c44de3 100644 --- a/toolchain/check/testdata/array/canonicalize_index.carbon +++ b/toolchain/check/testdata/array/canonicalize_index.carbon @@ -18,50 +18,55 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: --- canonicalize_index.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Add.type: type = fn_type @Add [template] // CHECK:STDOUT: %Add: %Add.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = int_type unsigned, %.1 [template] +// CHECK:STDOUT: %u32: type = int_type unsigned, %.1 [template] // CHECK:STDOUT: %ConvertToU32.type: type = fn_type @ConvertToU32 [template] // CHECK:STDOUT: %ConvertToU32: %ConvertToU32.type = struct_value () [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 3 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.29: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 1 [template] -// CHECK:STDOUT: %.31: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 2 [template] -// CHECK:STDOUT: %.33: i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.34: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.35: = bound_method %.33, %Convert.16 [template] -// CHECK:STDOUT: %.36: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.37: type = array_type %.36, i32 [template] -// CHECK:STDOUT: %.38: type = ptr_type %.37 [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.15 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.4(%.1) [template] +// CHECK:STDOUT: %.34: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, %i32 [template] +// CHECK:STDOUT: %.36: type = ptr_type %.35 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.39: i32 = int_value 0 [template] -// CHECK:STDOUT: %.40: = bound_method %.36, %Convert.15 [template] -// CHECK:STDOUT: %array: %.37 = tuple_value (%.30, %.32, %.33) [template] -// CHECK:STDOUT: %.41: %.2 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.17: type = fn_type @Convert.5, @impl.6(%.1) [template] -// CHECK:STDOUT: %Convert.17: %Convert.type.17 = struct_value () [template] -// CHECK:STDOUT: %.43: = interface_witness (%Convert.17) [template] -// CHECK:STDOUT: %.44: = bound_method %.41, %Convert.17 [template] -// CHECK:STDOUT: %.45: = specific_function %.44, @Convert.5(%.1) [template] +// CHECK:STDOUT: %.37: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.38: = bound_method %.34, %Convert.14 [template] +// CHECK:STDOUT: %.39: = specific_function %.38, @Convert.2(%.1) [template] +// CHECK:STDOUT: %array: %.35 = tuple_value (%.26, %.29, %.30) [template] +// CHECK:STDOUT: %.40: %u32 = int_value 3 [template] +// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.5, @impl.4(%.1) [template] +// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] +// CHECK:STDOUT: %.41: = interface_witness (%Convert.16) [template] +// CHECK:STDOUT: %.42: = bound_method %.40, %Convert.16 [template] +// CHECK:STDOUT: %.43: = specific_function %.42, @Convert.5(%.1) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .UInt = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude @@ -80,143 +85,157 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %int.make_type_32.loc11_27 [template = i32] -// CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_32.loc11_27, %.loc11_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed.loc11_11, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%.loc11_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.2: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.3: type = converted %int.make_type_signed.loc11_19, %.loc11_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_27: init type = call constants.%Int(%.loc11_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_27.2: type = value_of_initializer %int.make_type_signed.loc11_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_27.3: type = converted %int.make_type_signed.loc11_27, %.loc11_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertToU32.decl: %ConvertToU32.type = fn_decl @ConvertToU32 [template = constants.%ConvertToU32] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_20.2: type = converted %int.make_type_32, %.loc12_20.1 [template = i32] +// CHECK:STDOUT: %.loc12_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_20.3: type = converted %int.make_type_signed, %.loc12_20.2 [template = constants.%i32] // CHECK:STDOUT: %.loc12_28.1: Core.IntLiteral = int_value 32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc12_28.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc12_28.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%.2] -// CHECK:STDOUT: %.loc12_28.3: type = converted %int.make_type_unsigned, %.loc12_28.2 [template = constants.%.2] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param +// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc12_28.1) [template = constants.%u32] +// CHECK:STDOUT: %.loc12_28.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%u32] +// CHECK:STDOUT: %.loc12_28.3: type = converted %int.make_type_unsigned, %.loc12_28.2 [template = constants.%u32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %u32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc14_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%.loc14_9.1) [template = constants.%i32] // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] -// CHECK:STDOUT: %.loc14_18.1: Core.IntLiteral = int_value 1 [template = constants.%.3] -// CHECK:STDOUT: %.loc14_21.1: Core.IntLiteral = int_value 2 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_18.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_18.3: = bound_method %.loc14_18.1, %.loc14_18.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc14_18: init i32 = call %.loc14_18.3(%.loc14_18.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc14_18.4: i32 = value_of_initializer %int.convert_checked.loc14_18 [template = constants.%.30] -// CHECK:STDOUT: %.loc14_18.5: i32 = converted %.loc14_18.1, %.loc14_18.4 [template = constants.%.30] -// CHECK:STDOUT: %.loc14_21.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_21.3: = bound_method %.loc14_21.1, %.loc14_21.2 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc14_21: init i32 = call %.loc14_21.3(%.loc14_21.1) [template = constants.%.32] -// CHECK:STDOUT: %.loc14_21.4: i32 = value_of_initializer %int.convert_checked.loc14_21 [template = constants.%.32] -// CHECK:STDOUT: %.loc14_21.5: i32 = converted %.loc14_21.1, %.loc14_21.4 [template = constants.%.32] -// CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%.loc14_18.5, %.loc14_21.5) [template = constants.%.33] -// CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] -// CHECK:STDOUT: %.loc14_9.2: type = converted %int.make_type_32.loc14, %.loc14_9.1 [template = i32] -// CHECK:STDOUT: %.loc14_17.1: %Convert.type.5 = interface_witness_access constants.%.34, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc14_17.2: = bound_method %int.sadd, %.loc14_17.1 [template = constants.%.35] -// CHECK:STDOUT: %.loc14_17.3: i32 = value_of_initializer %int.sadd [template = constants.%.33] -// CHECK:STDOUT: %.loc14_17.4: i32 = converted %int.sadd, %.loc14_17.3 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc14_17: init Core.IntLiteral = call %.loc14_17.2(%.loc14_17.4) [template = constants.%.36] -// CHECK:STDOUT: %.loc14_17.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_17 [template = constants.%.36] -// CHECK:STDOUT: %.loc14_17.6: Core.IntLiteral = converted %int.sadd, %.loc14_17.5 [template = constants.%.36] -// CHECK:STDOUT: %.loc14_23: type = array_type %.loc14_17.6, i32 [template = constants.%.37] -// CHECK:STDOUT: %a.var: ref %.37 = var a -// CHECK:STDOUT: %a: ref %.37 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_14: Core.IntLiteral = int_value 3 [template = constants.%.36] -// CHECK:STDOUT: %.loc15_9.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_9.2: type = converted %int.make_type_32.loc15, %.loc15_9.1 [template = i32] -// CHECK:STDOUT: %.loc15_15: type = array_type %.loc15_14, i32 [template = constants.%.37] -// CHECK:STDOUT: %.loc15_16: type = ptr_type %.37 [template = constants.%.38] -// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc14_18.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_21.1: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc14_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_18.3: = bound_method %.loc14_18.1, %.loc14_18.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc14_18.4: = specific_function %.loc14_18.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc14_18: init %i32 = call %.loc14_18.4(%.loc14_18.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc14_18.5: %i32 = value_of_initializer %int.convert_checked.loc14_18 [template = constants.%.26] +// CHECK:STDOUT: %.loc14_18.6: %i32 = converted %.loc14_18.1, %.loc14_18.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc14_21.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_21.3: = bound_method %.loc14_21.1, %.loc14_21.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc14_21.4: = specific_function %.loc14_21.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc14_21: init %i32 = call %.loc14_21.4(%.loc14_21.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc14_21.5: %i32 = value_of_initializer %int.convert_checked.loc14_21 [template = constants.%.29] +// CHECK:STDOUT: %.loc14_21.6: %i32 = converted %.loc14_21.1, %.loc14_21.5 [template = constants.%.29] +// CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%.loc14_18.6, %.loc14_21.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc14_9.2: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_9.3: type = converted %int.make_type_signed.loc14, %.loc14_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_17.1: %Convert.type.6 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc14_17.2: = bound_method %int.sadd, %.loc14_17.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc14_17.3: = specific_function %.loc14_17.2, @Convert.4(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc14_17.4: %i32 = value_of_initializer %int.sadd [template = constants.%.30] +// CHECK:STDOUT: %.loc14_17.5: %i32 = converted %int.sadd, %.loc14_17.4 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc14_17: init Core.IntLiteral = call %.loc14_17.3(%.loc14_17.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc14_17.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_17 [template = constants.%.34] +// CHECK:STDOUT: %.loc14_17.7: Core.IntLiteral = converted %int.sadd, %.loc14_17.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc14_23: type = array_type %.loc14_17.7, %i32 [template = constants.%.35] +// CHECK:STDOUT: %a.var: ref %.35 = var a +// CHECK:STDOUT: %a: ref %.35 = bind_name a, %a.var +// CHECK:STDOUT: %.loc15_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_14: Core.IntLiteral = int_value 3 [template = constants.%.34] +// CHECK:STDOUT: %.loc15_9.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_9.3: type = converted %int.make_type_signed.loc15, %.loc15_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_15: type = array_type %.loc15_14, %i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc15_16: type = ptr_type %.35 [template = constants.%.36] +// CHECK:STDOUT: %.loc16_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%.loc16_9.1) [template = constants.%i32] // CHECK:STDOUT: %ConvertToU32.ref: %ConvertToU32.type = name_ref ConvertToU32, %ConvertToU32.decl [template = constants.%ConvertToU32] -// CHECK:STDOUT: %.loc16_27.1: Core.IntLiteral = int_value 3 [template = constants.%.36] -// CHECK:STDOUT: %.loc16_27.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_27.3: = bound_method %.loc16_27.1, %.loc16_27.2 [template = constants.%.40] -// CHECK:STDOUT: %int.convert_checked.loc16_27: init i32 = call %.loc16_27.3(%.loc16_27.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc16_27.4: i32 = value_of_initializer %int.convert_checked.loc16_27 [template = constants.%.33] -// CHECK:STDOUT: %.loc16_27.5: i32 = converted %.loc16_27.1, %.loc16_27.4 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc16_26.1: init %.2 = call %ConvertToU32.ref(%.loc16_27.5) [template = constants.%.41] -// CHECK:STDOUT: %.loc16_9.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] -// CHECK:STDOUT: %.loc16_9.2: type = converted %int.make_type_32.loc16, %.loc16_9.1 [template = i32] -// CHECK:STDOUT: %.loc16_26.1: %Convert.type.5 = interface_witness_access constants.%.43, element0 [template = constants.%Convert.17] -// CHECK:STDOUT: %.loc16_26.2: = bound_method %int.convert_checked.loc16_26.1, %.loc16_26.1 [template = constants.%.44] -// CHECK:STDOUT: %.loc16_26.3: = specific_function %.loc16_26.2, @Convert.5(constants.%.1) [template = constants.%.45] -// CHECK:STDOUT: %.loc16_26.4: %.2 = value_of_initializer %int.convert_checked.loc16_26.1 [template = constants.%.41] -// CHECK:STDOUT: %.loc16_26.5: %.2 = converted %int.convert_checked.loc16_26.1, %.loc16_26.4 [template = constants.%.41] -// CHECK:STDOUT: %int.convert_checked.loc16_26.2: init Core.IntLiteral = call %.loc16_26.3(%.loc16_26.5) [template = constants.%.36] -// CHECK:STDOUT: %.loc16_26.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc16_26.2 [template = constants.%.36] -// CHECK:STDOUT: %.loc16_26.7: Core.IntLiteral = converted %int.convert_checked.loc16_26.1, %.loc16_26.6 [template = constants.%.36] -// CHECK:STDOUT: %.loc16_29: type = array_type %.loc16_26.7, i32 [template = constants.%.37] -// CHECK:STDOUT: %.loc16_30: type = ptr_type %.37 [template = constants.%.38] +// CHECK:STDOUT: %.loc16_27.1: Core.IntLiteral = int_value 3 [template = constants.%.34] +// CHECK:STDOUT: %.loc16_27.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc16_27.3: = bound_method %.loc16_27.1, %.loc16_27.2 [template = constants.%.38] +// CHECK:STDOUT: %.loc16_27.4: = specific_function %.loc16_27.3, @Convert.2(constants.%.1) [template = constants.%.39] +// CHECK:STDOUT: %int.convert_checked.loc16_27: init %i32 = call %.loc16_27.4(%.loc16_27.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc16_27.5: %i32 = value_of_initializer %int.convert_checked.loc16_27 [template = constants.%.30] +// CHECK:STDOUT: %.loc16_27.6: %i32 = converted %.loc16_27.1, %.loc16_27.5 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc16_26.1: init %u32 = call %ConvertToU32.ref(%.loc16_27.6) [template = constants.%.40] +// CHECK:STDOUT: %.loc16_9.2: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_9.3: type = converted %int.make_type_signed.loc16, %.loc16_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_26.1: %Convert.type.6 = interface_witness_access constants.%.41, element0 [template = constants.%Convert.16] +// CHECK:STDOUT: %.loc16_26.2: = bound_method %int.convert_checked.loc16_26.1, %.loc16_26.1 [template = constants.%.42] +// CHECK:STDOUT: %.loc16_26.3: = specific_function %.loc16_26.2, @Convert.5(constants.%.1) [template = constants.%.43] +// CHECK:STDOUT: %.loc16_26.4: %u32 = value_of_initializer %int.convert_checked.loc16_26.1 [template = constants.%.40] +// CHECK:STDOUT: %.loc16_26.5: %u32 = converted %int.convert_checked.loc16_26.1, %.loc16_26.4 [template = constants.%.40] +// CHECK:STDOUT: %int.convert_checked.loc16_26.2: init Core.IntLiteral = call %.loc16_26.3(%.loc16_26.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc16_26.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc16_26.2 [template = constants.%.34] +// CHECK:STDOUT: %.loc16_26.7: Core.IntLiteral = converted %int.convert_checked.loc16_26.1, %.loc16_26.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc16_29: type = array_type %.loc16_26.7, %i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc16_30: type = ptr_type %.35 [template = constants.%.36] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @Add(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertToU32(%a.param_patt: i32) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @ConvertToU32(%a.param_patt: %i32) -> %u32 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc14_28: Core.IntLiteral = int_value 1 [template = constants.%.3] -// CHECK:STDOUT: %.loc14_31: Core.IntLiteral = int_value 2 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_34: Core.IntLiteral = int_value 3 [template = constants.%.36] +// CHECK:STDOUT: %.loc14_28: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_31: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc14_34: Core.IntLiteral = int_value 3 [template = constants.%.34] // CHECK:STDOUT: %.loc14_35.1: %tuple.type = tuple_literal (%.loc14_28, %.loc14_31, %.loc14_34) -// CHECK:STDOUT: %.loc14_35.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_35.3: = bound_method %.loc14_28, %.loc14_35.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc14_35.1: init i32 = call %.loc14_35.3(%.loc14_28) [template = constants.%.30] -// CHECK:STDOUT: %.loc14_35.4: init i32 = converted %.loc14_28, %int.convert_checked.loc14_35.1 [template = constants.%.30] -// CHECK:STDOUT: %.loc14_35.5: i32 = int_value 0 [template = constants.%.39] -// CHECK:STDOUT: %.loc14_35.6: ref i32 = array_index file.%a.var, %.loc14_35.5 -// CHECK:STDOUT: %.loc14_35.7: init i32 = initialize_from %.loc14_35.4 to %.loc14_35.6 [template = constants.%.30] -// CHECK:STDOUT: %.loc14_35.8: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_35.9: = bound_method %.loc14_31, %.loc14_35.8 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc14_35.2: init i32 = call %.loc14_35.9(%.loc14_31) [template = constants.%.32] -// CHECK:STDOUT: %.loc14_35.10: init i32 = converted %.loc14_31, %int.convert_checked.loc14_35.2 [template = constants.%.32] -// CHECK:STDOUT: %.loc14_35.11: i32 = int_value 1 [template = constants.%.30] -// CHECK:STDOUT: %.loc14_35.12: ref i32 = array_index file.%a.var, %.loc14_35.11 -// CHECK:STDOUT: %.loc14_35.13: init i32 = initialize_from %.loc14_35.10 to %.loc14_35.12 [template = constants.%.32] -// CHECK:STDOUT: %.loc14_35.14: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_35.15: = bound_method %.loc14_34, %.loc14_35.14 [template = constants.%.40] -// CHECK:STDOUT: %int.convert_checked.loc14_35.3: init i32 = call %.loc14_35.15(%.loc14_34) [template = constants.%.33] -// CHECK:STDOUT: %.loc14_35.16: init i32 = converted %.loc14_34, %int.convert_checked.loc14_35.3 [template = constants.%.33] -// CHECK:STDOUT: %.loc14_35.17: i32 = int_value 2 [template = constants.%.32] -// CHECK:STDOUT: %.loc14_35.18: ref i32 = array_index file.%a.var, %.loc14_35.17 -// CHECK:STDOUT: %.loc14_35.19: init i32 = initialize_from %.loc14_35.16 to %.loc14_35.18 [template = constants.%.33] -// CHECK:STDOUT: %.loc14_35.20: init %.37 = array_init (%.loc14_35.7, %.loc14_35.13, %.loc14_35.19) to file.%a.var [template = constants.%array] -// CHECK:STDOUT: %.loc14_36: init %.37 = converted %.loc14_35.1, %.loc14_35.20 [template = constants.%array] +// CHECK:STDOUT: %.loc14_35.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_35.3: = bound_method %.loc14_28, %.loc14_35.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc14_35.4: = specific_function %.loc14_35.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc14_35.1: init %i32 = call %.loc14_35.4(%.loc14_28) [template = constants.%.26] +// CHECK:STDOUT: %.loc14_35.5: init %i32 = converted %.loc14_28, %int.convert_checked.loc14_35.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc14_35.6: Core.IntLiteral = int_value 0 [template = constants.%.37] +// CHECK:STDOUT: %.loc14_35.7: ref %i32 = array_index file.%a.var, %.loc14_35.6 +// CHECK:STDOUT: %.loc14_35.8: init %i32 = initialize_from %.loc14_35.5 to %.loc14_35.7 [template = constants.%.26] +// CHECK:STDOUT: %.loc14_35.9: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_35.10: = bound_method %.loc14_31, %.loc14_35.9 [template = constants.%.27] +// CHECK:STDOUT: %.loc14_35.11: = specific_function %.loc14_35.10, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc14_35.2: init %i32 = call %.loc14_35.11(%.loc14_31) [template = constants.%.29] +// CHECK:STDOUT: %.loc14_35.12: init %i32 = converted %.loc14_31, %int.convert_checked.loc14_35.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc14_35.13: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_35.14: ref %i32 = array_index file.%a.var, %.loc14_35.13 +// CHECK:STDOUT: %.loc14_35.15: init %i32 = initialize_from %.loc14_35.12 to %.loc14_35.14 [template = constants.%.29] +// CHECK:STDOUT: %.loc14_35.16: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_35.17: = bound_method %.loc14_34, %.loc14_35.16 [template = constants.%.38] +// CHECK:STDOUT: %.loc14_35.18: = specific_function %.loc14_35.17, @Convert.2(constants.%.1) [template = constants.%.39] +// CHECK:STDOUT: %int.convert_checked.loc14_35.3: init %i32 = call %.loc14_35.18(%.loc14_34) [template = constants.%.30] +// CHECK:STDOUT: %.loc14_35.19: init %i32 = converted %.loc14_34, %int.convert_checked.loc14_35.3 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_35.20: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc14_35.21: ref %i32 = array_index file.%a.var, %.loc14_35.20 +// CHECK:STDOUT: %.loc14_35.22: init %i32 = initialize_from %.loc14_35.19 to %.loc14_35.21 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_35.23: init %.35 = array_init (%.loc14_35.8, %.loc14_35.15, %.loc14_35.22) to file.%a.var [template = constants.%array] +// CHECK:STDOUT: %.loc14_36: init %.35 = converted %.loc14_35.1, %.loc14_35.23 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc14_36 -// CHECK:STDOUT: %a.ref.loc15: ref %.37 = name_ref a, file.%a -// CHECK:STDOUT: %.loc15: %.38 = addr_of %a.ref.loc15 -// CHECK:STDOUT: %b: %.38 = bind_name b, %.loc15 -// CHECK:STDOUT: %a.ref.loc16: ref %.37 = name_ref a, file.%a -// CHECK:STDOUT: %.loc16: %.38 = addr_of %a.ref.loc16 -// CHECK:STDOUT: %c: %.38 = bind_name c, %.loc16 +// CHECK:STDOUT: %a.ref.loc15: ref %.35 = name_ref a, file.%a +// CHECK:STDOUT: %.loc15: %.36 = addr_of %a.ref.loc15 +// CHECK:STDOUT: %b: %.36 = bind_name b, %.loc15 +// CHECK:STDOUT: %a.ref.loc16: ref %.35 = name_ref a, file.%a +// CHECK:STDOUT: %.loc16: %.36 = addr_of %a.ref.loc16 +// CHECK:STDOUT: %c: %.36 = bind_name c, %.loc16 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/fail_bound_negative.carbon b/toolchain/check/testdata/array/fail_bound_negative.carbon index 32dd37bb4ff1..c5a470e7c4e0 100644 --- a/toolchain/check/testdata/array/fail_bound_negative.carbon +++ b/toolchain/check/testdata/array/fail_bound_negative.carbon @@ -18,29 +18,33 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: --- fail_bound_negative.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.26: %i32 = int_value -1 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] -// CHECK:STDOUT: %.28: i32 = int_value -1 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.30: = bound_method %.28, %Convert.16 [template] -// CHECK:STDOUT: %.31: Core.IntLiteral = int_value -1 [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.26, %Convert.15 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.4(%.1) [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value -1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -55,44 +59,49 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32.loc11_14, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_22.1: type = value_of_initializer %int.make_type_32.loc11_22 [template = i32] -// CHECK:STDOUT: %.loc11_22.2: type = converted %int.make_type_32.loc11_22, %.loc11_22.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%.loc11_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.2: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.3: type = converted %int.make_type_signed.loc11_14, %.loc11_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_22: init type = call constants.%Int(%.loc11_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22.2: type = value_of_initializer %int.make_type_signed.loc11_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22.3: type = converted %int.make_type_signed.loc11_22, %.loc11_22.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc16_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc16_9.1) [template = constants.%i32] // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc16_21.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc16_21.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_21.3: = bound_method %.loc16_21.1, %.loc16_21.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc16_21: init i32 = call %.loc16_21.3(%.loc16_21.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc16_21.4: i32 = value_of_initializer %int.convert_checked.loc16_21 [template = constants.%.27] -// CHECK:STDOUT: %.loc16_21.5: i32 = converted %.loc16_21.1, %.loc16_21.4 [template = constants.%.27] -// CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc16_21.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc16_9.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_9.2: type = converted %int.make_type_32, %.loc16_9.1 [template = i32] -// CHECK:STDOUT: %.loc16_20.1: %Convert.type.5 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc16_20.2: = bound_method %int.snegate, %.loc16_20.1 [template = constants.%.30] -// CHECK:STDOUT: %.loc16_20.3: i32 = value_of_initializer %int.snegate [template = constants.%.28] -// CHECK:STDOUT: %.loc16_20.4: i32 = converted %int.snegate, %.loc16_20.3 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc16_20: init Core.IntLiteral = call %.loc16_20.2(%.loc16_20.4) [template = constants.%.31] -// CHECK:STDOUT: %.loc16_20.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc16_20 [template = constants.%.31] -// CHECK:STDOUT: %.loc16_20.6: Core.IntLiteral = converted %int.snegate, %.loc16_20.5 [template = constants.%.31] -// CHECK:STDOUT: %.loc16_23: type = array_type %.loc16_20.6, i32 [template = ] +// CHECK:STDOUT: %.loc16_21.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc16_21.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc16_21.3: = bound_method %.loc16_21.1, %.loc16_21.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc16_21.4: = specific_function %.loc16_21.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc16_21: init %i32 = call %.loc16_21.4(%.loc16_21.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc16_21.5: %i32 = value_of_initializer %int.convert_checked.loc16_21 [template = constants.%.25] +// CHECK:STDOUT: %.loc16_21.6: %i32 = converted %.loc16_21.1, %.loc16_21.5 [template = constants.%.25] +// CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc16_21.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc16_9.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc16_9.3: type = converted %int.make_type_signed, %.loc16_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_20.1: %Convert.type.6 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc16_20.2: = bound_method %int.snegate, %.loc16_20.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc16_20.3: = specific_function %.loc16_20.2, @Convert.4(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc16_20.4: %i32 = value_of_initializer %int.snegate [template = constants.%.26] +// CHECK:STDOUT: %.loc16_20.5: %i32 = converted %int.snegate, %.loc16_20.4 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc16_20: init Core.IntLiteral = call %.loc16_20.3(%.loc16_20.5) [template = constants.%.30] +// CHECK:STDOUT: %.loc16_20.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc16_20 [template = constants.%.30] +// CHECK:STDOUT: %.loc16_20.7: Core.IntLiteral = converted %int.snegate, %.loc16_20.6 [template = constants.%.30] +// CHECK:STDOUT: %.loc16_23: type = array_type %.loc16_20.7, %i32 [template = ] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%n.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%n.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/fail_bound_overflow.carbon b/toolchain/check/testdata/array/fail_bound_overflow.carbon index e599af0acca5..690ad9fa43eb 100644 --- a/toolchain/check/testdata/array/fail_bound_overflow.carbon +++ b/toolchain/check/testdata/array/fail_bound_overflow.carbon @@ -25,15 +25,17 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: --- fail_bound_overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 39999999999999999993 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 39999999999999999993 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -47,15 +49,16 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_14: Core.IntLiteral = int_value 39999999999999999993 [template = constants.%.1] -// CHECK:STDOUT: %.loc15_9.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_9.2: type = converted %int.make_type_32, %.loc15_9.1 [template = i32] -// CHECK:STDOUT: %.loc15_34: type = array_type %.loc15_14, i32 [template = ] +// CHECK:STDOUT: %.loc15_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_14: Core.IntLiteral = int_value 39999999999999999993 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_9.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_9.3: type = converted %int.make_type_signed, %.loc15_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_34: type = array_type %.loc15_14, %i32 [template = ] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var -// CHECK:STDOUT: %.loc23_9.1: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc23_12: Core.IntLiteral = int_value 39999999999999999993 [template = constants.%.1] +// CHECK:STDOUT: %.loc23_9.1: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc23_12: Core.IntLiteral = int_value 39999999999999999993 [template = constants.%.2] // CHECK:STDOUT: %.loc23_9.2: type = converted %.loc23_9.1, [template = ] // CHECK:STDOUT: %.loc23_32: type = array_type %.loc23_12, [template = ] // CHECK:STDOUT: %b.var: ref = var b diff --git a/toolchain/check/testdata/array/fail_out_of_bound.carbon b/toolchain/check/testdata/array/fail_out_of_bound.carbon index f02be9819125..cfaf01267d34 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound.carbon @@ -16,18 +16,20 @@ var a: [i32; 1] = (1, 2, 3); // CHECK:STDOUT: --- fail_out_of_bound.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -39,20 +41,21 @@ var a: [i32; 1] = (1, 2, 3); // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_14: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_9.2: type = converted %int.make_type_32, %.loc14_9.1 [template = i32] -// CHECK:STDOUT: %.loc14_15: type = array_type %.loc14_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var +// CHECK:STDOUT: %.loc14_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_14: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_9.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_9.3: type = converted %int.make_type_signed, %.loc14_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_15: type = array_type %.loc14_14, %i32 [template = constants.%.3] +// CHECK:STDOUT: %a.var: ref %.3 = var a +// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc14_20: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc14_23: Core.IntLiteral = int_value 2 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_26: Core.IntLiteral = int_value 3 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_20: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_23: Core.IntLiteral = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_26: Core.IntLiteral = int_value 3 [template = constants.%.6] // CHECK:STDOUT: %.loc14_27: %tuple.type = tuple_literal (%.loc14_20, %.loc14_23, %.loc14_26) // CHECK:STDOUT: assign file.%a.var, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon index ca773daf84c3..5d8b646af1d8 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon @@ -17,32 +17,37 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: --- fail_out_of_bound_non_literal.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.6: i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.30: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.31: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 1 [template] -// CHECK:STDOUT: %.33: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 2 [template] -// CHECK:STDOUT: %.35: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.36: i32 = int_value 3 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.32, %.34, %.36) [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.28: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.34: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.35: = specific_function %.34, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.36: %i32 = int_value 3 [template] +// CHECK:STDOUT: %array: %.3 = tuple_value (%.30, %.33, %.36) [template] // CHECK:STDOUT: %.37: type = struct_type {.index: Core.IntLiteral} [template] -// CHECK:STDOUT: %struct: %.37 = struct_value (%.1) [template] +// CHECK:STDOUT: %struct: %.37 = struct_value (%.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -56,63 +61,69 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc11_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_9.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.3: type = converted %int.make_type_signed.loc11, %.loc11_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, %i32 [template = constants.%.3] +// CHECK:STDOUT: %a.var: ref %.3 = var a +// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed.loc15, %.loc15_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_23: Core.IntLiteral = int_value 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_23: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 3 [template = constants.%.2] // CHECK:STDOUT: %.loc11_27.1: %tuple.type = tuple_literal (%.loc11_20, %.loc11_23, %.loc11_26) -// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_20, %.loc11_27.2 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init i32 = call %.loc11_27.3(%.loc11_20) [template = constants.%.32] -// CHECK:STDOUT: %.loc11_27.4: init i32 = converted %.loc11_20, %int.convert_checked.loc11_27.1 [template = constants.%.32] -// CHECK:STDOUT: %.loc11_27.5: i32 = int_value 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc11_27.6: ref i32 = array_index file.%a.var, %.loc11_27.5 -// CHECK:STDOUT: %.loc11_27.7: init i32 = initialize_from %.loc11_27.4 to %.loc11_27.6 [template = constants.%.32] -// CHECK:STDOUT: %.loc11_27.8: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.9: = bound_method %.loc11_23, %.loc11_27.8 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init i32 = call %.loc11_27.9(%.loc11_23) [template = constants.%.34] -// CHECK:STDOUT: %.loc11_27.10: init i32 = converted %.loc11_23, %int.convert_checked.loc11_27.2 [template = constants.%.34] -// CHECK:STDOUT: %.loc11_27.11: i32 = int_value 1 [template = constants.%.32] -// CHECK:STDOUT: %.loc11_27.12: ref i32 = array_index file.%a.var, %.loc11_27.11 -// CHECK:STDOUT: %.loc11_27.13: init i32 = initialize_from %.loc11_27.10 to %.loc11_27.12 [template = constants.%.34] -// CHECK:STDOUT: %.loc11_27.14: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.15: = bound_method %.loc11_26, %.loc11_27.14 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc11_27.3: init i32 = call %.loc11_27.15(%.loc11_26) [template = constants.%.36] -// CHECK:STDOUT: %.loc11_27.16: init i32 = converted %.loc11_26, %int.convert_checked.loc11_27.3 [template = constants.%.36] -// CHECK:STDOUT: %.loc11_27.17: i32 = int_value 2 [template = constants.%.34] -// CHECK:STDOUT: %.loc11_27.18: ref i32 = array_index file.%a.var, %.loc11_27.17 -// CHECK:STDOUT: %.loc11_27.19: init i32 = initialize_from %.loc11_27.16 to %.loc11_27.18 [template = constants.%.36] -// CHECK:STDOUT: %.loc11_27.20: init %.2 = array_init (%.loc11_27.7, %.loc11_27.13, %.loc11_27.19) to file.%a.var [template = constants.%array] -// CHECK:STDOUT: %.loc11_28: init %.2 = converted %.loc11_27.1, %.loc11_27.20 [template = constants.%array] +// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_20, %.loc11_27.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_27.4: = specific_function %.loc11_27.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %.loc11_27.4(%.loc11_20) [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.5: init %i32 = converted %.loc11_20, %int.convert_checked.loc11_27.1 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.6: Core.IntLiteral = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc11_27.7: ref %i32 = array_index file.%a.var, %.loc11_27.6 +// CHECK:STDOUT: %.loc11_27.8: init %i32 = initialize_from %.loc11_27.5 to %.loc11_27.7 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.9: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.10: = bound_method %.loc11_23, %.loc11_27.9 [template = constants.%.31] +// CHECK:STDOUT: %.loc11_27.11: = specific_function %.loc11_27.10, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %.loc11_27.11(%.loc11_23) [template = constants.%.33] +// CHECK:STDOUT: %.loc11_27.12: init %i32 = converted %.loc11_23, %int.convert_checked.loc11_27.2 [template = constants.%.33] +// CHECK:STDOUT: %.loc11_27.13: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_27.14: ref %i32 = array_index file.%a.var, %.loc11_27.13 +// CHECK:STDOUT: %.loc11_27.15: init %i32 = initialize_from %.loc11_27.12 to %.loc11_27.14 [template = constants.%.33] +// CHECK:STDOUT: %.loc11_27.16: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.17: = bound_method %.loc11_26, %.loc11_27.16 [template = constants.%.34] +// CHECK:STDOUT: %.loc11_27.18: = specific_function %.loc11_27.17, @Convert.2(constants.%.1) [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc11_27.3: init %i32 = call %.loc11_27.18(%.loc11_26) [template = constants.%.36] +// CHECK:STDOUT: %.loc11_27.19: init %i32 = converted %.loc11_26, %int.convert_checked.loc11_27.3 [template = constants.%.36] +// CHECK:STDOUT: %.loc11_27.20: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_27.21: ref %i32 = array_index file.%a.var, %.loc11_27.20 +// CHECK:STDOUT: %.loc11_27.22: init %i32 = initialize_from %.loc11_27.19 to %.loc11_27.21 [template = constants.%.36] +// CHECK:STDOUT: %.loc11_27.23: init %.3 = array_init (%.loc11_27.8, %.loc11_27.15, %.loc11_27.22) to file.%a.var [template = constants.%array] +// CHECK:STDOUT: %.loc11_28: init %.3 = converted %.loc11_27.1, %.loc11_27.23 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_28 -// CHECK:STDOUT: %a.ref: ref %.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc15_26: Core.IntLiteral = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %a.ref: ref %.3 = name_ref a, file.%a +// CHECK:STDOUT: %.loc15_26: Core.IntLiteral = int_value 3 [template = constants.%.2] // CHECK:STDOUT: %.loc15_27.1: %.37 = struct_literal (%.loc15_26) // CHECK:STDOUT: %struct: %.37 = struct_value (%.loc15_26) [template = constants.%struct] // CHECK:STDOUT: %.loc15_27.2: %.37 = converted %.loc15_27.1, %struct [template = constants.%struct] -// CHECK:STDOUT: %.loc15_28.1: Core.IntLiteral = struct_access %.loc15_27.2, element0 [template = constants.%.1] -// CHECK:STDOUT: %.loc15_28.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_28.3: = bound_method %.loc15_28.1, %.loc15_28.2 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc15: init i32 = call %.loc15_28.3(%.loc15_28.1) [template = constants.%.36] -// CHECK:STDOUT: %.loc15_28.4: i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%.36] -// CHECK:STDOUT: %.loc15_28.5: i32 = converted %.loc15_28.1, %.loc15_28.4 [template = constants.%.36] -// CHECK:STDOUT: %.loc15_34.1: ref i32 = array_index %a.ref, %.loc15_28.5 [template = ] -// CHECK:STDOUT: %.loc15_34.2: i32 = bind_value %.loc15_34.1 +// CHECK:STDOUT: %.loc15_28.1: Core.IntLiteral = struct_access %.loc15_27.2, element0 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_28.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_28.3: = bound_method %.loc15_28.1, %.loc15_28.2 [template = constants.%.34] +// CHECK:STDOUT: %.loc15_28.4: = specific_function %.loc15_28.3, @Convert.2(constants.%.1) [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %.loc15_28.4(%.loc15_28.1) [template = constants.%.36] +// CHECK:STDOUT: %.loc15_28.5: %i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%.36] +// CHECK:STDOUT: %.loc15_28.6: %i32 = converted %.loc15_28.1, %.loc15_28.5 [template = constants.%.36] +// CHECK:STDOUT: %.loc15_34.1: ref %i32 = array_index %a.ref, %.loc15_28.6 [template = ] +// CHECK:STDOUT: %.loc15_34.2: %i32 = bind_value %.loc15_34.1 // CHECK:STDOUT: assign file.%b.var, %.loc15_34.2 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index 8dbee867df9f..fb40a888dff5 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -42,32 +42,35 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: --- fail_type_mismatch.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.6: String = string_literal "Hello" [template] -// CHECK:STDOUT: %.7: String = string_literal "World" [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.7: String = string_literal "Hello" [template] +// CHECK:STDOUT: %.8: String = string_literal "World" [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (Core.IntLiteral, String, String) [template] -// CHECK:STDOUT: %.8: i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.33: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 1 [template] +// CHECK:STDOUT: %.9: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.29: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 1 [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (type, type, type) [template] -// CHECK:STDOUT: %tuple.type.3: type = tuple_type (i32, String, String) [template] -// CHECK:STDOUT: %.36: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %tuple.type.3: type = tuple_type (%i32, String, String) [template] +// CHECK:STDOUT: %.34: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.5: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %tuple.type.6: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.7: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %tuple.type.7: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -85,79 +88,87 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_14: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc18_9.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] -// CHECK:STDOUT: %.loc18_9.2: type = converted %int.make_type_32.loc18, %.loc18_9.1 [template = i32] -// CHECK:STDOUT: %.loc18_15: type = array_type %.loc18_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc20_29.1: %tuple.type.2 = tuple_literal (%int.make_type_32.loc20, String, String) -// CHECK:STDOUT: %.loc20_29.2: type = value_of_initializer %int.make_type_32.loc20 [template = i32] -// CHECK:STDOUT: %.loc20_29.3: type = converted %int.make_type_32.loc20, %.loc20_29.2 [template = i32] +// CHECK:STDOUT: %.loc18_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%.loc18_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_14: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc18_9.2: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_9.3: type = converted %int.make_type_signed.loc18, %.loc18_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_15: type = array_type %.loc18_14, %i32 [template = constants.%.3] +// CHECK:STDOUT: %a.var: ref %.3 = var a +// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var +// CHECK:STDOUT: %.loc20_10: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%.loc20_10) [template = constants.%i32] +// CHECK:STDOUT: %.loc20_29.1: %tuple.type.2 = tuple_literal (%int.make_type_signed.loc20, String, String) +// CHECK:STDOUT: %.loc20_29.2: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] +// CHECK:STDOUT: %.loc20_29.3: type = converted %int.make_type_signed.loc20, %.loc20_29.2 [template = constants.%i32] // CHECK:STDOUT: %.loc20_29.4: type = converted %.loc20_29.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %t1.var: ref %tuple.type.3 = var t1 // CHECK:STDOUT: %t1: ref %tuple.type.3 = bind_name t1, %t1.var -// CHECK:STDOUT: %int.make_type_32.loc28: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc28_14: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc28_9.1: type = value_of_initializer %int.make_type_32.loc28 [template = i32] -// CHECK:STDOUT: %.loc28_9.2: type = converted %int.make_type_32.loc28, %.loc28_9.1 [template = i32] -// CHECK:STDOUT: %.loc28_15: type = array_type %.loc28_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %b.var: ref %.2 = var b -// CHECK:STDOUT: %b: ref %.2 = bind_name b, %b.var -// CHECK:STDOUT: %int.make_type_32.loc34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc34_14: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc34_9.1: type = value_of_initializer %int.make_type_32.loc34 [template = i32] -// CHECK:STDOUT: %.loc34_9.2: type = converted %int.make_type_32.loc34, %.loc34_9.1 [template = i32] -// CHECK:STDOUT: %.loc34_15: type = array_type %.loc34_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %c.var: ref %.2 = var c -// CHECK:STDOUT: %c: ref %.2 = bind_name c, %c.var -// CHECK:STDOUT: %int.make_type_32.loc36_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc36_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc36_18.1: %tuple.type.6 = tuple_literal (%int.make_type_32.loc36_10, %int.make_type_32.loc36_15) -// CHECK:STDOUT: %.loc36_18.2: type = value_of_initializer %int.make_type_32.loc36_10 [template = i32] -// CHECK:STDOUT: %.loc36_18.3: type = converted %int.make_type_32.loc36_10, %.loc36_18.2 [template = i32] -// CHECK:STDOUT: %.loc36_18.4: type = value_of_initializer %int.make_type_32.loc36_15 [template = i32] -// CHECK:STDOUT: %.loc36_18.5: type = converted %int.make_type_32.loc36_15, %.loc36_18.4 [template = i32] +// CHECK:STDOUT: %.loc28_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc28: init type = call constants.%Int(%.loc28_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc28_14: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc28_9.2: type = value_of_initializer %int.make_type_signed.loc28 [template = constants.%i32] +// CHECK:STDOUT: %.loc28_9.3: type = converted %int.make_type_signed.loc28, %.loc28_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc28_15: type = array_type %.loc28_14, %i32 [template = constants.%.3] +// CHECK:STDOUT: %b.var: ref %.3 = var b +// CHECK:STDOUT: %b: ref %.3 = bind_name b, %b.var +// CHECK:STDOUT: %.loc34_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc34: init type = call constants.%Int(%.loc34_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc34_14: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc34_9.2: type = value_of_initializer %int.make_type_signed.loc34 [template = constants.%i32] +// CHECK:STDOUT: %.loc34_9.3: type = converted %int.make_type_signed.loc34, %.loc34_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc34_15: type = array_type %.loc34_14, %i32 [template = constants.%.3] +// CHECK:STDOUT: %c.var: ref %.3 = var c +// CHECK:STDOUT: %c: ref %.3 = bind_name c, %c.var +// CHECK:STDOUT: %.loc36_10: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc36_10: init type = call constants.%Int(%.loc36_10) [template = constants.%i32] +// CHECK:STDOUT: %.loc36_15: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc36_15: init type = call constants.%Int(%.loc36_15) [template = constants.%i32] +// CHECK:STDOUT: %.loc36_18.1: %tuple.type.6 = tuple_literal (%int.make_type_signed.loc36_10, %int.make_type_signed.loc36_15) +// CHECK:STDOUT: %.loc36_18.2: type = value_of_initializer %int.make_type_signed.loc36_10 [template = constants.%i32] +// CHECK:STDOUT: %.loc36_18.3: type = converted %int.make_type_signed.loc36_10, %.loc36_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc36_18.4: type = value_of_initializer %int.make_type_signed.loc36_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc36_18.5: type = converted %int.make_type_signed.loc36_15, %.loc36_18.4 [template = constants.%i32] // CHECK:STDOUT: %.loc36_18.6: type = converted %.loc36_18.1, constants.%tuple.type.7 [template = constants.%tuple.type.7] // CHECK:STDOUT: %t2.var: ref %tuple.type.7 = var t2 // CHECK:STDOUT: %t2: ref %tuple.type.7 = bind_name t2, %t2.var -// CHECK:STDOUT: %int.make_type_32.loc40: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc40_14: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc40_9.1: type = value_of_initializer %int.make_type_32.loc40 [template = i32] -// CHECK:STDOUT: %.loc40_9.2: type = converted %int.make_type_32.loc40, %.loc40_9.1 [template = i32] -// CHECK:STDOUT: %.loc40_15: type = array_type %.loc40_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %d.var: ref %.2 = var d -// CHECK:STDOUT: %d: ref %.2 = bind_name d, %d.var +// CHECK:STDOUT: %.loc40_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc40: init type = call constants.%Int(%.loc40_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc40_14: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc40_9.2: type = value_of_initializer %int.make_type_signed.loc40 [template = constants.%i32] +// CHECK:STDOUT: %.loc40_9.3: type = converted %int.make_type_signed.loc40, %.loc40_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc40_15: type = array_type %.loc40_14, %i32 [template = constants.%.3] +// CHECK:STDOUT: %d.var: ref %.3 = var d +// CHECK:STDOUT: %d: ref %.3 = bind_name d, %d.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc18_20: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc18_23: String = string_literal "Hello" [template = constants.%.6] -// CHECK:STDOUT: %.loc18_32: String = string_literal "World" [template = constants.%.7] +// CHECK:STDOUT: %.loc18_20: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc18_23: String = string_literal "Hello" [template = constants.%.7] +// CHECK:STDOUT: %.loc18_32: String = string_literal "World" [template = constants.%.8] // CHECK:STDOUT: %.loc18_39.1: %tuple.type.1 = tuple_literal (%.loc18_20, %.loc18_23, %.loc18_32) -// CHECK:STDOUT: %.loc18_39.2: %Convert.type.2 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_39.3: = bound_method %.loc18_20, %.loc18_39.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc18_39.3(%.loc18_20) [template = constants.%.34] -// CHECK:STDOUT: %.loc18_39.4: init i32 = converted %.loc18_20, %int.convert_checked [template = constants.%.34] -// CHECK:STDOUT: %.loc18_39.5: i32 = int_value 0 [template = constants.%.8] -// CHECK:STDOUT: %.loc18_39.6: ref i32 = array_index file.%a.var, %.loc18_39.5 -// CHECK:STDOUT: %.loc18_39.7: init i32 = initialize_from %.loc18_39.4 to %.loc18_39.6 [template = constants.%.34] -// CHECK:STDOUT: %.loc18_39.8: i32 = converted %.loc18_23, [template = ] +// CHECK:STDOUT: %.loc18_39.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_39.3: = bound_method %.loc18_20, %.loc18_39.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc18_39.4: = specific_function %.loc18_39.3, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc18_39.4(%.loc18_20) [template = constants.%.32] +// CHECK:STDOUT: %.loc18_39.5: init %i32 = converted %.loc18_20, %int.convert_checked [template = constants.%.32] +// CHECK:STDOUT: %.loc18_39.6: Core.IntLiteral = int_value 0 [template = constants.%.9] +// CHECK:STDOUT: %.loc18_39.7: ref %i32 = array_index file.%a.var, %.loc18_39.6 +// CHECK:STDOUT: %.loc18_39.8: init %i32 = initialize_from %.loc18_39.5 to %.loc18_39.7 [template = constants.%.32] +// CHECK:STDOUT: %.loc18_39.9: %i32 = converted %.loc18_23, [template = ] // CHECK:STDOUT: assign file.%a.var, // CHECK:STDOUT: %t1.ref: ref %tuple.type.3 = name_ref t1, file.%t1 -// CHECK:STDOUT: %.loc28_19.1: ref i32 = tuple_access %t1.ref, element0 -// CHECK:STDOUT: %.loc28_19.2: i32 = bind_value %.loc28_19.1 -// CHECK:STDOUT: %.loc28_19.3: i32 = int_value 0 [template = constants.%.8] -// CHECK:STDOUT: %.loc28_19.4: ref i32 = array_index file.%b.var, %.loc28_19.3 -// CHECK:STDOUT: %.loc28_19.5: init i32 = initialize_from %.loc28_19.2 to %.loc28_19.4 +// CHECK:STDOUT: %.loc28_19.1: ref %i32 = tuple_access %t1.ref, element0 +// CHECK:STDOUT: %.loc28_19.2: %i32 = bind_value %.loc28_19.1 +// CHECK:STDOUT: %.loc28_19.3: Core.IntLiteral = int_value 0 [template = constants.%.9] +// CHECK:STDOUT: %.loc28_19.4: ref %i32 = array_index file.%b.var, %.loc28_19.3 +// CHECK:STDOUT: %.loc28_19.5: init %i32 = initialize_from %.loc28_19.2 to %.loc28_19.4 // CHECK:STDOUT: %.loc28_19.6: ref String = tuple_access %t1.ref, element1 -// CHECK:STDOUT: %.loc28_19.7: i32 = converted %.loc28_19.6, [template = ] +// CHECK:STDOUT: %.loc28_19.7: %i32 = converted %.loc28_19.6, [template = ] // CHECK:STDOUT: assign file.%b.var, -// CHECK:STDOUT: %.loc34_20: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc34_23: Core.IntLiteral = int_value 2 [template = constants.%.36] +// CHECK:STDOUT: %.loc34_20: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc34_23: Core.IntLiteral = int_value 2 [template = constants.%.34] // CHECK:STDOUT: %.loc34_24: %tuple.type.5 = tuple_literal (%.loc34_20, %.loc34_23) // CHECK:STDOUT: assign file.%c.var, // CHECK:STDOUT: %t2.ref: ref %tuple.type.7 = name_ref t2, file.%t2 diff --git a/toolchain/check/testdata/array/function_param.carbon b/toolchain/check/testdata/array/function_param.carbon index a2630c6f4af3..da3aec4d6c27 100644 --- a/toolchain/check/testdata/array/function_param.carbon +++ b/toolchain/check/testdata/array/function_param.carbon @@ -19,34 +19,39 @@ fn G() -> i32 { // CHECK:STDOUT: --- function_param.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.6: i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.30: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.31: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 1 [template] -// CHECK:STDOUT: %.33: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 2 [template] -// CHECK:STDOUT: %.35: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.36: i32 = int_value 3 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.32, %.34, %.36) [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.28: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.34: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.35: = specific_function %.34, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.36: %i32 = int_value 3 [template] +// CHECK:STDOUT: %array: %.3 = tuple_value (%.30, %.33, %.36) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -61,95 +66,103 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %arr.patt: %.2 = binding_pattern arr -// CHECK:STDOUT: %arr.param_patt: %.2 = value_param_pattern %arr.patt, runtime_param0 -// CHECK:STDOUT: %i.patt: i32 = binding_pattern i -// CHECK:STDOUT: %i.param_patt: i32 = value_param_pattern %i.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %arr.patt: %.3 = binding_pattern arr +// CHECK:STDOUT: %arr.param_patt: %.3 = value_param_pattern %arr.patt, runtime_param0 +// CHECK:STDOUT: %i.patt: %i32 = binding_pattern i +// CHECK:STDOUT: %i.param_patt: %i32 = value_param_pattern %i.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_32.loc11_12 [template = i32] -// CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_32.loc11_12, %.loc11_12.1 [template = i32] -// CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17, i32 [template = constants.%.2] -// CHECK:STDOUT: %int.make_type_32.loc11_24: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_24.1: type = value_of_initializer %int.make_type_32.loc11_24 [template = i32] -// CHECK:STDOUT: %.loc11_24.2: type = converted %int.make_type_32.loc11_24, %.loc11_24.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_32.1: type = value_of_initializer %int.make_type_32.loc11_32 [template = i32] -// CHECK:STDOUT: %.loc11_32.2: type = converted %int.make_type_32.loc11_32, %.loc11_32.1 [template = i32] -// CHECK:STDOUT: %arr.param: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %arr: %.2 = bind_name arr, %arr.param -// CHECK:STDOUT: %i.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %i: i32 = bind_name i, %i.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_12.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_12: init type = call constants.%Int(%.loc11_12.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_12.2: type = value_of_initializer %int.make_type_signed.loc11_12 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_12.3: type = converted %int.make_type_signed.loc11_12, %.loc11_12.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17, %i32 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_24.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_24: init type = call constants.%Int(%.loc11_24.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_24.2: type = value_of_initializer %int.make_type_signed.loc11_24 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_24.3: type = converted %int.make_type_signed.loc11_24, %.loc11_24.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_32.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_32: init type = call constants.%Int(%.loc11_32.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_32.2: type = value_of_initializer %int.make_type_signed.loc11_32 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_32.3: type = converted %int.make_type_signed.loc11_32, %.loc11_32.2 [template = constants.%i32] +// CHECK:STDOUT: %arr.param: %.3 = value_param runtime_param0 +// CHECK:STDOUT: %arr: %.3 = bind_name arr, %arr.param +// CHECK:STDOUT: %i.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %i: %i32 = bind_name i, %i.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_11.2: type = converted %int.make_type_32, %.loc15_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc15_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_11.3: type = converted %int.make_type_signed, %.loc15_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%arr.param_patt: %.2, %i.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @F(%arr.param_patt: %.3, %i.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: %.2 = name_ref arr, %arr -// CHECK:STDOUT: %i.ref: i32 = name_ref i, %i -// CHECK:STDOUT: %.loc12_15.1: ref %.2 = value_as_ref %arr.ref -// CHECK:STDOUT: %.loc12_15.2: ref i32 = array_index %.loc12_15.1, %i.ref -// CHECK:STDOUT: %.loc12_15.3: i32 = bind_value %.loc12_15.2 +// CHECK:STDOUT: %arr.ref: %.3 = name_ref arr, %arr +// CHECK:STDOUT: %i.ref: %i32 = name_ref i, %i +// CHECK:STDOUT: %.loc12_15.1: ref %.3 = value_as_ref %arr.ref +// CHECK:STDOUT: %.loc12_15.2: ref %i32 = array_index %.loc12_15.1, %i.ref +// CHECK:STDOUT: %.loc12_15.3: %i32 = bind_value %.loc12_15.2 // CHECK:STDOUT: return %.loc12_15.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> i32 { +// CHECK:STDOUT: fn @G() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %.loc16_13: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc16_16: Core.IntLiteral = int_value 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc16_19: Core.IntLiteral = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc16_13: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc16_16: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc16_19: Core.IntLiteral = int_value 3 [template = constants.%.2] // CHECK:STDOUT: %.loc16_20.1: %tuple.type = tuple_literal (%.loc16_13, %.loc16_16, %.loc16_19) -// CHECK:STDOUT: %.loc16_23.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc16_20.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_20.3: = bound_method %.loc16_13, %.loc16_20.2 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc16_20.1: init i32 = call %.loc16_20.3(%.loc16_13) [template = constants.%.32] -// CHECK:STDOUT: %.loc16_20.4: init i32 = converted %.loc16_13, %int.convert_checked.loc16_20.1 [template = constants.%.32] -// CHECK:STDOUT: %.loc16_20.5: ref %.2 = temporary_storage -// CHECK:STDOUT: %.loc16_20.6: i32 = int_value 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc16_20.7: ref i32 = array_index %.loc16_20.5, %.loc16_20.6 -// CHECK:STDOUT: %.loc16_20.8: init i32 = initialize_from %.loc16_20.4 to %.loc16_20.7 [template = constants.%.32] -// CHECK:STDOUT: %.loc16_20.9: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_20.10: = bound_method %.loc16_16, %.loc16_20.9 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc16_20.2: init i32 = call %.loc16_20.10(%.loc16_16) [template = constants.%.34] -// CHECK:STDOUT: %.loc16_20.11: init i32 = converted %.loc16_16, %int.convert_checked.loc16_20.2 [template = constants.%.34] -// CHECK:STDOUT: %.loc16_20.12: i32 = int_value 1 [template = constants.%.32] -// CHECK:STDOUT: %.loc16_20.13: ref i32 = array_index %.loc16_20.5, %.loc16_20.12 -// CHECK:STDOUT: %.loc16_20.14: init i32 = initialize_from %.loc16_20.11 to %.loc16_20.13 [template = constants.%.34] -// CHECK:STDOUT: %.loc16_20.15: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_20.16: = bound_method %.loc16_19, %.loc16_20.15 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc16_20.3: init i32 = call %.loc16_20.16(%.loc16_19) [template = constants.%.36] -// CHECK:STDOUT: %.loc16_20.17: init i32 = converted %.loc16_19, %int.convert_checked.loc16_20.3 [template = constants.%.36] -// CHECK:STDOUT: %.loc16_20.18: i32 = int_value 2 [template = constants.%.34] -// CHECK:STDOUT: %.loc16_20.19: ref i32 = array_index %.loc16_20.5, %.loc16_20.18 -// CHECK:STDOUT: %.loc16_20.20: init i32 = initialize_from %.loc16_20.17 to %.loc16_20.19 [template = constants.%.36] -// CHECK:STDOUT: %.loc16_20.21: init %.2 = array_init (%.loc16_20.8, %.loc16_20.14, %.loc16_20.20) to %.loc16_20.5 [template = constants.%array] -// CHECK:STDOUT: %.loc16_20.22: init %.2 = converted %.loc16_20.1, %.loc16_20.21 [template = constants.%array] -// CHECK:STDOUT: %.loc16_20.23: ref %.2 = temporary %.loc16_20.5, %.loc16_20.22 -// CHECK:STDOUT: %.loc16_20.24: %.2 = bind_value %.loc16_20.23 -// CHECK:STDOUT: %.loc16_23.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_23.3: = bound_method %.loc16_23.1, %.loc16_23.2 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc16_23: init i32 = call %.loc16_23.3(%.loc16_23.1) [template = constants.%.32] -// CHECK:STDOUT: %.loc16_23.4: i32 = value_of_initializer %int.convert_checked.loc16_23 [template = constants.%.32] -// CHECK:STDOUT: %.loc16_23.5: i32 = converted %.loc16_23.1, %.loc16_23.4 [template = constants.%.32] -// CHECK:STDOUT: %F.call: init i32 = call %F.ref(%.loc16_20.24, %.loc16_23.5) -// CHECK:STDOUT: %.loc16_25.1: i32 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc16_25.2: i32 = converted %F.call, %.loc16_25.1 +// CHECK:STDOUT: %.loc16_23.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc16_20.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc16_20.3: = bound_method %.loc16_13, %.loc16_20.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc16_20.4: = specific_function %.loc16_20.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc16_20.1: init %i32 = call %.loc16_20.4(%.loc16_13) [template = constants.%.30] +// CHECK:STDOUT: %.loc16_20.5: init %i32 = converted %.loc16_13, %int.convert_checked.loc16_20.1 [template = constants.%.30] +// CHECK:STDOUT: %.loc16_20.6: ref %.3 = temporary_storage +// CHECK:STDOUT: %.loc16_20.7: Core.IntLiteral = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc16_20.8: ref %i32 = array_index %.loc16_20.6, %.loc16_20.7 +// CHECK:STDOUT: %.loc16_20.9: init %i32 = initialize_from %.loc16_20.5 to %.loc16_20.8 [template = constants.%.30] +// CHECK:STDOUT: %.loc16_20.10: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc16_20.11: = bound_method %.loc16_16, %.loc16_20.10 [template = constants.%.31] +// CHECK:STDOUT: %.loc16_20.12: = specific_function %.loc16_20.11, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc16_20.2: init %i32 = call %.loc16_20.12(%.loc16_16) [template = constants.%.33] +// CHECK:STDOUT: %.loc16_20.13: init %i32 = converted %.loc16_16, %int.convert_checked.loc16_20.2 [template = constants.%.33] +// CHECK:STDOUT: %.loc16_20.14: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc16_20.15: ref %i32 = array_index %.loc16_20.6, %.loc16_20.14 +// CHECK:STDOUT: %.loc16_20.16: init %i32 = initialize_from %.loc16_20.13 to %.loc16_20.15 [template = constants.%.33] +// CHECK:STDOUT: %.loc16_20.17: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc16_20.18: = bound_method %.loc16_19, %.loc16_20.17 [template = constants.%.34] +// CHECK:STDOUT: %.loc16_20.19: = specific_function %.loc16_20.18, @Convert.2(constants.%.1) [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc16_20.3: init %i32 = call %.loc16_20.19(%.loc16_19) [template = constants.%.36] +// CHECK:STDOUT: %.loc16_20.20: init %i32 = converted %.loc16_19, %int.convert_checked.loc16_20.3 [template = constants.%.36] +// CHECK:STDOUT: %.loc16_20.21: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc16_20.22: ref %i32 = array_index %.loc16_20.6, %.loc16_20.21 +// CHECK:STDOUT: %.loc16_20.23: init %i32 = initialize_from %.loc16_20.20 to %.loc16_20.22 [template = constants.%.36] +// CHECK:STDOUT: %.loc16_20.24: init %.3 = array_init (%.loc16_20.9, %.loc16_20.16, %.loc16_20.23) to %.loc16_20.6 [template = constants.%array] +// CHECK:STDOUT: %.loc16_20.25: init %.3 = converted %.loc16_20.1, %.loc16_20.24 [template = constants.%array] +// CHECK:STDOUT: %.loc16_20.26: ref %.3 = temporary %.loc16_20.6, %.loc16_20.25 +// CHECK:STDOUT: %.loc16_20.27: %.3 = bind_value %.loc16_20.26 +// CHECK:STDOUT: %.loc16_23.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc16_23.3: = bound_method %.loc16_23.1, %.loc16_23.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc16_23.4: = specific_function %.loc16_23.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc16_23: init %i32 = call %.loc16_23.4(%.loc16_23.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc16_23.5: %i32 = value_of_initializer %int.convert_checked.loc16_23 [template = constants.%.30] +// CHECK:STDOUT: %.loc16_23.6: %i32 = converted %.loc16_23.1, %.loc16_23.5 [template = constants.%.30] +// CHECK:STDOUT: %F.call: init %i32 = call %F.ref(%.loc16_20.27, %.loc16_23.6) +// CHECK:STDOUT: %.loc16_25.1: %i32 = value_of_initializer %F.call +// CHECK:STDOUT: %.loc16_25.2: %i32 = converted %F.call, %.loc16_25.1 // CHECK:STDOUT: return %.loc16_25.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/index_not_literal.carbon b/toolchain/check/testdata/array/index_not_literal.carbon index 67bbb4e59998..2adfef3a8284 100644 --- a/toolchain/check/testdata/array/index_not_literal.carbon +++ b/toolchain/check/testdata/array/index_not_literal.carbon @@ -14,32 +14,37 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: --- index_not_literal.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.6: i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.30: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.31: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 1 [template] -// CHECK:STDOUT: %.33: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 2 [template] -// CHECK:STDOUT: %.35: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.36: i32 = int_value 3 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.32, %.34, %.36) [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.28: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.34: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.35: = specific_function %.34, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.36: %i32 = int_value 3 [template] +// CHECK:STDOUT: %array: %.3 = tuple_value (%.30, %.33, %.36) [template] // CHECK:STDOUT: %.37: type = struct_type {.index: Core.IntLiteral} [template] -// CHECK:STDOUT: %struct: %.37 = struct_value (%.5) [template] +// CHECK:STDOUT: %struct: %.37 = struct_value (%.6) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -53,63 +58,69 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc11_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_9.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.3: type = converted %int.make_type_signed.loc11, %.loc11_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, %i32 [template = constants.%.3] +// CHECK:STDOUT: %a.var: ref %.3 = var a +// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var +// CHECK:STDOUT: %.loc12_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.3: type = converted %int.make_type_signed.loc12, %.loc12_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_23: Core.IntLiteral = int_value 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_23: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 3 [template = constants.%.2] // CHECK:STDOUT: %.loc11_27.1: %tuple.type = tuple_literal (%.loc11_20, %.loc11_23, %.loc11_26) -// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_20, %.loc11_27.2 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init i32 = call %.loc11_27.3(%.loc11_20) [template = constants.%.32] -// CHECK:STDOUT: %.loc11_27.4: init i32 = converted %.loc11_20, %int.convert_checked.loc11_27.1 [template = constants.%.32] -// CHECK:STDOUT: %.loc11_27.5: i32 = int_value 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc11_27.6: ref i32 = array_index file.%a.var, %.loc11_27.5 -// CHECK:STDOUT: %.loc11_27.7: init i32 = initialize_from %.loc11_27.4 to %.loc11_27.6 [template = constants.%.32] -// CHECK:STDOUT: %.loc11_27.8: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.9: = bound_method %.loc11_23, %.loc11_27.8 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init i32 = call %.loc11_27.9(%.loc11_23) [template = constants.%.34] -// CHECK:STDOUT: %.loc11_27.10: init i32 = converted %.loc11_23, %int.convert_checked.loc11_27.2 [template = constants.%.34] -// CHECK:STDOUT: %.loc11_27.11: i32 = int_value 1 [template = constants.%.32] -// CHECK:STDOUT: %.loc11_27.12: ref i32 = array_index file.%a.var, %.loc11_27.11 -// CHECK:STDOUT: %.loc11_27.13: init i32 = initialize_from %.loc11_27.10 to %.loc11_27.12 [template = constants.%.34] -// CHECK:STDOUT: %.loc11_27.14: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.15: = bound_method %.loc11_26, %.loc11_27.14 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc11_27.3: init i32 = call %.loc11_27.15(%.loc11_26) [template = constants.%.36] -// CHECK:STDOUT: %.loc11_27.16: init i32 = converted %.loc11_26, %int.convert_checked.loc11_27.3 [template = constants.%.36] -// CHECK:STDOUT: %.loc11_27.17: i32 = int_value 2 [template = constants.%.34] -// CHECK:STDOUT: %.loc11_27.18: ref i32 = array_index file.%a.var, %.loc11_27.17 -// CHECK:STDOUT: %.loc11_27.19: init i32 = initialize_from %.loc11_27.16 to %.loc11_27.18 [template = constants.%.36] -// CHECK:STDOUT: %.loc11_27.20: init %.2 = array_init (%.loc11_27.7, %.loc11_27.13, %.loc11_27.19) to file.%a.var [template = constants.%array] -// CHECK:STDOUT: %.loc11_28: init %.2 = converted %.loc11_27.1, %.loc11_27.20 [template = constants.%array] +// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_20, %.loc11_27.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_27.4: = specific_function %.loc11_27.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %.loc11_27.4(%.loc11_20) [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.5: init %i32 = converted %.loc11_20, %int.convert_checked.loc11_27.1 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.6: Core.IntLiteral = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc11_27.7: ref %i32 = array_index file.%a.var, %.loc11_27.6 +// CHECK:STDOUT: %.loc11_27.8: init %i32 = initialize_from %.loc11_27.5 to %.loc11_27.7 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.9: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.10: = bound_method %.loc11_23, %.loc11_27.9 [template = constants.%.31] +// CHECK:STDOUT: %.loc11_27.11: = specific_function %.loc11_27.10, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %.loc11_27.11(%.loc11_23) [template = constants.%.33] +// CHECK:STDOUT: %.loc11_27.12: init %i32 = converted %.loc11_23, %int.convert_checked.loc11_27.2 [template = constants.%.33] +// CHECK:STDOUT: %.loc11_27.13: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_27.14: ref %i32 = array_index file.%a.var, %.loc11_27.13 +// CHECK:STDOUT: %.loc11_27.15: init %i32 = initialize_from %.loc11_27.12 to %.loc11_27.14 [template = constants.%.33] +// CHECK:STDOUT: %.loc11_27.16: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.17: = bound_method %.loc11_26, %.loc11_27.16 [template = constants.%.34] +// CHECK:STDOUT: %.loc11_27.18: = specific_function %.loc11_27.17, @Convert.2(constants.%.1) [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc11_27.3: init %i32 = call %.loc11_27.18(%.loc11_26) [template = constants.%.36] +// CHECK:STDOUT: %.loc11_27.19: init %i32 = converted %.loc11_26, %int.convert_checked.loc11_27.3 [template = constants.%.36] +// CHECK:STDOUT: %.loc11_27.20: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_27.21: ref %i32 = array_index file.%a.var, %.loc11_27.20 +// CHECK:STDOUT: %.loc11_27.22: init %i32 = initialize_from %.loc11_27.19 to %.loc11_27.21 [template = constants.%.36] +// CHECK:STDOUT: %.loc11_27.23: init %.3 = array_init (%.loc11_27.8, %.loc11_27.15, %.loc11_27.22) to file.%a.var [template = constants.%array] +// CHECK:STDOUT: %.loc11_28: init %.3 = converted %.loc11_27.1, %.loc11_27.23 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_28 -// CHECK:STDOUT: %a.ref: ref %.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc12_26: Core.IntLiteral = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %a.ref: ref %.3 = name_ref a, file.%a +// CHECK:STDOUT: %.loc12_26: Core.IntLiteral = int_value 2 [template = constants.%.6] // CHECK:STDOUT: %.loc12_27.1: %.37 = struct_literal (%.loc12_26) // CHECK:STDOUT: %struct: %.37 = struct_value (%.loc12_26) [template = constants.%struct] // CHECK:STDOUT: %.loc12_27.2: %.37 = converted %.loc12_27.1, %struct [template = constants.%struct] -// CHECK:STDOUT: %.loc12_28.1: Core.IntLiteral = struct_access %.loc12_27.2, element0 [template = constants.%.5] -// CHECK:STDOUT: %.loc12_28.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_28.3: = bound_method %.loc12_28.1, %.loc12_28.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc12: init i32 = call %.loc12_28.3(%.loc12_28.1) [template = constants.%.34] -// CHECK:STDOUT: %.loc12_28.4: i32 = value_of_initializer %int.convert_checked.loc12 [template = constants.%.34] -// CHECK:STDOUT: %.loc12_28.5: i32 = converted %.loc12_28.1, %.loc12_28.4 [template = constants.%.34] -// CHECK:STDOUT: %.loc12_34.1: ref i32 = array_index %a.ref, %.loc12_28.5 -// CHECK:STDOUT: %.loc12_34.2: i32 = bind_value %.loc12_34.1 +// CHECK:STDOUT: %.loc12_28.1: Core.IntLiteral = struct_access %.loc12_27.2, element0 [template = constants.%.6] +// CHECK:STDOUT: %.loc12_28.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_28.3: = bound_method %.loc12_28.1, %.loc12_28.2 [template = constants.%.31] +// CHECK:STDOUT: %.loc12_28.4: = specific_function %.loc12_28.3, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %.loc12_28.4(%.loc12_28.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc12_28.5: %i32 = value_of_initializer %int.convert_checked.loc12 [template = constants.%.33] +// CHECK:STDOUT: %.loc12_28.6: %i32 = converted %.loc12_28.1, %.loc12_28.5 [template = constants.%.33] +// CHECK:STDOUT: %.loc12_34.1: ref %i32 = array_index %a.ref, %.loc12_28.6 +// CHECK:STDOUT: %.loc12_34.2: %i32 = bind_value %.loc12_34.1 // CHECK:STDOUT: assign file.%b.var, %.loc12_34.2 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/nine_elements.carbon b/toolchain/check/testdata/array/nine_elements.carbon index 07664c7b20df..8dc8d29e568d 100644 --- a/toolchain/check/testdata/array/nine_elements.carbon +++ b/toolchain/check/testdata/array/nine_elements.carbon @@ -13,48 +13,59 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: --- nine_elements.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 9 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %.9: Core.IntLiteral = int_value 6 [template] -// CHECK:STDOUT: %.10: Core.IntLiteral = int_value 7 [template] -// CHECK:STDOUT: %.11: Core.IntLiteral = int_value 8 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 9 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.9: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.10: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %.11: Core.IntLiteral = int_value 7 [template] +// CHECK:STDOUT: %.12: Core.IntLiteral = int_value 8 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.12: i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.36: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.37: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.38: i32 = int_value 1 [template] -// CHECK:STDOUT: %.39: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.40: i32 = int_value 2 [template] -// CHECK:STDOUT: %.41: = bound_method %.6, %Convert.15 [template] -// CHECK:STDOUT: %.42: i32 = int_value 3 [template] -// CHECK:STDOUT: %.43: = bound_method %.7, %Convert.15 [template] -// CHECK:STDOUT: %.44: i32 = int_value 4 [template] -// CHECK:STDOUT: %.45: = bound_method %.8, %Convert.15 [template] -// CHECK:STDOUT: %.46: i32 = int_value 5 [template] -// CHECK:STDOUT: %.47: = bound_method %.9, %Convert.15 [template] -// CHECK:STDOUT: %.48: i32 = int_value 6 [template] -// CHECK:STDOUT: %.49: = bound_method %.10, %Convert.15 [template] -// CHECK:STDOUT: %.50: i32 = int_value 7 [template] -// CHECK:STDOUT: %.51: = bound_method %.11, %Convert.15 [template] -// CHECK:STDOUT: %.52: i32 = int_value 8 [template] -// CHECK:STDOUT: %.53: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.54: i32 = int_value 9 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.38, %.40, %.42, %.44, %.46, %.48, %.50, %.52, %.54) [template] +// CHECK:STDOUT: %.13: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.33: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.34: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.35: = specific_function %.34, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.36: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.37: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.38: = specific_function %.37, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.39: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.40: = bound_method %.7, %Convert.14 [template] +// CHECK:STDOUT: %.41: = specific_function %.40, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.42: %i32 = int_value 3 [template] +// CHECK:STDOUT: %.43: = bound_method %.8, %Convert.14 [template] +// CHECK:STDOUT: %.44: = specific_function %.43, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.45: %i32 = int_value 4 [template] +// CHECK:STDOUT: %.46: = bound_method %.9, %Convert.14 [template] +// CHECK:STDOUT: %.47: = specific_function %.46, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.48: %i32 = int_value 5 [template] +// CHECK:STDOUT: %.49: = bound_method %.10, %Convert.14 [template] +// CHECK:STDOUT: %.50: = specific_function %.49, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.51: %i32 = int_value 6 [template] +// CHECK:STDOUT: %.52: = bound_method %.11, %Convert.14 [template] +// CHECK:STDOUT: %.53: = specific_function %.52, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.54: %i32 = int_value 7 [template] +// CHECK:STDOUT: %.55: = bound_method %.12, %Convert.14 [template] +// CHECK:STDOUT: %.56: = specific_function %.55, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.57: %i32 = int_value 8 [template] +// CHECK:STDOUT: %.58: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.59: = specific_function %.58, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.60: %i32 = int_value 9 [template] +// CHECK:STDOUT: %array: %.3 = tuple_value (%.36, %.39, %.42, %.45, %.48, %.51, %.54, %.57, %.60) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -67,92 +78,102 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 9 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var +// CHECK:STDOUT: %.loc11_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 9 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_9.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.3: type = converted %int.make_type_signed, %.loc11_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, %i32 [template = constants.%.3] +// CHECK:STDOUT: %a.var: ref %.3 = var a +// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_23: Core.IntLiteral = int_value 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 3 [template = constants.%.6] -// CHECK:STDOUT: %.loc11_29: Core.IntLiteral = int_value 4 [template = constants.%.7] -// CHECK:STDOUT: %.loc11_32: Core.IntLiteral = int_value 5 [template = constants.%.8] -// CHECK:STDOUT: %.loc11_35: Core.IntLiteral = int_value 6 [template = constants.%.9] -// CHECK:STDOUT: %.loc11_38: Core.IntLiteral = int_value 7 [template = constants.%.10] -// CHECK:STDOUT: %.loc11_41: Core.IntLiteral = int_value 8 [template = constants.%.11] -// CHECK:STDOUT: %.loc11_44: Core.IntLiteral = int_value 9 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_23: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 3 [template = constants.%.7] +// CHECK:STDOUT: %.loc11_29: Core.IntLiteral = int_value 4 [template = constants.%.8] +// CHECK:STDOUT: %.loc11_32: Core.IntLiteral = int_value 5 [template = constants.%.9] +// CHECK:STDOUT: %.loc11_35: Core.IntLiteral = int_value 6 [template = constants.%.10] +// CHECK:STDOUT: %.loc11_38: Core.IntLiteral = int_value 7 [template = constants.%.11] +// CHECK:STDOUT: %.loc11_41: Core.IntLiteral = int_value 8 [template = constants.%.12] +// CHECK:STDOUT: %.loc11_44: Core.IntLiteral = int_value 9 [template = constants.%.2] // CHECK:STDOUT: %.loc11_45.1: %tuple.type = tuple_literal (%.loc11_20, %.loc11_23, %.loc11_26, %.loc11_29, %.loc11_32, %.loc11_35, %.loc11_38, %.loc11_41, %.loc11_44) -// CHECK:STDOUT: %.loc11_45.2: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_45.3: = bound_method %.loc11_20, %.loc11_45.2 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc11_45.1: init i32 = call %.loc11_45.3(%.loc11_20) [template = constants.%.38] -// CHECK:STDOUT: %.loc11_45.4: init i32 = converted %.loc11_20, %int.convert_checked.loc11_45.1 [template = constants.%.38] -// CHECK:STDOUT: %.loc11_45.5: i32 = int_value 0 [template = constants.%.12] -// CHECK:STDOUT: %.loc11_45.6: ref i32 = array_index file.%a.var, %.loc11_45.5 -// CHECK:STDOUT: %.loc11_45.7: init i32 = initialize_from %.loc11_45.4 to %.loc11_45.6 [template = constants.%.38] -// CHECK:STDOUT: %.loc11_45.8: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_45.9: = bound_method %.loc11_23, %.loc11_45.8 [template = constants.%.39] -// CHECK:STDOUT: %int.convert_checked.loc11_45.2: init i32 = call %.loc11_45.9(%.loc11_23) [template = constants.%.40] -// CHECK:STDOUT: %.loc11_45.10: init i32 = converted %.loc11_23, %int.convert_checked.loc11_45.2 [template = constants.%.40] -// CHECK:STDOUT: %.loc11_45.11: i32 = int_value 1 [template = constants.%.38] -// CHECK:STDOUT: %.loc11_45.12: ref i32 = array_index file.%a.var, %.loc11_45.11 -// CHECK:STDOUT: %.loc11_45.13: init i32 = initialize_from %.loc11_45.10 to %.loc11_45.12 [template = constants.%.40] -// CHECK:STDOUT: %.loc11_45.14: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_45.15: = bound_method %.loc11_26, %.loc11_45.14 [template = constants.%.41] -// CHECK:STDOUT: %int.convert_checked.loc11_45.3: init i32 = call %.loc11_45.15(%.loc11_26) [template = constants.%.42] -// CHECK:STDOUT: %.loc11_45.16: init i32 = converted %.loc11_26, %int.convert_checked.loc11_45.3 [template = constants.%.42] -// CHECK:STDOUT: %.loc11_45.17: i32 = int_value 2 [template = constants.%.40] -// CHECK:STDOUT: %.loc11_45.18: ref i32 = array_index file.%a.var, %.loc11_45.17 -// CHECK:STDOUT: %.loc11_45.19: init i32 = initialize_from %.loc11_45.16 to %.loc11_45.18 [template = constants.%.42] -// CHECK:STDOUT: %.loc11_45.20: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_45.21: = bound_method %.loc11_29, %.loc11_45.20 [template = constants.%.43] -// CHECK:STDOUT: %int.convert_checked.loc11_45.4: init i32 = call %.loc11_45.21(%.loc11_29) [template = constants.%.44] -// CHECK:STDOUT: %.loc11_45.22: init i32 = converted %.loc11_29, %int.convert_checked.loc11_45.4 [template = constants.%.44] -// CHECK:STDOUT: %.loc11_45.23: i32 = int_value 3 [template = constants.%.42] -// CHECK:STDOUT: %.loc11_45.24: ref i32 = array_index file.%a.var, %.loc11_45.23 -// CHECK:STDOUT: %.loc11_45.25: init i32 = initialize_from %.loc11_45.22 to %.loc11_45.24 [template = constants.%.44] -// CHECK:STDOUT: %.loc11_45.26: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_45.27: = bound_method %.loc11_32, %.loc11_45.26 [template = constants.%.45] -// CHECK:STDOUT: %int.convert_checked.loc11_45.5: init i32 = call %.loc11_45.27(%.loc11_32) [template = constants.%.46] -// CHECK:STDOUT: %.loc11_45.28: init i32 = converted %.loc11_32, %int.convert_checked.loc11_45.5 [template = constants.%.46] -// CHECK:STDOUT: %.loc11_45.29: i32 = int_value 4 [template = constants.%.44] -// CHECK:STDOUT: %.loc11_45.30: ref i32 = array_index file.%a.var, %.loc11_45.29 -// CHECK:STDOUT: %.loc11_45.31: init i32 = initialize_from %.loc11_45.28 to %.loc11_45.30 [template = constants.%.46] -// CHECK:STDOUT: %.loc11_45.32: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_45.33: = bound_method %.loc11_35, %.loc11_45.32 [template = constants.%.47] -// CHECK:STDOUT: %int.convert_checked.loc11_45.6: init i32 = call %.loc11_45.33(%.loc11_35) [template = constants.%.48] -// CHECK:STDOUT: %.loc11_45.34: init i32 = converted %.loc11_35, %int.convert_checked.loc11_45.6 [template = constants.%.48] -// CHECK:STDOUT: %.loc11_45.35: i32 = int_value 5 [template = constants.%.46] -// CHECK:STDOUT: %.loc11_45.36: ref i32 = array_index file.%a.var, %.loc11_45.35 -// CHECK:STDOUT: %.loc11_45.37: init i32 = initialize_from %.loc11_45.34 to %.loc11_45.36 [template = constants.%.48] -// CHECK:STDOUT: %.loc11_45.38: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_45.39: = bound_method %.loc11_38, %.loc11_45.38 [template = constants.%.49] -// CHECK:STDOUT: %int.convert_checked.loc11_45.7: init i32 = call %.loc11_45.39(%.loc11_38) [template = constants.%.50] -// CHECK:STDOUT: %.loc11_45.40: init i32 = converted %.loc11_38, %int.convert_checked.loc11_45.7 [template = constants.%.50] -// CHECK:STDOUT: %.loc11_45.41: i32 = int_value 6 [template = constants.%.48] -// CHECK:STDOUT: %.loc11_45.42: ref i32 = array_index file.%a.var, %.loc11_45.41 -// CHECK:STDOUT: %.loc11_45.43: init i32 = initialize_from %.loc11_45.40 to %.loc11_45.42 [template = constants.%.50] -// CHECK:STDOUT: %.loc11_45.44: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_45.45: = bound_method %.loc11_41, %.loc11_45.44 [template = constants.%.51] -// CHECK:STDOUT: %int.convert_checked.loc11_45.8: init i32 = call %.loc11_45.45(%.loc11_41) [template = constants.%.52] -// CHECK:STDOUT: %.loc11_45.46: init i32 = converted %.loc11_41, %int.convert_checked.loc11_45.8 [template = constants.%.52] -// CHECK:STDOUT: %.loc11_45.47: i32 = int_value 7 [template = constants.%.50] -// CHECK:STDOUT: %.loc11_45.48: ref i32 = array_index file.%a.var, %.loc11_45.47 -// CHECK:STDOUT: %.loc11_45.49: init i32 = initialize_from %.loc11_45.46 to %.loc11_45.48 [template = constants.%.52] -// CHECK:STDOUT: %.loc11_45.50: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_45.51: = bound_method %.loc11_44, %.loc11_45.50 [template = constants.%.53] -// CHECK:STDOUT: %int.convert_checked.loc11_45.9: init i32 = call %.loc11_45.51(%.loc11_44) [template = constants.%.54] -// CHECK:STDOUT: %.loc11_45.52: init i32 = converted %.loc11_44, %int.convert_checked.loc11_45.9 [template = constants.%.54] -// CHECK:STDOUT: %.loc11_45.53: i32 = int_value 8 [template = constants.%.52] -// CHECK:STDOUT: %.loc11_45.54: ref i32 = array_index file.%a.var, %.loc11_45.53 -// CHECK:STDOUT: %.loc11_45.55: init i32 = initialize_from %.loc11_45.52 to %.loc11_45.54 [template = constants.%.54] -// CHECK:STDOUT: %.loc11_45.56: init %.2 = array_init (%.loc11_45.7, %.loc11_45.13, %.loc11_45.19, %.loc11_45.25, %.loc11_45.31, %.loc11_45.37, %.loc11_45.43, %.loc11_45.49, %.loc11_45.55) to file.%a.var [template = constants.%array] -// CHECK:STDOUT: %.loc11_46: init %.2 = converted %.loc11_45.1, %.loc11_45.56 [template = constants.%array] +// CHECK:STDOUT: %.loc11_45.2: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_45.3: = bound_method %.loc11_20, %.loc11_45.2 [template = constants.%.34] +// CHECK:STDOUT: %.loc11_45.4: = specific_function %.loc11_45.3, @Convert.2(constants.%.1) [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc11_45.1: init %i32 = call %.loc11_45.4(%.loc11_20) [template = constants.%.36] +// CHECK:STDOUT: %.loc11_45.5: init %i32 = converted %.loc11_20, %int.convert_checked.loc11_45.1 [template = constants.%.36] +// CHECK:STDOUT: %.loc11_45.6: Core.IntLiteral = int_value 0 [template = constants.%.13] +// CHECK:STDOUT: %.loc11_45.7: ref %i32 = array_index file.%a.var, %.loc11_45.6 +// CHECK:STDOUT: %.loc11_45.8: init %i32 = initialize_from %.loc11_45.5 to %.loc11_45.7 [template = constants.%.36] +// CHECK:STDOUT: %.loc11_45.9: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_45.10: = bound_method %.loc11_23, %.loc11_45.9 [template = constants.%.37] +// CHECK:STDOUT: %.loc11_45.11: = specific_function %.loc11_45.10, @Convert.2(constants.%.1) [template = constants.%.38] +// CHECK:STDOUT: %int.convert_checked.loc11_45.2: init %i32 = call %.loc11_45.11(%.loc11_23) [template = constants.%.39] +// CHECK:STDOUT: %.loc11_45.12: init %i32 = converted %.loc11_23, %int.convert_checked.loc11_45.2 [template = constants.%.39] +// CHECK:STDOUT: %.loc11_45.13: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_45.14: ref %i32 = array_index file.%a.var, %.loc11_45.13 +// CHECK:STDOUT: %.loc11_45.15: init %i32 = initialize_from %.loc11_45.12 to %.loc11_45.14 [template = constants.%.39] +// CHECK:STDOUT: %.loc11_45.16: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_45.17: = bound_method %.loc11_26, %.loc11_45.16 [template = constants.%.40] +// CHECK:STDOUT: %.loc11_45.18: = specific_function %.loc11_45.17, @Convert.2(constants.%.1) [template = constants.%.41] +// CHECK:STDOUT: %int.convert_checked.loc11_45.3: init %i32 = call %.loc11_45.18(%.loc11_26) [template = constants.%.42] +// CHECK:STDOUT: %.loc11_45.19: init %i32 = converted %.loc11_26, %int.convert_checked.loc11_45.3 [template = constants.%.42] +// CHECK:STDOUT: %.loc11_45.20: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_45.21: ref %i32 = array_index file.%a.var, %.loc11_45.20 +// CHECK:STDOUT: %.loc11_45.22: init %i32 = initialize_from %.loc11_45.19 to %.loc11_45.21 [template = constants.%.42] +// CHECK:STDOUT: %.loc11_45.23: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_45.24: = bound_method %.loc11_29, %.loc11_45.23 [template = constants.%.43] +// CHECK:STDOUT: %.loc11_45.25: = specific_function %.loc11_45.24, @Convert.2(constants.%.1) [template = constants.%.44] +// CHECK:STDOUT: %int.convert_checked.loc11_45.4: init %i32 = call %.loc11_45.25(%.loc11_29) [template = constants.%.45] +// CHECK:STDOUT: %.loc11_45.26: init %i32 = converted %.loc11_29, %int.convert_checked.loc11_45.4 [template = constants.%.45] +// CHECK:STDOUT: %.loc11_45.27: Core.IntLiteral = int_value 3 [template = constants.%.7] +// CHECK:STDOUT: %.loc11_45.28: ref %i32 = array_index file.%a.var, %.loc11_45.27 +// CHECK:STDOUT: %.loc11_45.29: init %i32 = initialize_from %.loc11_45.26 to %.loc11_45.28 [template = constants.%.45] +// CHECK:STDOUT: %.loc11_45.30: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_45.31: = bound_method %.loc11_32, %.loc11_45.30 [template = constants.%.46] +// CHECK:STDOUT: %.loc11_45.32: = specific_function %.loc11_45.31, @Convert.2(constants.%.1) [template = constants.%.47] +// CHECK:STDOUT: %int.convert_checked.loc11_45.5: init %i32 = call %.loc11_45.32(%.loc11_32) [template = constants.%.48] +// CHECK:STDOUT: %.loc11_45.33: init %i32 = converted %.loc11_32, %int.convert_checked.loc11_45.5 [template = constants.%.48] +// CHECK:STDOUT: %.loc11_45.34: Core.IntLiteral = int_value 4 [template = constants.%.8] +// CHECK:STDOUT: %.loc11_45.35: ref %i32 = array_index file.%a.var, %.loc11_45.34 +// CHECK:STDOUT: %.loc11_45.36: init %i32 = initialize_from %.loc11_45.33 to %.loc11_45.35 [template = constants.%.48] +// CHECK:STDOUT: %.loc11_45.37: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_45.38: = bound_method %.loc11_35, %.loc11_45.37 [template = constants.%.49] +// CHECK:STDOUT: %.loc11_45.39: = specific_function %.loc11_45.38, @Convert.2(constants.%.1) [template = constants.%.50] +// CHECK:STDOUT: %int.convert_checked.loc11_45.6: init %i32 = call %.loc11_45.39(%.loc11_35) [template = constants.%.51] +// CHECK:STDOUT: %.loc11_45.40: init %i32 = converted %.loc11_35, %int.convert_checked.loc11_45.6 [template = constants.%.51] +// CHECK:STDOUT: %.loc11_45.41: Core.IntLiteral = int_value 5 [template = constants.%.9] +// CHECK:STDOUT: %.loc11_45.42: ref %i32 = array_index file.%a.var, %.loc11_45.41 +// CHECK:STDOUT: %.loc11_45.43: init %i32 = initialize_from %.loc11_45.40 to %.loc11_45.42 [template = constants.%.51] +// CHECK:STDOUT: %.loc11_45.44: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_45.45: = bound_method %.loc11_38, %.loc11_45.44 [template = constants.%.52] +// CHECK:STDOUT: %.loc11_45.46: = specific_function %.loc11_45.45, @Convert.2(constants.%.1) [template = constants.%.53] +// CHECK:STDOUT: %int.convert_checked.loc11_45.7: init %i32 = call %.loc11_45.46(%.loc11_38) [template = constants.%.54] +// CHECK:STDOUT: %.loc11_45.47: init %i32 = converted %.loc11_38, %int.convert_checked.loc11_45.7 [template = constants.%.54] +// CHECK:STDOUT: %.loc11_45.48: Core.IntLiteral = int_value 6 [template = constants.%.10] +// CHECK:STDOUT: %.loc11_45.49: ref %i32 = array_index file.%a.var, %.loc11_45.48 +// CHECK:STDOUT: %.loc11_45.50: init %i32 = initialize_from %.loc11_45.47 to %.loc11_45.49 [template = constants.%.54] +// CHECK:STDOUT: %.loc11_45.51: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_45.52: = bound_method %.loc11_41, %.loc11_45.51 [template = constants.%.55] +// CHECK:STDOUT: %.loc11_45.53: = specific_function %.loc11_45.52, @Convert.2(constants.%.1) [template = constants.%.56] +// CHECK:STDOUT: %int.convert_checked.loc11_45.8: init %i32 = call %.loc11_45.53(%.loc11_41) [template = constants.%.57] +// CHECK:STDOUT: %.loc11_45.54: init %i32 = converted %.loc11_41, %int.convert_checked.loc11_45.8 [template = constants.%.57] +// CHECK:STDOUT: %.loc11_45.55: Core.IntLiteral = int_value 7 [template = constants.%.11] +// CHECK:STDOUT: %.loc11_45.56: ref %i32 = array_index file.%a.var, %.loc11_45.55 +// CHECK:STDOUT: %.loc11_45.57: init %i32 = initialize_from %.loc11_45.54 to %.loc11_45.56 [template = constants.%.57] +// CHECK:STDOUT: %.loc11_45.58: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_45.59: = bound_method %.loc11_44, %.loc11_45.58 [template = constants.%.58] +// CHECK:STDOUT: %.loc11_45.60: = specific_function %.loc11_45.59, @Convert.2(constants.%.1) [template = constants.%.59] +// CHECK:STDOUT: %int.convert_checked.loc11_45.9: init %i32 = call %.loc11_45.60(%.loc11_44) [template = constants.%.60] +// CHECK:STDOUT: %.loc11_45.61: init %i32 = converted %.loc11_44, %int.convert_checked.loc11_45.9 [template = constants.%.60] +// CHECK:STDOUT: %.loc11_45.62: Core.IntLiteral = int_value 8 [template = constants.%.12] +// CHECK:STDOUT: %.loc11_45.63: ref %i32 = array_index file.%a.var, %.loc11_45.62 +// CHECK:STDOUT: %.loc11_45.64: init %i32 = initialize_from %.loc11_45.61 to %.loc11_45.63 [template = constants.%.60] +// CHECK:STDOUT: %.loc11_45.65: init %.3 = array_init (%.loc11_45.8, %.loc11_45.15, %.loc11_45.22, %.loc11_45.29, %.loc11_45.36, %.loc11_45.43, %.loc11_45.50, %.loc11_45.57, %.loc11_45.64) to file.%a.var [template = constants.%array] +// CHECK:STDOUT: %.loc11_46: init %.3 = converted %.loc11_45.1, %.loc11_45.65 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_46 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index 58b1849d0ae0..7fc8b4caacbd 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -109,33 +109,37 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %A, i32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %A, %i32 [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = struct_type {.x: i32, .y: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.7: type = struct_type {.x: Core.IntLiteral, .y: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.32: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 1 [template] -// CHECK:STDOUT: %.34: = bound_method %.6, %Convert.15 [template] -// CHECK:STDOUT: %.35: i32 = int_value 2 [template] -// CHECK:STDOUT: %struct: %A = struct_value (%.33, %.35) [template] +// CHECK:STDOUT: %.3: type = struct_type {.x: %i32, .y: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.8: type = struct_type {.x: Core.IntLiteral, .y: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.28: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.29: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.30: = specific_function %.29, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.31: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.32: = bound_method %.7, %Convert.14 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 2 [template] +// CHECK:STDOUT: %struct: %A = struct_value (%.31, %.34) [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.36: = complete_type_witness %A [template] -// CHECK:STDOUT: %.37: type = ptr_type %B [template] +// CHECK:STDOUT: %.35: = complete_type_witness %A [template] +// CHECK:STDOUT: %.36: type = ptr_type %B [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -162,21 +166,23 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %A.ref.loc18: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %B.ref.loc21: type = name_ref B, %B.decl [template = constants.%B] // CHECK:STDOUT: %B.ref.loc22: type = name_ref B, %B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc22: type = ptr_type %B [template = constants.%.37] +// CHECK:STDOUT: %.loc22: type = ptr_type %B [template = constants.%.36] // CHECK:STDOUT: %B.ref.loc24: type = name_ref B, %B.decl [template = constants.%B] // CHECK:STDOUT: %b_factory.var: ref %B = var b_factory // CHECK:STDOUT: %b_factory: ref %B = bind_name b_factory, %b_factory.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_32.loc5, %.loc5_10.1 [template = i32] -// CHECK:STDOUT: %.loc5_8: %.1 = field_decl x, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_32.loc6, %.loc6_10.1 [template = i32] -// CHECK:STDOUT: %.loc6_8: %.1 = field_decl y, element1 [template] +// CHECK:STDOUT: %.loc5_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.3: type = converted %int.make_type_signed.loc5, %.loc5_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_8: %.2 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc6_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_10.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_10.3: type = converted %int.make_type_signed.loc6, %.loc6_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8: %.2 = field_decl y, element1 [template] // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { // CHECK:STDOUT: %return.patt: %A = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %A = out_param_pattern %return.patt, runtime_param0 @@ -185,7 +191,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %return.param: ref %A = out_param runtime_param0 // CHECK:STDOUT: %return: ref %A = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc11: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -197,7 +203,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: adapt_decl %A -// CHECK:STDOUT: %.loc15: = complete_type_witness %A [template = constants.%.36] +// CHECK:STDOUT: %.loc15: = complete_type_witness %A [template = constants.%.35] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -205,45 +211,49 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: fn @Make() -> %return: %A { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc9_18: Core.IntLiteral = int_value 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_26: Core.IntLiteral = int_value 2 [template = constants.%.6] -// CHECK:STDOUT: %.loc9_27.1: %.7 = struct_literal (%.loc9_18, %.loc9_26) -// CHECK:STDOUT: %.loc9_27.2: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_27.3: = bound_method %.loc9_18, %.loc9_27.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc9_27.1: init i32 = call %.loc9_27.3(%.loc9_18) [template = constants.%.33] -// CHECK:STDOUT: %.loc9_27.4: init i32 = converted %.loc9_18, %int.convert_checked.loc9_27.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc9_27.5: ref i32 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc9_27.6: init i32 = initialize_from %.loc9_27.4 to %.loc9_27.5 [template = constants.%.33] -// CHECK:STDOUT: %.loc9_27.7: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_27.8: = bound_method %.loc9_26, %.loc9_27.7 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc9_27.2: init i32 = call %.loc9_27.8(%.loc9_26) [template = constants.%.35] -// CHECK:STDOUT: %.loc9_27.9: init i32 = converted %.loc9_26, %int.convert_checked.loc9_27.2 [template = constants.%.35] -// CHECK:STDOUT: %.loc9_27.10: ref i32 = class_element_access %return, element1 -// CHECK:STDOUT: %.loc9_27.11: init i32 = initialize_from %.loc9_27.9 to %.loc9_27.10 [template = constants.%.35] -// CHECK:STDOUT: %.loc9_27.12: init %A = class_init (%.loc9_27.6, %.loc9_27.11), %return [template = constants.%struct] -// CHECK:STDOUT: %.loc9_28: init %A = converted %.loc9_27.1, %.loc9_27.12 [template = constants.%struct] +// CHECK:STDOUT: %.loc9_18: Core.IntLiteral = int_value 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_26: Core.IntLiteral = int_value 2 [template = constants.%.7] +// CHECK:STDOUT: %.loc9_27.1: %.8 = struct_literal (%.loc9_18, %.loc9_26) +// CHECK:STDOUT: %.loc9_27.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_27.3: = bound_method %.loc9_18, %.loc9_27.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc9_27.4: = specific_function %.loc9_27.3, @Convert.2(constants.%.1) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc9_27.1: init %i32 = call %.loc9_27.4(%.loc9_18) [template = constants.%.31] +// CHECK:STDOUT: %.loc9_27.5: init %i32 = converted %.loc9_18, %int.convert_checked.loc9_27.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc9_27.6: ref %i32 = class_element_access %return, element0 +// CHECK:STDOUT: %.loc9_27.7: init %i32 = initialize_from %.loc9_27.5 to %.loc9_27.6 [template = constants.%.31] +// CHECK:STDOUT: %.loc9_27.8: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_27.9: = bound_method %.loc9_26, %.loc9_27.8 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_27.10: = specific_function %.loc9_27.9, @Convert.2(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc9_27.2: init %i32 = call %.loc9_27.10(%.loc9_26) [template = constants.%.34] +// CHECK:STDOUT: %.loc9_27.11: init %i32 = converted %.loc9_26, %int.convert_checked.loc9_27.2 [template = constants.%.34] +// CHECK:STDOUT: %.loc9_27.12: ref %i32 = class_element_access %return, element1 +// CHECK:STDOUT: %.loc9_27.13: init %i32 = initialize_from %.loc9_27.11 to %.loc9_27.12 [template = constants.%.34] +// CHECK:STDOUT: %.loc9_27.14: init %A = class_init (%.loc9_27.7, %.loc9_27.13), %return [template = constants.%struct] +// CHECK:STDOUT: %.loc9_28: init %A = converted %.loc9_27.1, %.loc9_27.14 [template = constants.%struct] // CHECK:STDOUT: return %.loc9_28 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc17_22: Core.IntLiteral = int_value 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc17_30: Core.IntLiteral = int_value 2 [template = constants.%.6] -// CHECK:STDOUT: %.loc17_31.1: %.7 = struct_literal (%.loc17_22, %.loc17_30) -// CHECK:STDOUT: %.loc17_31.2: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc17_31.3: = bound_method %.loc17_22, %.loc17_31.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc17_31.1: init i32 = call %.loc17_31.3(%.loc17_22) [template = constants.%.33] -// CHECK:STDOUT: %.loc17_31.4: init i32 = converted %.loc17_22, %int.convert_checked.loc17_31.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc17_31.5: ref i32 = class_element_access file.%a_ref.var, element0 -// CHECK:STDOUT: %.loc17_31.6: init i32 = initialize_from %.loc17_31.4 to %.loc17_31.5 [template = constants.%.33] -// CHECK:STDOUT: %.loc17_31.7: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc17_31.8: = bound_method %.loc17_30, %.loc17_31.7 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc17_31.2: init i32 = call %.loc17_31.8(%.loc17_30) [template = constants.%.35] -// CHECK:STDOUT: %.loc17_31.9: init i32 = converted %.loc17_30, %int.convert_checked.loc17_31.2 [template = constants.%.35] -// CHECK:STDOUT: %.loc17_31.10: ref i32 = class_element_access file.%a_ref.var, element1 -// CHECK:STDOUT: %.loc17_31.11: init i32 = initialize_from %.loc17_31.9 to %.loc17_31.10 [template = constants.%.35] -// CHECK:STDOUT: %.loc17_31.12: init %A = class_init (%.loc17_31.6, %.loc17_31.11), file.%a_ref.var [template = constants.%struct] -// CHECK:STDOUT: %.loc17_32: init %A = converted %.loc17_31.1, %.loc17_31.12 [template = constants.%struct] +// CHECK:STDOUT: %.loc17_22: Core.IntLiteral = int_value 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc17_30: Core.IntLiteral = int_value 2 [template = constants.%.7] +// CHECK:STDOUT: %.loc17_31.1: %.8 = struct_literal (%.loc17_22, %.loc17_30) +// CHECK:STDOUT: %.loc17_31.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc17_31.3: = bound_method %.loc17_22, %.loc17_31.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc17_31.4: = specific_function %.loc17_31.3, @Convert.2(constants.%.1) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc17_31.1: init %i32 = call %.loc17_31.4(%.loc17_22) [template = constants.%.31] +// CHECK:STDOUT: %.loc17_31.5: init %i32 = converted %.loc17_22, %int.convert_checked.loc17_31.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc17_31.6: ref %i32 = class_element_access file.%a_ref.var, element0 +// CHECK:STDOUT: %.loc17_31.7: init %i32 = initialize_from %.loc17_31.5 to %.loc17_31.6 [template = constants.%.31] +// CHECK:STDOUT: %.loc17_31.8: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc17_31.9: = bound_method %.loc17_30, %.loc17_31.8 [template = constants.%.32] +// CHECK:STDOUT: %.loc17_31.10: = specific_function %.loc17_31.9, @Convert.2(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc17_31.2: init %i32 = call %.loc17_31.10(%.loc17_30) [template = constants.%.34] +// CHECK:STDOUT: %.loc17_31.11: init %i32 = converted %.loc17_30, %int.convert_checked.loc17_31.2 [template = constants.%.34] +// CHECK:STDOUT: %.loc17_31.12: ref %i32 = class_element_access file.%a_ref.var, element1 +// CHECK:STDOUT: %.loc17_31.13: init %i32 = initialize_from %.loc17_31.11 to %.loc17_31.12 [template = constants.%.34] +// CHECK:STDOUT: %.loc17_31.14: init %A = class_init (%.loc17_31.7, %.loc17_31.13), file.%a_ref.var [template = constants.%struct] +// CHECK:STDOUT: %.loc17_32: init %A = converted %.loc17_31.1, %.loc17_31.14 [template = constants.%struct] // CHECK:STDOUT: assign file.%a_ref.var, %.loc17_32 // CHECK:STDOUT: %a_ref.ref.loc18: ref %A = name_ref a_ref, file.%a_ref // CHECK:STDOUT: %.loc18: %A = bind_value %a_ref.ref.loc18 @@ -257,8 +267,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %B.ref.loc22: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %.loc22_25.1: ref %B = as_compatible %a_ref.ref.loc22 // CHECK:STDOUT: %.loc22_25.2: ref %B = converted %a_ref.ref.loc22, %.loc22_25.1 -// CHECK:STDOUT: %.loc22_17: %.37 = addr_of %.loc22_25.2 -// CHECK:STDOUT: %b_ptr: %.37 = bind_name b_ptr, %.loc22_17 +// CHECK:STDOUT: %.loc22_17: %.36 = addr_of %.loc22_25.2 +// CHECK:STDOUT: %b_ptr: %.36 = bind_name b_ptr, %.loc22_17 // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, @A.%Make.decl [template = constants.%Make] // CHECK:STDOUT: %.loc24_5: ref %B = splice_block file.%b_factory.var {} @@ -274,21 +284,24 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: = complete_type_witness i32 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.7, @impl.5(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.7(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .As = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -305,17 +318,19 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_32, %.loc9_8.1 [template = i32] +// CHECK:STDOUT: %.loc9_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc9_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc9_8.3: type = converted %int.make_type_signed, %.loc9_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_12.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc5_12.2: type = converted %int.make_type_32, %.loc5_12.1 [template = i32] -// CHECK:STDOUT: adapt_decl i32 -// CHECK:STDOUT: %.loc6: = complete_type_witness i32 [template = constants.%.1] +// CHECK:STDOUT: %.loc5_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc5_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_12.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc5_12.2: type = converted %int.make_type_signed, %.loc5_12.1 [template = constants.%i32] +// CHECK:STDOUT: adapt_decl %i32 +// CHECK:STDOUT: %.loc6: = complete_type_witness %i32 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -323,26 +338,29 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc8_13: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_18.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] -// CHECK:STDOUT: %.loc8_18.2: type = converted %int.make_type_32.loc8, %.loc8_18.1 [template = i32] -// CHECK:STDOUT: %.loc8_15.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_15.2: = bound_method %.loc8_13, %.loc8_15.1 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc8_15.2(%.loc8_13) [template = constants.%.28] -// CHECK:STDOUT: %.loc8_15.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.28] -// CHECK:STDOUT: %.loc8_15.4: i32 = converted %.loc8_13, %.loc8_15.3 [template = constants.%.28] +// CHECK:STDOUT: %.loc8_13: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc8_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_18.2: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_18.3: type = converted %int.make_type_signed.loc8, %.loc8_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_15.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_15.2: = bound_method %.loc8_13, %.loc8_15.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc8_15.3: = specific_function %.loc8_15.2, @Convert.7(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc8_15.3(%.loc8_13) [template = constants.%.26] +// CHECK:STDOUT: %.loc8_15.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.26] +// CHECK:STDOUT: %.loc8_15.5: %i32 = converted %.loc8_13, %.loc8_15.4 [template = constants.%.26] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc8_23.1: %A = as_compatible %.loc8_15.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc8_23.2: %A = converted %.loc8_15.4, %.loc8_23.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc8_23.1: %A = as_compatible %.loc8_15.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc8_23.2: %A = converted %.loc8_15.5, %.loc8_23.1 [template = constants.%.26] // CHECK:STDOUT: %a: %A = bind_name a, %.loc8_23.2 // CHECK:STDOUT: %a.ref: %A = name_ref a, %a -// CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_19.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] -// CHECK:STDOUT: %.loc9_19.2: type = converted %int.make_type_32.loc9, %.loc9_19.1 [template = i32] -// CHECK:STDOUT: %.loc9_16.1: i32 = as_compatible %a.ref -// CHECK:STDOUT: %.loc9_16.2: i32 = converted %a.ref, %.loc9_16.1 -// CHECK:STDOUT: %n: i32 = bind_name n, %.loc9_16.2 +// CHECK:STDOUT: %.loc9_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%.loc9_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_19.2: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_19.3: type = converted %int.make_type_signed.loc9, %.loc9_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_16.1: %i32 = as_compatible %a.ref +// CHECK:STDOUT: %.loc9_16.2: %i32 = converted %a.ref, %.loc9_16.1 +// CHECK:STDOUT: %n: %i32 = bind_name n, %.loc9_16.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -431,30 +449,34 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %A, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.x: i32, .y: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %A, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.x: %i32, .y: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.5: = complete_type_witness %A [template] -// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.8: type = struct_type {.x: Core.IntLiteral, .y: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.33: = bound_method %.6, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 1 [template] -// CHECK:STDOUT: %.35: = bound_method %.7, %Convert.15 [template] -// CHECK:STDOUT: %.36: i32 = int_value 2 [template] -// CHECK:STDOUT: %struct: %A = struct_value (%.34, %.36) [template] +// CHECK:STDOUT: %.6: = complete_type_witness %A [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.9: type = struct_type {.x: Core.IntLiteral, .y: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.29: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.30: = bound_method %.7, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.33: = bound_method %.8, %Convert.14 [template] +// CHECK:STDOUT: %.34: = specific_function %.33, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.35: %i32 = int_value 2 [template] +// CHECK:STDOUT: %struct: %A = struct_value (%.32, %.35) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -479,15 +501,17 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_32.loc5, %.loc5_10.1 [template = i32] -// CHECK:STDOUT: %.loc5_8: %.1 = field_decl x, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_32.loc6, %.loc6_10.1 [template = i32] -// CHECK:STDOUT: %.loc6_8: %.1 = field_decl y, element1 [template] -// CHECK:STDOUT: %.loc7: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.3: type = converted %int.make_type_signed.loc5, %.loc5_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_8: %.2 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc6_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_10.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_10.3: type = converted %int.make_type_signed.loc6, %.loc6_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8: %.2 = field_decl y, element1 [template] +// CHECK:STDOUT: %.loc7: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -498,7 +522,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: adapt_decl %A -// CHECK:STDOUT: %.loc11: = complete_type_witness %A [template = constants.%.5] +// CHECK:STDOUT: %.loc11: = complete_type_witness %A [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -506,51 +530,55 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc13_25: Core.IntLiteral = int_value 1 [template = constants.%.6] -// CHECK:STDOUT: %.loc13_33: Core.IntLiteral = int_value 2 [template = constants.%.7] -// CHECK:STDOUT: %.loc13_34.1: %.8 = struct_literal (%.loc13_25, %.loc13_33) +// CHECK:STDOUT: %.loc13_25: Core.IntLiteral = int_value 1 [template = constants.%.7] +// CHECK:STDOUT: %.loc13_33: Core.IntLiteral = int_value 2 [template = constants.%.8] +// CHECK:STDOUT: %.loc13_34.1: %.9 = struct_literal (%.loc13_25, %.loc13_33) // CHECK:STDOUT: %A.ref.loc13: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc13_34.2: %Convert.type.2 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_34.3: = bound_method %.loc13_25, %.loc13_34.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc13_34.1: init i32 = call %.loc13_34.3(%.loc13_25) [template = constants.%.34] -// CHECK:STDOUT: %.loc13_34.4: init i32 = converted %.loc13_25, %int.convert_checked.loc13_34.1 [template = constants.%.34] -// CHECK:STDOUT: %.loc13_34.5: ref %A = temporary_storage -// CHECK:STDOUT: %.loc13_34.6: ref i32 = class_element_access %.loc13_34.5, element0 -// CHECK:STDOUT: %.loc13_34.7: init i32 = initialize_from %.loc13_34.4 to %.loc13_34.6 [template = constants.%.34] -// CHECK:STDOUT: %.loc13_34.8: %Convert.type.2 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_34.9: = bound_method %.loc13_33, %.loc13_34.8 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc13_34.2: init i32 = call %.loc13_34.9(%.loc13_33) [template = constants.%.36] -// CHECK:STDOUT: %.loc13_34.10: init i32 = converted %.loc13_33, %int.convert_checked.loc13_34.2 [template = constants.%.36] -// CHECK:STDOUT: %.loc13_34.11: ref i32 = class_element_access %.loc13_34.5, element1 -// CHECK:STDOUT: %.loc13_34.12: init i32 = initialize_from %.loc13_34.10 to %.loc13_34.11 [template = constants.%.36] -// CHECK:STDOUT: %.loc13_34.13: init %A = class_init (%.loc13_34.7, %.loc13_34.12), %.loc13_34.5 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_34.14: ref %A = temporary %.loc13_34.5, %.loc13_34.13 -// CHECK:STDOUT: %.loc13_36: ref %A = converted %.loc13_34.1, %.loc13_34.14 +// CHECK:STDOUT: %.loc13_34.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_34.3: = bound_method %.loc13_25, %.loc13_34.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc13_34.4: = specific_function %.loc13_34.3, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc13_34.1: init %i32 = call %.loc13_34.4(%.loc13_25) [template = constants.%.32] +// CHECK:STDOUT: %.loc13_34.5: init %i32 = converted %.loc13_25, %int.convert_checked.loc13_34.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc13_34.6: ref %A = temporary_storage +// CHECK:STDOUT: %.loc13_34.7: ref %i32 = class_element_access %.loc13_34.6, element0 +// CHECK:STDOUT: %.loc13_34.8: init %i32 = initialize_from %.loc13_34.5 to %.loc13_34.7 [template = constants.%.32] +// CHECK:STDOUT: %.loc13_34.9: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_34.10: = bound_method %.loc13_33, %.loc13_34.9 [template = constants.%.33] +// CHECK:STDOUT: %.loc13_34.11: = specific_function %.loc13_34.10, @Convert.2(constants.%.1) [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked.loc13_34.2: init %i32 = call %.loc13_34.11(%.loc13_33) [template = constants.%.35] +// CHECK:STDOUT: %.loc13_34.12: init %i32 = converted %.loc13_33, %int.convert_checked.loc13_34.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc13_34.13: ref %i32 = class_element_access %.loc13_34.6, element1 +// CHECK:STDOUT: %.loc13_34.14: init %i32 = initialize_from %.loc13_34.12 to %.loc13_34.13 [template = constants.%.35] +// CHECK:STDOUT: %.loc13_34.15: init %A = class_init (%.loc13_34.8, %.loc13_34.14), %.loc13_34.6 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_34.16: ref %A = temporary %.loc13_34.6, %.loc13_34.15 +// CHECK:STDOUT: %.loc13_36: ref %A = converted %.loc13_34.1, %.loc13_34.16 // CHECK:STDOUT: %B.ref.loc13: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %.loc13_42.1: ref %B = as_compatible %.loc13_36 // CHECK:STDOUT: %.loc13_42.2: ref %B = converted %.loc13_36, %.loc13_42.1 // CHECK:STDOUT: %.loc13_42.3: %B = bind_value %.loc13_42.2 // CHECK:STDOUT: %b_value: %B = bind_name b_value, %.loc13_42.3 -// CHECK:STDOUT: %.loc24_24: Core.IntLiteral = int_value 1 [template = constants.%.6] -// CHECK:STDOUT: %.loc24_32: Core.IntLiteral = int_value 2 [template = constants.%.7] -// CHECK:STDOUT: %.loc24_33.1: %.8 = struct_literal (%.loc24_24, %.loc24_32) +// CHECK:STDOUT: %.loc24_24: Core.IntLiteral = int_value 1 [template = constants.%.7] +// CHECK:STDOUT: %.loc24_32: Core.IntLiteral = int_value 2 [template = constants.%.8] +// CHECK:STDOUT: %.loc24_33.1: %.9 = struct_literal (%.loc24_24, %.loc24_32) // CHECK:STDOUT: %A.ref.loc24: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc24_33.2: %Convert.type.2 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc24_33.3: = bound_method %.loc24_24, %.loc24_33.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc24_33.1: init i32 = call %.loc24_33.3(%.loc24_24) [template = constants.%.34] -// CHECK:STDOUT: %.loc24_33.4: init i32 = converted %.loc24_24, %int.convert_checked.loc24_33.1 [template = constants.%.34] -// CHECK:STDOUT: %.loc24_33.5: ref %A = temporary_storage -// CHECK:STDOUT: %.loc24_33.6: ref i32 = class_element_access %.loc24_33.5, element0 -// CHECK:STDOUT: %.loc24_33.7: init i32 = initialize_from %.loc24_33.4 to %.loc24_33.6 [template = constants.%.34] -// CHECK:STDOUT: %.loc24_33.8: %Convert.type.2 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc24_33.9: = bound_method %.loc24_32, %.loc24_33.8 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc24_33.2: init i32 = call %.loc24_33.9(%.loc24_32) [template = constants.%.36] -// CHECK:STDOUT: %.loc24_33.10: init i32 = converted %.loc24_32, %int.convert_checked.loc24_33.2 [template = constants.%.36] -// CHECK:STDOUT: %.loc24_33.11: ref i32 = class_element_access %.loc24_33.5, element1 -// CHECK:STDOUT: %.loc24_33.12: init i32 = initialize_from %.loc24_33.10 to %.loc24_33.11 [template = constants.%.36] -// CHECK:STDOUT: %.loc24_33.13: init %A = class_init (%.loc24_33.7, %.loc24_33.12), %.loc24_33.5 [template = constants.%struct] -// CHECK:STDOUT: %.loc24_33.14: ref %A = temporary %.loc24_33.5, %.loc24_33.13 -// CHECK:STDOUT: %.loc24_35: ref %A = converted %.loc24_33.1, %.loc24_33.14 +// CHECK:STDOUT: %.loc24_33.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc24_33.3: = bound_method %.loc24_24, %.loc24_33.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc24_33.4: = specific_function %.loc24_33.3, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc24_33.1: init %i32 = call %.loc24_33.4(%.loc24_24) [template = constants.%.32] +// CHECK:STDOUT: %.loc24_33.5: init %i32 = converted %.loc24_24, %int.convert_checked.loc24_33.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc24_33.6: ref %A = temporary_storage +// CHECK:STDOUT: %.loc24_33.7: ref %i32 = class_element_access %.loc24_33.6, element0 +// CHECK:STDOUT: %.loc24_33.8: init %i32 = initialize_from %.loc24_33.5 to %.loc24_33.7 [template = constants.%.32] +// CHECK:STDOUT: %.loc24_33.9: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc24_33.10: = bound_method %.loc24_32, %.loc24_33.9 [template = constants.%.33] +// CHECK:STDOUT: %.loc24_33.11: = specific_function %.loc24_33.10, @Convert.2(constants.%.1) [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked.loc24_33.2: init %i32 = call %.loc24_33.11(%.loc24_32) [template = constants.%.35] +// CHECK:STDOUT: %.loc24_33.12: init %i32 = converted %.loc24_32, %int.convert_checked.loc24_33.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc24_33.13: ref %i32 = class_element_access %.loc24_33.6, element1 +// CHECK:STDOUT: %.loc24_33.14: init %i32 = initialize_from %.loc24_33.12 to %.loc24_33.13 [template = constants.%.35] +// CHECK:STDOUT: %.loc24_33.15: init %A = class_init (%.loc24_33.8, %.loc24_33.14), %.loc24_33.6 [template = constants.%struct] +// CHECK:STDOUT: %.loc24_33.16: ref %A = temporary %.loc24_33.6, %.loc24_33.15 +// CHECK:STDOUT: %.loc24_35: ref %A = converted %.loc24_33.1, %.loc24_33.16 // CHECK:STDOUT: %B.ref.loc24: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %.loc24_41.1: ref %B = as_compatible %.loc24_35 // CHECK:STDOUT: %.loc24_41.2: ref %B = converted %.loc24_35, %.loc24_41.1 @@ -563,20 +591,22 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %A, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.x: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %A, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.x: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.5: = complete_type_witness %A [template] -// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.7: type = struct_type {.x: Core.IntLiteral} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %A [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.8: type = struct_type {.x: Core.IntLiteral} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .As = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -599,11 +629,12 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_32, %.loc5_10.1 [template = i32] -// CHECK:STDOUT: %.loc5_8: %.1 = field_decl x, element0 [template] -// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc5_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.3: type = converted %int.make_type_signed, %.loc5_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_8: %.2 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -613,7 +644,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: adapt_decl %A -// CHECK:STDOUT: %.loc10: = complete_type_witness %A [template = constants.%.5] +// CHECK:STDOUT: %.loc10: = complete_type_witness %A [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -621,8 +652,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc21_18: Core.IntLiteral = int_value 1 [template = constants.%.6] -// CHECK:STDOUT: %.loc21_19: %.7 = struct_literal (%.loc21_18) +// CHECK:STDOUT: %.loc21_18: Core.IntLiteral = int_value 1 [template = constants.%.7] +// CHECK:STDOUT: %.loc21_19: %.8 = struct_literal (%.loc21_18) // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %.loc21_21: %B = converted %.loc21_19, [template = ] // CHECK:STDOUT: assign file.%b.var, diff --git a/toolchain/check/testdata/as/as_type.carbon b/toolchain/check/testdata/as/as_type.carbon index ef6325ffd6b2..7a49263858ab 100644 --- a/toolchain/check/testdata/as/as_type.carbon +++ b/toolchain/check/testdata/as/as_type.carbon @@ -13,15 +13,17 @@ let t: type = (i32, i32) as type; // CHECK:STDOUT: --- as_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -37,13 +39,15 @@ let t: type = (i32, i32) as type; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc11_16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_24: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_16, %int.make_type_32.loc11_21) -// CHECK:STDOUT: %.loc11_26.1: type = value_of_initializer %int.make_type_32.loc11_16 [template = i32] -// CHECK:STDOUT: %.loc11_26.2: type = converted %int.make_type_32.loc11_16, %.loc11_26.1 [template = i32] -// CHECK:STDOUT: %.loc11_26.3: type = value_of_initializer %int.make_type_32.loc11_21 [template = i32] -// CHECK:STDOUT: %.loc11_26.4: type = converted %int.make_type_32.loc11_21, %.loc11_26.3 [template = i32] +// CHECK:STDOUT: %.loc11_16: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_16: init type = call constants.%Int(%.loc11_16) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_21: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_21: init type = call constants.%Int(%.loc11_21) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_24: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_16, %int.make_type_signed.loc11_21) +// CHECK:STDOUT: %.loc11_26.1: type = value_of_initializer %int.make_type_signed.loc11_16 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_26.2: type = converted %int.make_type_signed.loc11_16, %.loc11_26.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_26.3: type = value_of_initializer %int.make_type_signed.loc11_21 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_26.4: type = converted %int.make_type_signed.loc11_21, %.loc11_26.3 [template = constants.%i32] // CHECK:STDOUT: %.loc11_26.5: type = converted %.loc11_24, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %t: type = bind_name t, %.loc11_26.5 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/as/basic.carbon b/toolchain/check/testdata/as/basic.carbon index 7aeba674db1a..cf5292aa6381 100644 --- a/toolchain/check/testdata/as/basic.carbon +++ b/toolchain/check/testdata/as/basic.carbon @@ -15,22 +15,25 @@ fn Main() -> i32 { // CHECK:STDOUT: --- basic.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.7, @impl.5(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.7(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .As = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -44,28 +47,31 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32.loc11, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.3: type = converted %int.make_type_signed.loc11, %.loc11_14.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Main() -> i32 { +// CHECK:STDOUT: fn @Main() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_10: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_15.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_15.2: type = converted %int.make_type_32.loc12, %.loc12_15.1 [template = i32] -// CHECK:STDOUT: %.loc12_12.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_12.2: = bound_method %.loc12_10, %.loc12_12.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_12.2(%.loc12_10) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_12.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc12_12.4: i32 = converted %.loc12_10, %.loc12_12.3 [template = constants.%.27] -// CHECK:STDOUT: return %.loc12_12.4 +// CHECK:STDOUT: %.loc12_10: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_15.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_15.3: type = converted %int.make_type_signed.loc12, %.loc12_15.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_12.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_12.2: = bound_method %.loc12_10, %.loc12_12.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_12.3: = specific_function %.loc12_12.2, @Convert.7(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc12_12.3(%.loc12_10) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_12.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc12_12.5: %i32 = converted %.loc12_10, %.loc12_12.4 [template = constants.%.25] +// CHECK:STDOUT: return %.loc12_12.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/fail_no_conversion.carbon b/toolchain/check/testdata/as/fail_no_conversion.carbon index 65f6b1441c0e..ed8a1dc4411b 100644 --- a/toolchain/check/testdata/as/fail_no_conversion.carbon +++ b/toolchain/check/testdata/as/fail_no_conversion.carbon @@ -19,16 +19,18 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: --- fail_no_conversion.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .As = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -41,29 +43,33 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: .n = @__global_init.%n // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc17_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc17_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_17.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc17_9, %int.make_type_32.loc17_14) -// CHECK:STDOUT: %.loc17_17.2: type = value_of_initializer %int.make_type_32.loc17_9 [template = i32] -// CHECK:STDOUT: %.loc17_17.3: type = converted %int.make_type_32.loc17_9, %.loc17_17.2 [template = i32] -// CHECK:STDOUT: %.loc17_17.4: type = value_of_initializer %int.make_type_32.loc17_14 [template = i32] -// CHECK:STDOUT: %.loc17_17.5: type = converted %int.make_type_32.loc17_14, %.loc17_17.4 [template = i32] +// CHECK:STDOUT: %.loc17_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc17_9: init type = call constants.%Int(%.loc17_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc17_14: init type = call constants.%Int(%.loc17_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc17_9, %int.make_type_signed.loc17_14) +// CHECK:STDOUT: %.loc17_17.2: type = value_of_initializer %int.make_type_signed.loc17_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_17.3: type = converted %int.make_type_signed.loc17_9, %.loc17_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_17.4: type = value_of_initializer %int.make_type_signed.loc17_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_17.5: type = converted %int.make_type_signed.loc17_14, %.loc17_17.4 [template = constants.%i32] // CHECK:STDOUT: %.loc17_17.6: type = converted %.loc17_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc17_21: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %int.make_type_32.loc17_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc17_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_35.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc17_27, %int.make_type_32.loc17_32) -// CHECK:STDOUT: %.loc17_35.2: type = value_of_initializer %int.make_type_32.loc17_27 [template = i32] -// CHECK:STDOUT: %.loc17_35.3: type = converted %int.make_type_32.loc17_27, %.loc17_35.2 [template = i32] -// CHECK:STDOUT: %.loc17_35.4: type = value_of_initializer %int.make_type_32.loc17_32 [template = i32] -// CHECK:STDOUT: %.loc17_35.5: type = converted %int.make_type_32.loc17_32, %.loc17_35.4 [template = i32] +// CHECK:STDOUT: %.loc17_21: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc17_27: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc17_27: init type = call constants.%Int(%.loc17_27) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_32: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc17_32: init type = call constants.%Int(%.loc17_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_35.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc17_27, %int.make_type_signed.loc17_32) +// CHECK:STDOUT: %.loc17_35.2: type = value_of_initializer %int.make_type_signed.loc17_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_35.3: type = converted %int.make_type_signed.loc17_27, %.loc17_35.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_35.4: type = value_of_initializer %int.make_type_signed.loc17_32 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_35.5: type = converted %int.make_type_signed.loc17_32, %.loc17_35.4 [template = constants.%i32] // CHECK:STDOUT: %.loc17_35.6: type = converted %.loc17_35.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %.loc17_23.1: %tuple.type.2 = converted %.loc17_21, [template = ] -// CHECK:STDOUT: %.loc17_23.2: i32 = tuple_access %.loc17_23.1, element0 [template = ] +// CHECK:STDOUT: %.loc17_23.2: %i32 = tuple_access %.loc17_23.1, element0 [template = ] // CHECK:STDOUT: %n: %tuple.type.2 = bind_name n, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/as/fail_not_type.carbon b/toolchain/check/testdata/as/fail_not_type.carbon index 23c66da9a782..8a8db8a999f4 100644 --- a/toolchain/check/testdata/as/fail_not_type.carbon +++ b/toolchain/check/testdata/as/fail_not_type.carbon @@ -19,15 +19,17 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: --- fail_not_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -40,17 +42,18 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: .n = @__global_init.%n // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_8.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc17_8.2: type = converted %int.make_type_32, %.loc17_8.1 [template = i32] +// CHECK:STDOUT: %.loc17_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc17_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc17_8.3: type = converted %int.make_type_signed, %.loc17_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc17_14: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc17_19.1: Core.IntLiteral = int_value 2 [template = constants.%.2] +// CHECK:STDOUT: %.loc17_14: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc17_19.1: Core.IntLiteral = int_value 2 [template = constants.%.3] // CHECK:STDOUT: %.loc17_19.2: type = converted %.loc17_19.1, [template = ] -// CHECK:STDOUT: %n: i32 = bind_name n, +// CHECK:STDOUT: %n: %i32 = bind_name n, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/overloaded.carbon b/toolchain/check/testdata/as/overloaded.carbon index 618bc83980c1..021424c88a87 100644 --- a/toolchain/check/testdata/as/overloaded.carbon +++ b/toolchain/check/testdata/as/overloaded.carbon @@ -26,40 +26,43 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %X: type = class_type @X [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %X, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.n: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %X, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.n: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] // CHECK:STDOUT: %As: %As.type.1 = struct_value () [template] // CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%X)> [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @As(%X) [template] -// CHECK:STDOUT: %.8: = interface_witness (%Convert.2) [template] -// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %.9: = interface_witness (%Convert.2) [template] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%i32)> [template] // CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @As(i32) [template] -// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [template] -// CHECK:STDOUT: %.13: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %Convert.type.18: type = fn_type @Convert.13 [template] -// CHECK:STDOUT: %Convert.18: %Convert.type.18 = struct_value () [template] -// CHECK:STDOUT: %.33: = interface_witness (%Convert.18) [template] -// CHECK:STDOUT: %.34: = bound_method %.13, %Convert.18 [template] -// CHECK:STDOUT: %.35: i32 = int_value 4 [template] -// CHECK:STDOUT: %.36: = bound_method %.35, %Convert.2 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @As(%i32) [template] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.4) [template] +// CHECK:STDOUT: %.14: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %Convert.type.17: type = fn_type @Convert.9, @impl.7(%.1) [template] +// CHECK:STDOUT: %Convert.17: %Convert.type.17 = struct_value () [template] +// CHECK:STDOUT: %.30: = interface_witness (%Convert.17) [template] +// CHECK:STDOUT: %.31: = bound_method %.14, %Convert.17 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.9(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 4 [template] +// CHECK:STDOUT: %.34: = bound_method %.33, %Convert.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .As = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %As.type.1 = import_ref Core//prelude/operators/as, inst+14, loaded [template = constants.%As] +// CHECK:STDOUT: %import_ref.2: %As.type.1 = import_ref Core//prelude/operators/as, inst+13, loaded [template = constants.%As] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -71,9 +74,10 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} // CHECK:STDOUT: impl_decl @impl.1 [template] {} { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32, %.loc15_6.1 [template = i32] +// CHECK:STDOUT: %.loc15_6.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_6.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_6.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_6.3: type = converted %int.make_type_signed, %.loc15_6.2 [template = constants.%i32] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %As.ref: %As.type.1 = name_ref As, imports.%import_ref.2 [template = constants.%As] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] @@ -83,33 +87,36 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %As.ref: %As.type.1 = name_ref As, imports.%import_ref.2 [template = constants.%As] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_18.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc19_18.2: type = converted %int.make_type_32, %.loc19_18.1 [template = i32] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(i32)> [template = constants.%As.type.4] +// CHECK:STDOUT: %.loc19_19: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc19_19) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_18.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc19_18.2: type = converted %int.make_type_signed, %.loc19_18.1 [template = constants.%i32] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(constants.%i32)> [template = constants.%As.type.4] // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_8.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc23_8.2: type = converted %int.make_type_32, %.loc23_8.1 [template = i32] +// CHECK:STDOUT: %.loc23_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc23_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc23_8.3: type = converted %int.make_type_signed, %.loc23_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %.loc15_6.2 as %As.type { +// CHECK:STDOUT: impl @impl.1: %.loc15_6.3 as %As.type { // CHECK:STDOUT: %Convert.decl: %Convert.type.2 = fn_decl @Convert.2 [template = constants.%Convert.2] { -// CHECK:STDOUT: %self.patt: i32 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: i32 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %self.patt: %i32 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %i32 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %X = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %X = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_20.2: type = converted %int.make_type_32, %.loc16_20.1 [template = i32] +// CHECK:STDOUT: %.loc16_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc16_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc16_20.3: type = converted %int.make_type_signed, %.loc16_20.2 [template = constants.%i32] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %self.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %self: i32 = bind_name self, %self.param +// CHECK:STDOUT: %self.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %self: %i32 = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %X = out_param runtime_param1 // CHECK:STDOUT: %return: ref %X = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15_24: = interface_witness (%Convert.decl) [template = constants.%.8] +// CHECK:STDOUT: %.loc15_24: = interface_witness (%Convert.decl) [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl @@ -120,19 +127,20 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %Convert.decl: %Convert.type.4 = fn_decl @Convert.3 [template = constants.%Convert.4] { // CHECK:STDOUT: %self.patt: %X = binding_pattern self // CHECK:STDOUT: %self.param_patt: %X = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc20_28.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc20_28.2: type = converted %int.make_type_32, %.loc20_28.1 [template = i32] +// CHECK:STDOUT: %.loc20_28.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc20_28.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc20_28.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc20_28.3: type = converted %int.make_type_signed, %.loc20_28.2 [template = constants.%i32] // CHECK:STDOUT: %self.param: %X = value_param runtime_param0 // CHECK:STDOUT: %self: %X = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19_24: = interface_witness (%Convert.decl) [template = constants.%.12] +// CHECK:STDOUT: %.loc19_24: = interface_witness (%Convert.decl) [template = constants.%.13] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl @@ -140,65 +148,69 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl n, element0 [template] -// CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X // CHECK:STDOUT: .n = %.loc12_8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.2[%self.param_patt: i32]() -> %return: %X { +// CHECK:STDOUT: fn @Convert.2[%self.param_patt: %i32]() -> %return: %X { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: i32 = name_ref self, %self -// CHECK:STDOUT: %.loc16_51.1: %.2 = struct_literal (%self.ref) -// CHECK:STDOUT: %.loc16_51.2: ref i32 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc16_51.3: init i32 = initialize_from %self.ref to %.loc16_51.2 +// CHECK:STDOUT: %self.ref: %i32 = name_ref self, %self +// CHECK:STDOUT: %.loc16_51.1: %.3 = struct_literal (%self.ref) +// CHECK:STDOUT: %.loc16_51.2: ref %i32 = class_element_access %return, element0 +// CHECK:STDOUT: %.loc16_51.3: init %i32 = initialize_from %self.ref to %.loc16_51.2 // CHECK:STDOUT: %.loc16_51.4: init %X = class_init (%.loc16_51.3), %return // CHECK:STDOUT: %.loc16_52: init %X = converted %.loc16_51.1, %.loc16_51.4 // CHECK:STDOUT: return %.loc16_52 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.3[%self.param_patt: %X]() -> i32 { +// CHECK:STDOUT: fn @Convert.3[%self.param_patt: %X]() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %X = name_ref self, %self -// CHECK:STDOUT: %n.ref: %.1 = name_ref n, @X.%.loc12_8 [template = @X.%.loc12_8] -// CHECK:STDOUT: %.loc20_45.1: ref i32 = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc20_45.2: i32 = bind_value %.loc20_45.1 +// CHECK:STDOUT: %n.ref: %.2 = name_ref n, @X.%.loc12_8 [template = @X.%.loc12_8] +// CHECK:STDOUT: %.loc20_45.1: ref %i32 = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc20_45.2: %i32 = bind_value %.loc20_45.1 // CHECK:STDOUT: return %.loc20_45.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc23_16: Core.IntLiteral = int_value 4 [template = constants.%.13] -// CHECK:STDOUT: %int.make_type_32.loc23_21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_21.1: type = value_of_initializer %int.make_type_32.loc23_21 [template = i32] -// CHECK:STDOUT: %.loc23_21.2: type = converted %int.make_type_32.loc23_21, %.loc23_21.1 [template = i32] -// CHECK:STDOUT: %.loc23_18.1: %Convert.type.5 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.18] -// CHECK:STDOUT: %.loc23_18.2: = bound_method %.loc23_16, %.loc23_18.1 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc23_18.2(%.loc23_16) [template = constants.%.35] -// CHECK:STDOUT: %.loc23_18.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.35] -// CHECK:STDOUT: %.loc23_18.4: i32 = converted %.loc23_16, %.loc23_18.3 [template = constants.%.35] +// CHECK:STDOUT: %.loc23_16: Core.IntLiteral = int_value 4 [template = constants.%.14] +// CHECK:STDOUT: %.loc23_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc23_21: init type = call constants.%Int(%.loc23_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_21.2: type = value_of_initializer %int.make_type_signed.loc23_21 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_21.3: type = converted %int.make_type_signed.loc23_21, %.loc23_21.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_18.1: %Convert.type.5 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.17] +// CHECK:STDOUT: %.loc23_18.2: = bound_method %.loc23_16, %.loc23_18.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc23_18.3: = specific_function %.loc23_18.2, @Convert.9(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc23_18.3(%.loc23_16) [template = constants.%.33] +// CHECK:STDOUT: %.loc23_18.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.33] +// CHECK:STDOUT: %.loc23_18.5: %i32 = converted %.loc23_16, %.loc23_18.4 [template = constants.%.33] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %.loc23_26.1: %Convert.type.3 = interface_witness_access constants.%.8, element0 [template = constants.%Convert.2] -// CHECK:STDOUT: %.loc23_26.2: = bound_method %.loc23_18.4, %.loc23_26.1 [template = constants.%.36] +// CHECK:STDOUT: %.loc23_26.1: %Convert.type.3 = interface_witness_access constants.%.9, element0 [template = constants.%Convert.2] +// CHECK:STDOUT: %.loc23_26.2: = bound_method %.loc23_18.5, %.loc23_26.1 [template = constants.%.34] // CHECK:STDOUT: %.loc23_26.3: ref %X = temporary_storage -// CHECK:STDOUT: %Convert.call.loc23_26: init %X = call %.loc23_26.2(%.loc23_18.4) to %.loc23_26.3 -// CHECK:STDOUT: %.loc23_26.4: init %X = converted %.loc23_18.4, %Convert.call.loc23_26 -// CHECK:STDOUT: %int.make_type_32.loc23_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_35.1: type = value_of_initializer %int.make_type_32.loc23_35 [template = i32] -// CHECK:STDOUT: %.loc23_35.2: type = converted %int.make_type_32.loc23_35, %.loc23_35.1 [template = i32] -// CHECK:STDOUT: %.loc23_32.1: %Convert.type.5 = interface_witness_access constants.%.12, element0 [template = constants.%Convert.4] +// CHECK:STDOUT: %Convert.call.loc23_26: init %X = call %.loc23_26.2(%.loc23_18.5) to %.loc23_26.3 +// CHECK:STDOUT: %.loc23_26.4: init %X = converted %.loc23_18.5, %Convert.call.loc23_26 +// CHECK:STDOUT: %.loc23_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc23_35: init type = call constants.%Int(%.loc23_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_35.2: type = value_of_initializer %int.make_type_signed.loc23_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_35.3: type = converted %int.make_type_signed.loc23_35, %.loc23_35.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_32.1: %Convert.type.5 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.4] // CHECK:STDOUT: %.loc23_32.2: = bound_method %.loc23_26.4, %.loc23_32.1 // CHECK:STDOUT: %.loc23_26.5: ref %X = temporary %.loc23_26.3, %.loc23_26.4 // CHECK:STDOUT: %.loc23_26.6: %X = bind_value %.loc23_26.5 -// CHECK:STDOUT: %Convert.call.loc23_32: init i32 = call %.loc23_32.2(%.loc23_26.6) -// CHECK:STDOUT: %.loc23_32.3: i32 = value_of_initializer %Convert.call.loc23_32 -// CHECK:STDOUT: %.loc23_32.4: i32 = converted %.loc23_26.4, %.loc23_32.3 -// CHECK:STDOUT: %n: i32 = bind_name n, %.loc23_32.4 +// CHECK:STDOUT: %Convert.call.loc23_32: init %i32 = call %.loc23_32.2(%.loc23_26.6) +// CHECK:STDOUT: %.loc23_32.3: %i32 = value_of_initializer %Convert.call.loc23_32 +// CHECK:STDOUT: %.loc23_32.4: %i32 = converted %.loc23_26.4, %.loc23_32.3 +// CHECK:STDOUT: %n: %i32 = bind_name n, %.loc23_32.4 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/builtin_insts.carbon b/toolchain/check/testdata/basics/builtin_insts.carbon index 18cc407ab67c..9147454378d3 100644 --- a/toolchain/check/testdata/basics/builtin_insts.carbon +++ b/toolchain/check/testdata/basics/builtin_insts.carbon @@ -37,7 +37,6 @@ // CHECK:STDOUT: instAutoType: {kind: BuiltinInst, arg0: AutoType, type: typeTypeType} // CHECK:STDOUT: instBoolType: {kind: BuiltinInst, arg0: BoolType, type: typeTypeType} // CHECK:STDOUT: instIntLiteralType: {kind: BuiltinInst, arg0: IntLiteralType, type: typeTypeType} -// CHECK:STDOUT: instIntType: {kind: BuiltinInst, arg0: IntType, type: typeTypeType} // CHECK:STDOUT: instFloatType: {kind: BuiltinInst, arg0: FloatType, type: typeTypeType} // CHECK:STDOUT: instStringType: {kind: BuiltinInst, arg0: StringType, type: typeTypeType} // CHECK:STDOUT: instBoundMethodType: {kind: BuiltinInst, arg0: BoundMethodType, type: typeTypeType} @@ -52,7 +51,6 @@ // CHECK:STDOUT: instAutoType: templateConstant(instAutoType) // CHECK:STDOUT: instBoolType: templateConstant(instBoolType) // CHECK:STDOUT: instIntLiteralType: templateConstant(instIntLiteralType) -// CHECK:STDOUT: instIntType: templateConstant(instIntType) // CHECK:STDOUT: instFloatType: templateConstant(instFloatType) // CHECK:STDOUT: instStringType: templateConstant(instStringType) // CHECK:STDOUT: instBoundMethodType: templateConstant(instBoundMethodType) diff --git a/toolchain/check/testdata/basics/builtin_types.carbon b/toolchain/check/testdata/basics/builtin_types.carbon index fa04b5f46f2c..e9eea2988c01 100644 --- a/toolchain/check/testdata/basics/builtin_types.carbon +++ b/toolchain/check/testdata/basics/builtin_types.carbon @@ -16,27 +16,30 @@ var test_type: type = i32; // CHECK:STDOUT: --- builtin_types.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] -// CHECK:STDOUT: %.29: f64 = float_literal 0.10000000000000001 [template] -// CHECK:STDOUT: %.31: String = string_literal "Test" [template] +// CHECK:STDOUT: %.27: f64 = float_literal 0.10000000000000001 [template] +// CHECK:STDOUT: %.29: String = string_literal "Test" [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Float = %import_ref.51 +// CHECK:STDOUT: .Float = %import_ref.38 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -51,12 +54,13 @@ var test_type: type = i32; // CHECK:STDOUT: .test_type = %test_type // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_15.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_15.2: type = converted %int.make_type_32, %.loc11_15.1 [template = i32] -// CHECK:STDOUT: %test_i32.var: ref i32 = var test_i32 -// CHECK:STDOUT: %test_i32: ref i32 = bind_name test_i32, %test_i32.var -// CHECK:STDOUT: %.loc12_15.1: Core.IntLiteral = int_value 64 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_15.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_15.3: type = converted %int.make_type_signed, %.loc11_15.2 [template = constants.%i32] +// CHECK:STDOUT: %test_i32.var: ref %i32 = var test_i32 +// CHECK:STDOUT: %test_i32: ref %i32 = bind_name test_i32, %test_i32.var +// CHECK:STDOUT: %.loc12_15.1: Core.IntLiteral = int_value 64 [template = constants.%.26] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc12_15.1) [template = f64] // CHECK:STDOUT: %.loc12_15.2: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc12_15.3: type = converted %float.make_type, %.loc12_15.2 [template = f64] @@ -68,18 +72,20 @@ var test_type: type = i32; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_21: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_22.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_22.2: = bound_method %.loc11_21, %.loc11_22.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc11_22.2(%.loc11_21) [template = constants.%.27] -// CHECK:STDOUT: %.loc11_22.3: init i32 = converted %.loc11_21, %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: assign file.%test_i32.var, %.loc11_22.3 -// CHECK:STDOUT: %.loc12: f64 = float_literal 0.10000000000000001 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_21: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_22.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_22.2: = bound_method %.loc11_21, %.loc11_22.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc11_22.3: = specific_function %.loc11_22.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc11_22.3(%.loc11_21) [template = constants.%.25] +// CHECK:STDOUT: %.loc11_22.4: init %i32 = converted %.loc11_21, %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: assign file.%test_i32.var, %.loc11_22.4 +// CHECK:STDOUT: %.loc12: f64 = float_literal 0.10000000000000001 [template = constants.%.27] // CHECK:STDOUT: assign file.%test_f64.var, %.loc12 -// CHECK:STDOUT: %.loc13: String = string_literal "Test" [template = constants.%.31] +// CHECK:STDOUT: %.loc13: String = string_literal "Test" [template = constants.%.29] // CHECK:STDOUT: %test_str: String = bind_name test_str, %.loc13 -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: assign file.%test_type.var, %int.make_type_32 +// CHECK:STDOUT: %.loc14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14) [template = constants.%i32] +// CHECK:STDOUT: assign file.%test_type.var, %int.make_type_signed // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/fail_bad_run_2.carbon b/toolchain/check/testdata/basics/fail_bad_run_2.carbon index e42082f49b1f..7e763ef838f2 100644 --- a/toolchain/check/testdata/basics/fail_bad_run_2.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run_2.carbon @@ -16,15 +16,17 @@ fn Run(n: i32) {} // CHECK:STDOUT: --- fail_bad_run_2.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -37,18 +39,19 @@ fn Run(n: i32) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_32, %.loc14_11.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %.loc14_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_11.3: type = converted %int.make_type_signed, %.loc14_11.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Run(%n.param_patt: i32) { +// CHECK:STDOUT: fn @Run(%n.param_patt: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon index fedd87cdc135..384e6905dec0 100644 --- a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon +++ b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon @@ -40,28 +40,32 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: --- fail_numeric_literal_overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 39999999999999999993 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 39999999999999999993 [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 2147483648 [template] -// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2147483648 [template] -// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 39999999999999999993 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 39999999999999999993 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 2147483648 [template] +// CHECK:STDOUT: %.27: = bound_method %.26, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2147483648 [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Float = %import_ref.51 +// CHECK:STDOUT: .Float = %import_ref.38 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -77,20 +81,23 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: .e = @__global_init.%e // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_8.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] -// CHECK:STDOUT: %.loc21_8.2: type = converted %int.make_type_32.loc21, %.loc21_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc27_8.1: type = value_of_initializer %int.make_type_32.loc27 [template = i32] -// CHECK:STDOUT: %.loc27_8.2: type = converted %int.make_type_32.loc27, %.loc27_8.1 [template = i32] -// CHECK:STDOUT: %.loc33_8.1: Core.IntLiteral = int_value 64 [template = constants.%.31] +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed.loc15, %.loc15_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%.loc21_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_8.2: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_8.3: type = converted %int.make_type_signed.loc21, %.loc21_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc27_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc27: init type = call constants.%Int(%.loc27_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc27_8.2: type = value_of_initializer %int.make_type_signed.loc27 [template = constants.%i32] +// CHECK:STDOUT: %.loc27_8.3: type = converted %int.make_type_signed.loc27, %.loc27_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc33_8.1: Core.IntLiteral = int_value 64 [template = constants.%.30] // CHECK:STDOUT: %float.make_type.loc33: init type = call constants.%Float(%.loc33_8.1) [template = f64] // CHECK:STDOUT: %.loc33_8.2: type = value_of_initializer %float.make_type.loc33 [template = f64] // CHECK:STDOUT: %.loc33_8.3: type = converted %float.make_type.loc33, %.loc33_8.2 [template = f64] -// CHECK:STDOUT: %.loc38_8.1: Core.IntLiteral = int_value 64 [template = constants.%.31] +// CHECK:STDOUT: %.loc38_8.1: Core.IntLiteral = int_value 64 [template = constants.%.30] // CHECK:STDOUT: %float.make_type.loc38: init type = call constants.%Float(%.loc38_8.1) [template = f64] // CHECK:STDOUT: %.loc38_8.2: type = value_of_initializer %float.make_type.loc38 [template = f64] // CHECK:STDOUT: %.loc38_8.3: type = converted %float.make_type.loc38, %.loc38_8.2 [template = f64] @@ -98,27 +105,30 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15_14: Core.IntLiteral = int_value 39999999999999999993 [template = constants.%.1] -// CHECK:STDOUT: %.loc15_34.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_34.2: = bound_method %.loc15_14, %.loc15_34.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc15: init i32 = call %.loc15_34.2(%.loc15_14) [template = constants.%.27] -// CHECK:STDOUT: %.loc15_34.3: i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%.27] -// CHECK:STDOUT: %.loc15_34.4: i32 = converted %.loc15_14, %.loc15_34.3 [template = constants.%.27] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc15_34.4 -// CHECK:STDOUT: %.loc21_14: Core.IntLiteral = int_value 2147483648 [template = constants.%.28] -// CHECK:STDOUT: %.loc21_27.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc21_27.2: = bound_method %.loc21_14, %.loc21_27.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc21: init i32 = call %.loc21_27.2(%.loc21_14) [template = constants.%.30] -// CHECK:STDOUT: %.loc21_27.3: i32 = value_of_initializer %int.convert_checked.loc21 [template = constants.%.30] -// CHECK:STDOUT: %.loc21_27.4: i32 = converted %.loc21_14, %.loc21_27.3 [template = constants.%.30] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc21_27.4 -// CHECK:STDOUT: %.loc27_14: Core.IntLiteral = int_value 2147483648 [template = constants.%.28] -// CHECK:STDOUT: %.loc27_25.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc27_25.2: = bound_method %.loc27_14, %.loc27_25.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc27: init i32 = call %.loc27_25.2(%.loc27_14) [template = constants.%.30] -// CHECK:STDOUT: %.loc27_25.3: i32 = value_of_initializer %int.convert_checked.loc27 [template = constants.%.30] -// CHECK:STDOUT: %.loc27_25.4: i32 = converted %.loc27_14, %.loc27_25.3 [template = constants.%.30] -// CHECK:STDOUT: %c: i32 = bind_name c, %.loc27_25.4 +// CHECK:STDOUT: %.loc15_14: Core.IntLiteral = int_value 39999999999999999993 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_34.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_34.2: = bound_method %.loc15_14, %.loc15_34.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc15_34.3: = specific_function %.loc15_34.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %.loc15_34.3(%.loc15_14) [template = constants.%.25] +// CHECK:STDOUT: %.loc15_34.4: %i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%.25] +// CHECK:STDOUT: %.loc15_34.5: %i32 = converted %.loc15_14, %.loc15_34.4 [template = constants.%.25] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc15_34.5 +// CHECK:STDOUT: %.loc21_14: Core.IntLiteral = int_value 2147483648 [template = constants.%.26] +// CHECK:STDOUT: %.loc21_27.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc21_27.2: = bound_method %.loc21_14, %.loc21_27.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc21_27.3: = specific_function %.loc21_27.2, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %.loc21_27.3(%.loc21_14) [template = constants.%.29] +// CHECK:STDOUT: %.loc21_27.4: %i32 = value_of_initializer %int.convert_checked.loc21 [template = constants.%.29] +// CHECK:STDOUT: %.loc21_27.5: %i32 = converted %.loc21_14, %.loc21_27.4 [template = constants.%.29] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc21_27.5 +// CHECK:STDOUT: %.loc27_14: Core.IntLiteral = int_value 2147483648 [template = constants.%.26] +// CHECK:STDOUT: %.loc27_25.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc27_25.2: = bound_method %.loc27_14, %.loc27_25.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc27_25.3: = specific_function %.loc27_25.2, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %.loc27_25.3(%.loc27_14) [template = constants.%.29] +// CHECK:STDOUT: %.loc27_25.4: %i32 = value_of_initializer %int.convert_checked.loc27 [template = constants.%.29] +// CHECK:STDOUT: %.loc27_25.5: %i32 = converted %.loc27_14, %.loc27_25.4 [template = constants.%.29] +// CHECK:STDOUT: %c: %i32 = bind_name c, %.loc27_25.5 // CHECK:STDOUT: %d: f64 = bind_name d, // CHECK:STDOUT: %e: f64 = bind_name e, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon b/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon index 64a463426f58..efe35c4059f3 100644 --- a/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon +++ b/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon @@ -17,13 +17,15 @@ var y: i32 = x.b; // CHECK:STDOUT: --- fail_qualifier_unsupported.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -36,21 +38,23 @@ var y: i32 = x.b; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_32.loc11, %.loc11_8.1 [template = i32] -// CHECK:STDOUT: %x.var: ref i32 = var x -// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] -// CHECK:STDOUT: %y.var: ref i32 = var y -// CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var +// CHECK:STDOUT: %.loc11_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_8.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_8.3: type = converted %int.make_type_signed.loc11, %.loc11_8.2 [template = constants.%i32] +// CHECK:STDOUT: %x.var: ref %i32 = var x +// CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed.loc15, %.loc15_8.2 [template = constants.%i32] +// CHECK:STDOUT: %y.var: ref %i32 = var y +// CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.ref: ref i32 = name_ref x, file.%x +// CHECK:STDOUT: %x.ref: ref %i32 = name_ref x, file.%x // CHECK:STDOUT: assign file.%y.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/numeric_literals.carbon b/toolchain/check/testdata/basics/numeric_literals.carbon index 231a9e613581..56750d8bc3ea 100644 --- a/toolchain/check/testdata/basics/numeric_literals.carbon +++ b/toolchain/check/testdata/basics/numeric_literals.carbon @@ -34,35 +34,40 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 6 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 8 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 9 [template] -// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 8 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 9 [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 2147483647 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.7: i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.32: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 8 [template] -// CHECK:STDOUT: %.34: i32 = int_value 1 [template] -// CHECK:STDOUT: %.35: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.36: i32 = int_value 9 [template] -// CHECK:STDOUT: %.37: i32 = int_value 2 [template] -// CHECK:STDOUT: %.38: i32 = int_value 3 [template] -// CHECK:STDOUT: %.39: i32 = int_value 4 [template] -// CHECK:STDOUT: %.40: = bound_method %.6, %Convert.15 [template] -// CHECK:STDOUT: %.41: i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %.42: i32 = int_value 5 [template] -// CHECK:STDOUT: %array.1: %.2 = tuple_value (%.33, %.36, %.33, %.33, %.41, %.41) [template] +// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.28: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.29: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.30: = specific_function %.29, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.31: %i32 = int_value 8 [template] +// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.33: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.34: = specific_function %.33, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.35: %i32 = int_value 9 [template] +// CHECK:STDOUT: %.36: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.37: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.38: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.39: = bound_method %.7, %Convert.14 [template] +// CHECK:STDOUT: %.40: = specific_function %.39, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.41: %i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.42: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %array.1: %.3 = tuple_value (%.31, %.35, %.31, %.31, %.41, %.41) [template] // CHECK:STDOUT: %.43: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] -// CHECK:STDOUT: %.44: type = array_type %.1, f64 [template] +// CHECK:STDOUT: %.44: type = array_type %.2, f64 [template] // CHECK:STDOUT: %.46: f64 = float_literal 0.90000000000000002 [template] // CHECK:STDOUT: %.47: f64 = float_literal 8 [template] // CHECK:STDOUT: %.48: f64 = float_literal 80 [template] @@ -75,9 +80,9 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Float = %import_ref.51 +// CHECK:STDOUT: .Float = %import_ref.38 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -94,68 +99,75 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_19: Core.IntLiteral = int_value 6 [template = constants.%.1] -// CHECK:STDOUT: %.loc14_14.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_14.2: type = converted %int.make_type_32, %.loc14_14.1 [template = i32] -// CHECK:STDOUT: %.loc14_20: type = array_type %.loc14_19, i32 [template = constants.%.2] -// CHECK:STDOUT: %ints.var: ref %.2 = var ints -// CHECK:STDOUT: %ints: ref %.2 = bind_name ints, %ints.var -// CHECK:STDOUT: %.loc15: Core.IntLiteral = int_value 8 [template = constants.%.4] -// CHECK:STDOUT: %.loc16: Core.IntLiteral = int_value 9 [template = constants.%.5] -// CHECK:STDOUT: %.loc17: Core.IntLiteral = int_value 8 [template = constants.%.4] -// CHECK:STDOUT: %.loc18: Core.IntLiteral = int_value 8 [template = constants.%.4] -// CHECK:STDOUT: %.loc19: Core.IntLiteral = int_value 2147483647 [template = constants.%.6] -// CHECK:STDOUT: %.loc20: Core.IntLiteral = int_value 2147483647 [template = constants.%.6] +// CHECK:STDOUT: %.loc14_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_19: Core.IntLiteral = int_value 6 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_14.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_14.3: type = converted %int.make_type_signed, %.loc14_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_20: type = array_type %.loc14_19, %i32 [template = constants.%.3] +// CHECK:STDOUT: %ints.var: ref %.3 = var ints +// CHECK:STDOUT: %ints: ref %.3 = bind_name ints, %ints.var +// CHECK:STDOUT: %.loc15: Core.IntLiteral = int_value 8 [template = constants.%.5] +// CHECK:STDOUT: %.loc16: Core.IntLiteral = int_value 9 [template = constants.%.6] +// CHECK:STDOUT: %.loc17: Core.IntLiteral = int_value 8 [template = constants.%.5] +// CHECK:STDOUT: %.loc18: Core.IntLiteral = int_value 8 [template = constants.%.5] +// CHECK:STDOUT: %.loc19: Core.IntLiteral = int_value 2147483647 [template = constants.%.7] +// CHECK:STDOUT: %.loc20: Core.IntLiteral = int_value 2147483647 [template = constants.%.7] // CHECK:STDOUT: %.loc21_3.1: %tuple.type.1 = tuple_literal (%.loc15, %.loc16, %.loc17, %.loc18, %.loc19, %.loc20) -// CHECK:STDOUT: %.loc21_3.2: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc21_3.3: = bound_method %.loc15, %.loc21_3.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc21_3.1: init i32 = call %.loc21_3.3(%.loc15) [template = constants.%.33] -// CHECK:STDOUT: %.loc21_3.4: init i32 = converted %.loc15, %int.convert_checked.loc21_3.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc21_3.5: i32 = int_value 0 [template = constants.%.7] -// CHECK:STDOUT: %.loc21_3.6: ref i32 = array_index %ints.var, %.loc21_3.5 -// CHECK:STDOUT: %.loc21_3.7: init i32 = initialize_from %.loc21_3.4 to %.loc21_3.6 [template = constants.%.33] -// CHECK:STDOUT: %.loc21_3.8: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc21_3.9: = bound_method %.loc16, %.loc21_3.8 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc21_3.2: init i32 = call %.loc21_3.9(%.loc16) [template = constants.%.36] -// CHECK:STDOUT: %.loc21_3.10: init i32 = converted %.loc16, %int.convert_checked.loc21_3.2 [template = constants.%.36] -// CHECK:STDOUT: %.loc21_3.11: i32 = int_value 1 [template = constants.%.34] -// CHECK:STDOUT: %.loc21_3.12: ref i32 = array_index %ints.var, %.loc21_3.11 -// CHECK:STDOUT: %.loc21_3.13: init i32 = initialize_from %.loc21_3.10 to %.loc21_3.12 [template = constants.%.36] -// CHECK:STDOUT: %.loc21_3.14: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc21_3.15: = bound_method %.loc17, %.loc21_3.14 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc21_3.3: init i32 = call %.loc21_3.15(%.loc17) [template = constants.%.33] -// CHECK:STDOUT: %.loc21_3.16: init i32 = converted %.loc17, %int.convert_checked.loc21_3.3 [template = constants.%.33] -// CHECK:STDOUT: %.loc21_3.17: i32 = int_value 2 [template = constants.%.37] -// CHECK:STDOUT: %.loc21_3.18: ref i32 = array_index %ints.var, %.loc21_3.17 -// CHECK:STDOUT: %.loc21_3.19: init i32 = initialize_from %.loc21_3.16 to %.loc21_3.18 [template = constants.%.33] -// CHECK:STDOUT: %.loc21_3.20: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc21_3.21: = bound_method %.loc18, %.loc21_3.20 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc21_3.4: init i32 = call %.loc21_3.21(%.loc18) [template = constants.%.33] -// CHECK:STDOUT: %.loc21_3.22: init i32 = converted %.loc18, %int.convert_checked.loc21_3.4 [template = constants.%.33] -// CHECK:STDOUT: %.loc21_3.23: i32 = int_value 3 [template = constants.%.38] -// CHECK:STDOUT: %.loc21_3.24: ref i32 = array_index %ints.var, %.loc21_3.23 -// CHECK:STDOUT: %.loc21_3.25: init i32 = initialize_from %.loc21_3.22 to %.loc21_3.24 [template = constants.%.33] -// CHECK:STDOUT: %.loc21_3.26: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc21_3.27: = bound_method %.loc19, %.loc21_3.26 [template = constants.%.40] -// CHECK:STDOUT: %int.convert_checked.loc21_3.5: init i32 = call %.loc21_3.27(%.loc19) [template = constants.%.41] -// CHECK:STDOUT: %.loc21_3.28: init i32 = converted %.loc19, %int.convert_checked.loc21_3.5 [template = constants.%.41] -// CHECK:STDOUT: %.loc21_3.29: i32 = int_value 4 [template = constants.%.39] -// CHECK:STDOUT: %.loc21_3.30: ref i32 = array_index %ints.var, %.loc21_3.29 -// CHECK:STDOUT: %.loc21_3.31: init i32 = initialize_from %.loc21_3.28 to %.loc21_3.30 [template = constants.%.41] -// CHECK:STDOUT: %.loc21_3.32: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc21_3.33: = bound_method %.loc20, %.loc21_3.32 [template = constants.%.40] -// CHECK:STDOUT: %int.convert_checked.loc21_3.6: init i32 = call %.loc21_3.33(%.loc20) [template = constants.%.41] -// CHECK:STDOUT: %.loc21_3.34: init i32 = converted %.loc20, %int.convert_checked.loc21_3.6 [template = constants.%.41] -// CHECK:STDOUT: %.loc21_3.35: i32 = int_value 5 [template = constants.%.42] -// CHECK:STDOUT: %.loc21_3.36: ref i32 = array_index %ints.var, %.loc21_3.35 -// CHECK:STDOUT: %.loc21_3.37: init i32 = initialize_from %.loc21_3.34 to %.loc21_3.36 [template = constants.%.41] -// CHECK:STDOUT: %.loc21_3.38: init %.2 = array_init (%.loc21_3.7, %.loc21_3.13, %.loc21_3.19, %.loc21_3.25, %.loc21_3.31, %.loc21_3.37) to %ints.var [template = constants.%array.1] -// CHECK:STDOUT: %.loc21_4: init %.2 = converted %.loc21_3.1, %.loc21_3.38 [template = constants.%array.1] +// CHECK:STDOUT: %.loc21_3.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc21_3.3: = bound_method %.loc15, %.loc21_3.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc21_3.4: = specific_function %.loc21_3.3, @Convert.2(constants.%.1) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc21_3.1: init %i32 = call %.loc21_3.4(%.loc15) [template = constants.%.31] +// CHECK:STDOUT: %.loc21_3.5: init %i32 = converted %.loc15, %int.convert_checked.loc21_3.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc21_3.6: Core.IntLiteral = int_value 0 [template = constants.%.8] +// CHECK:STDOUT: %.loc21_3.7: ref %i32 = array_index %ints.var, %.loc21_3.6 +// CHECK:STDOUT: %.loc21_3.8: init %i32 = initialize_from %.loc21_3.5 to %.loc21_3.7 [template = constants.%.31] +// CHECK:STDOUT: %.loc21_3.9: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc21_3.10: = bound_method %.loc16, %.loc21_3.9 [template = constants.%.33] +// CHECK:STDOUT: %.loc21_3.11: = specific_function %.loc21_3.10, @Convert.2(constants.%.1) [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked.loc21_3.2: init %i32 = call %.loc21_3.11(%.loc16) [template = constants.%.35] +// CHECK:STDOUT: %.loc21_3.12: init %i32 = converted %.loc16, %int.convert_checked.loc21_3.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc21_3.13: Core.IntLiteral = int_value 1 [template = constants.%.32] +// CHECK:STDOUT: %.loc21_3.14: ref %i32 = array_index %ints.var, %.loc21_3.13 +// CHECK:STDOUT: %.loc21_3.15: init %i32 = initialize_from %.loc21_3.12 to %.loc21_3.14 [template = constants.%.35] +// CHECK:STDOUT: %.loc21_3.16: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc21_3.17: = bound_method %.loc17, %.loc21_3.16 [template = constants.%.29] +// CHECK:STDOUT: %.loc21_3.18: = specific_function %.loc21_3.17, @Convert.2(constants.%.1) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc21_3.3: init %i32 = call %.loc21_3.18(%.loc17) [template = constants.%.31] +// CHECK:STDOUT: %.loc21_3.19: init %i32 = converted %.loc17, %int.convert_checked.loc21_3.3 [template = constants.%.31] +// CHECK:STDOUT: %.loc21_3.20: Core.IntLiteral = int_value 2 [template = constants.%.36] +// CHECK:STDOUT: %.loc21_3.21: ref %i32 = array_index %ints.var, %.loc21_3.20 +// CHECK:STDOUT: %.loc21_3.22: init %i32 = initialize_from %.loc21_3.19 to %.loc21_3.21 [template = constants.%.31] +// CHECK:STDOUT: %.loc21_3.23: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc21_3.24: = bound_method %.loc18, %.loc21_3.23 [template = constants.%.29] +// CHECK:STDOUT: %.loc21_3.25: = specific_function %.loc21_3.24, @Convert.2(constants.%.1) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc21_3.4: init %i32 = call %.loc21_3.25(%.loc18) [template = constants.%.31] +// CHECK:STDOUT: %.loc21_3.26: init %i32 = converted %.loc18, %int.convert_checked.loc21_3.4 [template = constants.%.31] +// CHECK:STDOUT: %.loc21_3.27: Core.IntLiteral = int_value 3 [template = constants.%.37] +// CHECK:STDOUT: %.loc21_3.28: ref %i32 = array_index %ints.var, %.loc21_3.27 +// CHECK:STDOUT: %.loc21_3.29: init %i32 = initialize_from %.loc21_3.26 to %.loc21_3.28 [template = constants.%.31] +// CHECK:STDOUT: %.loc21_3.30: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc21_3.31: = bound_method %.loc19, %.loc21_3.30 [template = constants.%.39] +// CHECK:STDOUT: %.loc21_3.32: = specific_function %.loc21_3.31, @Convert.2(constants.%.1) [template = constants.%.40] +// CHECK:STDOUT: %int.convert_checked.loc21_3.5: init %i32 = call %.loc21_3.32(%.loc19) [template = constants.%.41] +// CHECK:STDOUT: %.loc21_3.33: init %i32 = converted %.loc19, %int.convert_checked.loc21_3.5 [template = constants.%.41] +// CHECK:STDOUT: %.loc21_3.34: Core.IntLiteral = int_value 4 [template = constants.%.38] +// CHECK:STDOUT: %.loc21_3.35: ref %i32 = array_index %ints.var, %.loc21_3.34 +// CHECK:STDOUT: %.loc21_3.36: init %i32 = initialize_from %.loc21_3.33 to %.loc21_3.35 [template = constants.%.41] +// CHECK:STDOUT: %.loc21_3.37: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc21_3.38: = bound_method %.loc20, %.loc21_3.37 [template = constants.%.39] +// CHECK:STDOUT: %.loc21_3.39: = specific_function %.loc21_3.38, @Convert.2(constants.%.1) [template = constants.%.40] +// CHECK:STDOUT: %int.convert_checked.loc21_3.6: init %i32 = call %.loc21_3.39(%.loc20) [template = constants.%.41] +// CHECK:STDOUT: %.loc21_3.40: init %i32 = converted %.loc20, %int.convert_checked.loc21_3.6 [template = constants.%.41] +// CHECK:STDOUT: %.loc21_3.41: Core.IntLiteral = int_value 5 [template = constants.%.42] +// CHECK:STDOUT: %.loc21_3.42: ref %i32 = array_index %ints.var, %.loc21_3.41 +// CHECK:STDOUT: %.loc21_3.43: init %i32 = initialize_from %.loc21_3.40 to %.loc21_3.42 [template = constants.%.41] +// CHECK:STDOUT: %.loc21_3.44: init %.3 = array_init (%.loc21_3.8, %.loc21_3.15, %.loc21_3.22, %.loc21_3.29, %.loc21_3.36, %.loc21_3.43) to %ints.var [template = constants.%array.1] +// CHECK:STDOUT: %.loc21_4: init %.3 = converted %.loc21_3.1, %.loc21_3.44 [template = constants.%array.1] // CHECK:STDOUT: assign %ints.var, %.loc21_4 // CHECK:STDOUT: %.loc22_16.1: Core.IntLiteral = int_value 64 [template = constants.%.43] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc22_16.1) [template = f64] -// CHECK:STDOUT: %.loc22_21: Core.IntLiteral = int_value 6 [template = constants.%.1] +// CHECK:STDOUT: %.loc22_21: Core.IntLiteral = int_value 6 [template = constants.%.2] // CHECK:STDOUT: %.loc22_16.2: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc22_16.3: type = converted %float.make_type, %.loc22_16.2 [template = f64] // CHECK:STDOUT: %.loc22_22: type = array_type %.loc22_21, f64 [template = constants.%.44] @@ -168,22 +180,22 @@ fn F() { // CHECK:STDOUT: %.loc27: f64 = float_literal 1.0E+8 [template = constants.%.50] // CHECK:STDOUT: %.loc28: f64 = float_literal 1.0E-8 [template = constants.%.51] // CHECK:STDOUT: %.loc29_3.1: %tuple.type.2 = tuple_literal (%.loc23, %.loc24, %.loc25, %.loc26, %.loc27, %.loc28) -// CHECK:STDOUT: %.loc29_3.2: i32 = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc29_3.2: Core.IntLiteral = int_value 0 [template = constants.%.8] // CHECK:STDOUT: %.loc29_3.3: ref f64 = array_index %floats.var, %.loc29_3.2 // CHECK:STDOUT: %.loc29_3.4: init f64 = initialize_from %.loc23 to %.loc29_3.3 [template = constants.%.46] -// CHECK:STDOUT: %.loc29_3.5: i32 = int_value 1 [template = constants.%.34] +// CHECK:STDOUT: %.loc29_3.5: Core.IntLiteral = int_value 1 [template = constants.%.32] // CHECK:STDOUT: %.loc29_3.6: ref f64 = array_index %floats.var, %.loc29_3.5 // CHECK:STDOUT: %.loc29_3.7: init f64 = initialize_from %.loc24 to %.loc29_3.6 [template = constants.%.47] -// CHECK:STDOUT: %.loc29_3.8: i32 = int_value 2 [template = constants.%.37] +// CHECK:STDOUT: %.loc29_3.8: Core.IntLiteral = int_value 2 [template = constants.%.36] // CHECK:STDOUT: %.loc29_3.9: ref f64 = array_index %floats.var, %.loc29_3.8 // CHECK:STDOUT: %.loc29_3.10: init f64 = initialize_from %.loc25 to %.loc29_3.9 [template = constants.%.48] -// CHECK:STDOUT: %.loc29_3.11: i32 = int_value 3 [template = constants.%.38] +// CHECK:STDOUT: %.loc29_3.11: Core.IntLiteral = int_value 3 [template = constants.%.37] // CHECK:STDOUT: %.loc29_3.12: ref f64 = array_index %floats.var, %.loc29_3.11 // CHECK:STDOUT: %.loc29_3.13: init f64 = initialize_from %.loc26 to %.loc29_3.12 [template = constants.%.49] -// CHECK:STDOUT: %.loc29_3.14: i32 = int_value 4 [template = constants.%.39] +// CHECK:STDOUT: %.loc29_3.14: Core.IntLiteral = int_value 4 [template = constants.%.38] // CHECK:STDOUT: %.loc29_3.15: ref f64 = array_index %floats.var, %.loc29_3.14 // CHECK:STDOUT: %.loc29_3.16: init f64 = initialize_from %.loc27 to %.loc29_3.15 [template = constants.%.50] -// CHECK:STDOUT: %.loc29_3.17: i32 = int_value 5 [template = constants.%.42] +// CHECK:STDOUT: %.loc29_3.17: Core.IntLiteral = int_value 5 [template = constants.%.42] // CHECK:STDOUT: %.loc29_3.18: ref f64 = array_index %floats.var, %.loc29_3.17 // CHECK:STDOUT: %.loc29_3.19: init f64 = initialize_from %.loc28 to %.loc29_3.18 [template = constants.%.51] // CHECK:STDOUT: %.loc29_3.20: init %.44 = array_init (%.loc29_3.4, %.loc29_3.7, %.loc29_3.10, %.loc29_3.13, %.loc29_3.16, %.loc29_3.19) to %floats.var [template = constants.%array.2] diff --git a/toolchain/check/testdata/basics/parens.carbon b/toolchain/check/testdata/basics/parens.carbon index 6650a2785cee..66f579619964 100644 --- a/toolchain/check/testdata/basics/parens.carbon +++ b/toolchain/check/testdata/basics/parens.carbon @@ -14,23 +14,27 @@ var b: i32 = ((2)); // CHECK:STDOUT: --- parens.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.27: = bound_method %.26, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -44,32 +48,36 @@ var b: i32 = ((2)); // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_32.loc11, %.loc11_8.1 [template = i32] -// CHECK:STDOUT: %a.var: ref i32 = var a -// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc11_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_8.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_8.3: type = converted %int.make_type_signed.loc11, %.loc11_8.2 [template = constants.%i32] +// CHECK:STDOUT: %a.var: ref %i32 = var a +// CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var +// CHECK:STDOUT: %.loc12_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.3: type = converted %int.make_type_signed.loc12, %.loc12_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_15: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_17.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_17.2: = bound_method %.loc11_15, %.loc11_17.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc11: init i32 = call %.loc11_17.2(%.loc11_15) [template = constants.%.27] -// CHECK:STDOUT: %.loc11_17.3: init i32 = converted %.loc11_15, %int.convert_checked.loc11 [template = constants.%.27] -// CHECK:STDOUT: assign file.%a.var, %.loc11_17.3 -// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 2 [template = constants.%.28] -// CHECK:STDOUT: %.loc12_19.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_19.2: = bound_method %.loc12_16, %.loc12_19.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc12: init i32 = call %.loc12_19.2(%.loc12_16) [template = constants.%.30] -// CHECK:STDOUT: %.loc12_19.3: init i32 = converted %.loc12_16, %int.convert_checked.loc12 [template = constants.%.30] -// CHECK:STDOUT: assign file.%b.var, %.loc12_19.3 +// CHECK:STDOUT: %.loc11_15: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_17.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_17.2: = bound_method %.loc11_15, %.loc11_17.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc11_17.3: = specific_function %.loc11_17.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %.loc11_17.3(%.loc11_15) [template = constants.%.25] +// CHECK:STDOUT: %.loc11_17.4: init %i32 = converted %.loc11_15, %int.convert_checked.loc11 [template = constants.%.25] +// CHECK:STDOUT: assign file.%a.var, %.loc11_17.4 +// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 2 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_19.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_19.2: = bound_method %.loc12_16, %.loc12_19.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_19.3: = specific_function %.loc12_19.2, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %.loc12_19.3(%.loc12_16) [template = constants.%.29] +// CHECK:STDOUT: %.loc12_19.4: init %i32 = converted %.loc12_16, %int.convert_checked.loc12 [template = constants.%.29] +// CHECK:STDOUT: assign file.%b.var, %.loc12_19.4 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/run_i32.carbon b/toolchain/check/testdata/basics/run_i32.carbon index 20e87caf2fba..e072278424c9 100644 --- a/toolchain/check/testdata/basics/run_i32.carbon +++ b/toolchain/check/testdata/basics/run_i32.carbon @@ -13,22 +13,25 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: --- run_i32.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -42,25 +45,27 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32, %.loc11_13.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.3: type = converted %int.make_type_signed, %.loc11_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Run() -> i32 { +// CHECK:STDOUT: fn @Run() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.2: = bound_method %.loc11_26, %.loc11_27.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc11_27.2(%.loc11_26) [template = constants.%.27] -// CHECK:STDOUT: %.loc11_27.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc11_27.4: i32 = converted %.loc11_26, %.loc11_27.3 [template = constants.%.27] -// CHECK:STDOUT: return %.loc11_27.4 +// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.2: = bound_method %.loc11_26, %.loc11_27.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc11_27.3: = specific_function %.loc11_27.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc11_27.3(%.loc11_26) [template = constants.%.25] +// CHECK:STDOUT: %.loc11_27.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc11_27.5: %i32 = converted %.loc11_26, %.loc11_27.4 [template = constants.%.25] +// CHECK:STDOUT: return %.loc11_27.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/type_literals.carbon b/toolchain/check/testdata/basics/type_literals.carbon index 120976a29502..dde728d9f1de 100644 --- a/toolchain/check/testdata/basics/type_literals.carbon +++ b/toolchain/check/testdata/basics/type_literals.carbon @@ -125,11 +125,11 @@ var test_f128: f128; // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 8 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = int_type signed, %.1 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %.4: type = int_type signed, %.3 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %.6: type = int_type signed, %.5 [template] +// CHECK:STDOUT: %i8: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 16 [template] +// CHECK:STDOUT: %i16: type = int_type signed, %.2 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %i64: type = int_type signed, %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -149,23 +149,23 @@ var test_f128: f128; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc3_14.1: Core.IntLiteral = int_value 8 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_signed.loc3: init type = call constants.%Int(%.loc3_14.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc3_14.2: type = value_of_initializer %int.make_type_signed.loc3 [template = constants.%.2] -// CHECK:STDOUT: %.loc3_14.3: type = converted %int.make_type_signed.loc3, %.loc3_14.2 [template = constants.%.2] -// CHECK:STDOUT: %test_i8.var: ref %.2 = var test_i8 -// CHECK:STDOUT: %test_i8: ref %.2 = bind_name test_i8, %test_i8.var -// CHECK:STDOUT: %.loc4_15.1: Core.IntLiteral = int_value 16 [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_15.1) [template = constants.%.4] -// CHECK:STDOUT: %.loc4_15.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%.4] -// CHECK:STDOUT: %.loc4_15.3: type = converted %int.make_type_signed.loc4, %.loc4_15.2 [template = constants.%.4] -// CHECK:STDOUT: %test_i16.var: ref %.4 = var test_i16 -// CHECK:STDOUT: %test_i16: ref %.4 = bind_name test_i16, %test_i16.var -// CHECK:STDOUT: %.loc5_15.1: Core.IntLiteral = int_value 64 [template = constants.%.5] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_15.1) [template = constants.%.6] -// CHECK:STDOUT: %.loc5_15.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%.6] -// CHECK:STDOUT: %.loc5_15.3: type = converted %int.make_type_signed.loc5, %.loc5_15.2 [template = constants.%.6] -// CHECK:STDOUT: %test_i64.var: ref %.6 = var test_i64 -// CHECK:STDOUT: %test_i64: ref %.6 = bind_name test_i64, %test_i64.var +// CHECK:STDOUT: %int.make_type_signed.loc3: init type = call constants.%Int(%.loc3_14.1) [template = constants.%i8] +// CHECK:STDOUT: %.loc3_14.2: type = value_of_initializer %int.make_type_signed.loc3 [template = constants.%i8] +// CHECK:STDOUT: %.loc3_14.3: type = converted %int.make_type_signed.loc3, %.loc3_14.2 [template = constants.%i8] +// CHECK:STDOUT: %test_i8.var: ref %i8 = var test_i8 +// CHECK:STDOUT: %test_i8: ref %i8 = bind_name test_i8, %test_i8.var +// CHECK:STDOUT: %.loc4_15.1: Core.IntLiteral = int_value 16 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_15.1) [template = constants.%i16] +// CHECK:STDOUT: %.loc4_15.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i16] +// CHECK:STDOUT: %.loc4_15.3: type = converted %int.make_type_signed.loc4, %.loc4_15.2 [template = constants.%i16] +// CHECK:STDOUT: %test_i16.var: ref %i16 = var test_i16 +// CHECK:STDOUT: %test_i16: ref %i16 = bind_name test_i16, %test_i16.var +// CHECK:STDOUT: %.loc5_15.1: Core.IntLiteral = int_value 64 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_15.1) [template = constants.%i64] +// CHECK:STDOUT: %.loc5_15.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i64] +// CHECK:STDOUT: %.loc5_15.3: type = converted %int.make_type_signed.loc5, %.loc5_15.2 [template = constants.%i64] +// CHECK:STDOUT: %test_i64.var: ref %i64 = var test_i64 +// CHECK:STDOUT: %test_i64: ref %i64 = bind_name test_i64, %test_i64.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_iN_bad_width.carbon @@ -181,11 +181,11 @@ var test_f128: f128; // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 8 [template] // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = int_type unsigned, %.1 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %.4: type = int_type unsigned, %.3 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %.6: type = int_type unsigned, %.5 [template] +// CHECK:STDOUT: %u8: type = int_type unsigned, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 16 [template] +// CHECK:STDOUT: %u16: type = int_type unsigned, %.2 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %u64: type = int_type unsigned, %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -205,23 +205,23 @@ var test_f128: f128; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc3_14.1: Core.IntLiteral = int_value 8 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc3: init type = call constants.%UInt(%.loc3_14.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc3_14.2: type = value_of_initializer %int.make_type_unsigned.loc3 [template = constants.%.2] -// CHECK:STDOUT: %.loc3_14.3: type = converted %int.make_type_unsigned.loc3, %.loc3_14.2 [template = constants.%.2] -// CHECK:STDOUT: %test_u8.var: ref %.2 = var test_u8 -// CHECK:STDOUT: %test_u8: ref %.2 = bind_name test_u8, %test_u8.var -// CHECK:STDOUT: %.loc4_15.1: Core.IntLiteral = int_value 16 [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_unsigned.loc4: init type = call constants.%UInt(%.loc4_15.1) [template = constants.%.4] -// CHECK:STDOUT: %.loc4_15.2: type = value_of_initializer %int.make_type_unsigned.loc4 [template = constants.%.4] -// CHECK:STDOUT: %.loc4_15.3: type = converted %int.make_type_unsigned.loc4, %.loc4_15.2 [template = constants.%.4] -// CHECK:STDOUT: %test_u16.var: ref %.4 = var test_u16 -// CHECK:STDOUT: %test_u16: ref %.4 = bind_name test_u16, %test_u16.var -// CHECK:STDOUT: %.loc5_15.1: Core.IntLiteral = int_value 64 [template = constants.%.5] -// CHECK:STDOUT: %int.make_type_unsigned.loc5: init type = call constants.%UInt(%.loc5_15.1) [template = constants.%.6] -// CHECK:STDOUT: %.loc5_15.2: type = value_of_initializer %int.make_type_unsigned.loc5 [template = constants.%.6] -// CHECK:STDOUT: %.loc5_15.3: type = converted %int.make_type_unsigned.loc5, %.loc5_15.2 [template = constants.%.6] -// CHECK:STDOUT: %test_u64.var: ref %.6 = var test_u64 -// CHECK:STDOUT: %test_u64: ref %.6 = bind_name test_u64, %test_u64.var +// CHECK:STDOUT: %int.make_type_unsigned.loc3: init type = call constants.%UInt(%.loc3_14.1) [template = constants.%u8] +// CHECK:STDOUT: %.loc3_14.2: type = value_of_initializer %int.make_type_unsigned.loc3 [template = constants.%u8] +// CHECK:STDOUT: %.loc3_14.3: type = converted %int.make_type_unsigned.loc3, %.loc3_14.2 [template = constants.%u8] +// CHECK:STDOUT: %test_u8.var: ref %u8 = var test_u8 +// CHECK:STDOUT: %test_u8: ref %u8 = bind_name test_u8, %test_u8.var +// CHECK:STDOUT: %.loc4_15.1: Core.IntLiteral = int_value 16 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned.loc4: init type = call constants.%UInt(%.loc4_15.1) [template = constants.%u16] +// CHECK:STDOUT: %.loc4_15.2: type = value_of_initializer %int.make_type_unsigned.loc4 [template = constants.%u16] +// CHECK:STDOUT: %.loc4_15.3: type = converted %int.make_type_unsigned.loc4, %.loc4_15.2 [template = constants.%u16] +// CHECK:STDOUT: %test_u16.var: ref %u16 = var test_u16 +// CHECK:STDOUT: %test_u16: ref %u16 = bind_name test_u16, %test_u16.var +// CHECK:STDOUT: %.loc5_15.1: Core.IntLiteral = int_value 64 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_unsigned.loc5: init type = call constants.%UInt(%.loc5_15.1) [template = constants.%u64] +// CHECK:STDOUT: %.loc5_15.2: type = value_of_initializer %int.make_type_unsigned.loc5 [template = constants.%u64] +// CHECK:STDOUT: %.loc5_15.3: type = converted %int.make_type_unsigned.loc5, %.loc5_15.2 [template = constants.%u64] +// CHECK:STDOUT: %test_u64.var: ref %u64 = var test_u64 +// CHECK:STDOUT: %test_u64: ref %u64 = bind_name test_u64, %test_u64.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_uN_bad_width.carbon diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index 220ae20a9613..d327b3847f28 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -47,15 +47,17 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: --- types.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -68,47 +70,51 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Float.decl: %Float.type = fn_decl @Float [template = constants.%Float] { -// CHECK:STDOUT: %size.patt: i32 = binding_pattern size -// CHECK:STDOUT: %size.param_patt: i32 = value_param_pattern %size.patt, runtime_param0 +// CHECK:STDOUT: %size.patt: %i32 = binding_pattern size +// CHECK:STDOUT: %size.param_patt: %i32 = value_param_pattern %size.patt, runtime_param0 // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_16.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_16.2: type = converted %int.make_type_32, %.loc4_16.1 [template = i32] -// CHECK:STDOUT: %size.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %size: i32 = bind_name size, %size.param +// CHECK:STDOUT: %.loc4_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_16.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_16.3: type = converted %int.make_type_signed, %.loc4_16.2 [template = constants.%i32] +// CHECK:STDOUT: %size.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %size: %i32 = bind_name size, %size.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: %i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: --- use_types.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 64 [template] -// CHECK:STDOUT: %.28: f64 = float_literal 0 [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 64 [template] +// CHECK:STDOUT: %.26: f64 = float_literal 0 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %GetFloat.type: type = fn_type @GetFloat [template] // CHECK:STDOUT: %GetFloat: %GetFloat.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, inst+22, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, inst+29, loaded [template = constants.%Float] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Int32 = %import_ref.51 +// CHECK:STDOUT: .Int = %import_ref.38 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -124,39 +130,41 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%import_ref.1 [template = constants.%Float] -// CHECK:STDOUT: %.loc6_14.1: Core.IntLiteral = int_value 64 [template = constants.%.1] -// CHECK:STDOUT: %.loc6_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_14.3: = bound_method %.loc6_14.1, %.loc6_14.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc6_14.3(%.loc6_14.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc6_14.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc6_14.5: i32 = converted %.loc6_14.1, %.loc6_14.4 [template = constants.%.27] -// CHECK:STDOUT: %float.make_type: init type = call %Float.ref(%.loc6_14.5) [template = f64] +// CHECK:STDOUT: %.loc6_14.1: Core.IntLiteral = int_value 64 [template = constants.%.2] +// CHECK:STDOUT: %.loc6_14.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_14.3: = bound_method %.loc6_14.1, %.loc6_14.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc6_14.4: = specific_function %.loc6_14.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc6_14.4(%.loc6_14.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc6_14.5: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc6_14.6: %i32 = converted %.loc6_14.1, %.loc6_14.5 [template = constants.%.25] +// CHECK:STDOUT: %float.make_type: init type = call %Float.ref(%.loc6_14.6) [template = f64] // CHECK:STDOUT: %.loc6_16.1: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc6_16.2: type = converted %float.make_type, %.loc6_16.1 [template = f64] // CHECK:STDOUT: %f.var: ref f64 = var f // CHECK:STDOUT: %f: ref f64 = bind_name f, %f.var // CHECK:STDOUT: %GetFloat.decl: %GetFloat.type = fn_decl @GetFloat [template = constants.%GetFloat] { -// CHECK:STDOUT: %dyn_size.patt: i32 = binding_pattern dyn_size -// CHECK:STDOUT: %dyn_size.param_patt: i32 = value_param_pattern %dyn_size.patt, runtime_param0 +// CHECK:STDOUT: %dyn_size.patt: %i32 = binding_pattern dyn_size +// CHECK:STDOUT: %dyn_size.param_patt: %i32 = value_param_pattern %dyn_size.patt, runtime_param0 // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_23.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_23.2: type = converted %int.make_type_32, %.loc8_23.1 [template = i32] -// CHECK:STDOUT: %dyn_size.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %dyn_size: i32 = bind_name dyn_size, %dyn_size.param +// CHECK:STDOUT: %.loc8_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_23.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_23.3: type = converted %int.make_type_signed, %.loc8_23.2 [template = constants.%i32] +// CHECK:STDOUT: %dyn_size.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %dyn_size: %i32 = bind_name dyn_size, %dyn_size.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: %i32) -> type = "float.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @GetFloat(%dyn_size.param_patt: i32) -> type { +// CHECK:STDOUT: fn @GetFloat(%dyn_size.param_patt: %i32) -> type { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%import_ref.1 [template = constants.%Float] -// CHECK:STDOUT: %dyn_size.ref: i32 = name_ref dyn_size, %dyn_size +// CHECK:STDOUT: %dyn_size.ref: %i32 = name_ref dyn_size, %dyn_size // CHECK:STDOUT: %float.make_type: init type = call %Float.ref(%dyn_size.ref) // CHECK:STDOUT: %.loc9_25.1: type = value_of_initializer %float.make_type // CHECK:STDOUT: %.loc9_25.2: type = converted %float.make_type, %.loc9_25.1 @@ -165,7 +173,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc6: f64 = float_literal 0 [template = constants.%.28] +// CHECK:STDOUT: %.loc6: f64 = float_literal 0 [template = constants.%.26] // CHECK:STDOUT: assign file.%f.var, %.loc6 // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -176,24 +184,27 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 32 [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 64 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.22: = bound_method %.1, %Convert.14 [template] +// CHECK:STDOUT: %.23: = specific_function %.22, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.24: %i32 = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %.25: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %.26: = bound_method %.25, %Convert.14 [template] +// CHECK:STDOUT: %.27: = specific_function %.26, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.28: %i32 = int_value 64 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, inst+22, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, inst+29, loaded [template = constants.%Float] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Int32 = %import_ref.51 +// CHECK:STDOUT: .Int = %import_ref.38 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -211,24 +222,26 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Float.ref.loc10: %Float.type = name_ref Float, imports.%import_ref.1 [template = constants.%Float] // CHECK:STDOUT: %.loc10_26.1: Core.IntLiteral = int_value 32 [template = constants.%.1] -// CHECK:STDOUT: %.loc10_26.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_26.3: = bound_method %.loc10_26.1, %.loc10_26.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc10_26.3(%.loc10_26.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc10_26.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc10_26.5: i32 = converted %.loc10_26.1, %.loc10_26.4 [template = constants.%.27] -// CHECK:STDOUT: %float.make_type.loc10: init type = call %Float.ref.loc10(%.loc10_26.5) [template = ] +// CHECK:STDOUT: %.loc10_26.2: %Convert.type.2 = interface_witness_access constants.%.21, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_26.3: = bound_method %.loc10_26.1, %.loc10_26.2 [template = constants.%.22] +// CHECK:STDOUT: %.loc10_26.4: = specific_function %.loc10_26.3, @Convert.2(constants.%.1) [template = constants.%.23] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc10_26.4(%.loc10_26.1) [template = constants.%.24] +// CHECK:STDOUT: %.loc10_26.5: %i32 = value_of_initializer %int.convert_checked [template = constants.%.24] +// CHECK:STDOUT: %.loc10_26.6: %i32 = converted %.loc10_26.1, %.loc10_26.5 [template = constants.%.24] +// CHECK:STDOUT: %float.make_type.loc10: init type = call %Float.ref.loc10(%.loc10_26.6) [template = ] // CHECK:STDOUT: %.loc10_28.1: type = value_of_initializer %float.make_type.loc10 [template = ] // CHECK:STDOUT: %.loc10_28.2: type = converted %float.make_type.loc10, %.loc10_28.1 [template = ] // CHECK:STDOUT: %invalid_float.var: ref = var invalid_float // CHECK:STDOUT: %invalid_float: ref = bind_name invalid_float, %invalid_float.var -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_15.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_15.2: type = converted %int.make_type_32, %.loc12_15.1 [template = i32] -// CHECK:STDOUT: %dyn_size.var: ref i32 = var dyn_size -// CHECK:STDOUT: %dyn_size: ref i32 = bind_name dyn_size, %dyn_size.var +// CHECK:STDOUT: %.loc12_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_15.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_15.3: type = converted %int.make_type_signed, %.loc12_15.2 [template = constants.%i32] +// CHECK:STDOUT: %dyn_size.var: ref %i32 = var dyn_size +// CHECK:STDOUT: %dyn_size: ref %i32 = bind_name dyn_size, %dyn_size.var // CHECK:STDOUT: %Float.ref.loc16: %Float.type = name_ref Float, imports.%import_ref.1 [template = constants.%Float] -// CHECK:STDOUT: %dyn_size.ref: ref i32 = name_ref dyn_size, %dyn_size -// CHECK:STDOUT: %.loc16_16: i32 = bind_value %dyn_size.ref +// CHECK:STDOUT: %dyn_size.ref: ref %i32 = name_ref dyn_size, %dyn_size +// CHECK:STDOUT: %.loc16_16: %i32 = bind_value %dyn_size.ref // CHECK:STDOUT: %float.make_type.loc16: init type = call %Float.ref.loc16(%.loc16_16) // CHECK:STDOUT: %.loc16_24.1: type = value_of_initializer %float.make_type.loc16 // CHECK:STDOUT: %.loc16_24.2: type = converted %float.make_type.loc16, %.loc16_24.1 @@ -236,16 +249,17 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %dyn: ref = bind_name dyn, %dyn.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Float(%size.param_patt: i32) -> type = "float.make_type"; +// CHECK:STDOUT: fn @Float(%size.param_patt: %i32) -> type = "float.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_21: Core.IntLiteral = int_value 64 [template = constants.%.28] -// CHECK:STDOUT: %.loc12_23.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_23.2: = bound_method %.loc12_21, %.loc12_23.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_23.2(%.loc12_21) [template = constants.%.30] -// CHECK:STDOUT: %.loc12_23.3: init i32 = converted %.loc12_21, %int.convert_checked [template = constants.%.30] -// CHECK:STDOUT: assign file.%dyn_size.var, %.loc12_23.3 +// CHECK:STDOUT: %.loc12_21: Core.IntLiteral = int_value 64 [template = constants.%.25] +// CHECK:STDOUT: %.loc12_23.1: %Convert.type.2 = interface_witness_access constants.%.21, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_23.2: = bound_method %.loc12_21, %.loc12_23.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_23.3: = specific_function %.loc12_23.2, @Convert.2(constants.%.1) [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc12_23.3(%.loc12_21) [template = constants.%.28] +// CHECK:STDOUT: %.loc12_23.4: init %i32 = converted %.loc12_21, %int.convert_checked [template = constants.%.28] +// CHECK:STDOUT: assign file.%dyn_size.var, %.loc12_23.4 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/and.carbon b/toolchain/check/testdata/builtins/int/and.carbon index 88193c05d6c2..ad74a9b3c60e 100644 --- a/toolchain/check/testdata/builtins/int/and.carbon +++ b/toolchain/check/testdata/builtins/int/and.carbon @@ -22,28 +22,33 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: --- int_and.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %And.type: type = fn_type @And [template] // CHECK:STDOUT: %And: %And.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 10 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 10 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 12 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 10 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 8 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 12 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 10 [template] -// CHECK:STDOUT: %.31: i32 = int_value 8 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.16 [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.15 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.4(%.1) [template] // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 8 [template] -// CHECK:STDOUT: %.35: type = array_type %.34, i32 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, %i32 [template] // CHECK:STDOUT: %.36: type = ptr_type %.35 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] @@ -51,7 +56,7 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -68,98 +73,109 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %And.decl: %And.type = fn_decl @And [template = constants.%And] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%.loc2_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.3: type = converted %int.make_type_signed.loc2_11, %.loc2_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%.loc2_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.3: type = converted %int.make_type_signed.loc2_19, %.loc2_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%.loc2_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.2: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.3: type = converted %int.make_type_signed.loc2_27, %.loc2_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %And.ref: %And.type = name_ref And, %And.decl [template = constants.%And] -// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 12 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_24.1: Core.IntLiteral = int_value 10 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init i32 = call %.loc4_20.3(%.loc4_20.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.4: i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.5: i32 = converted %.loc4_20.1, %.loc4_20.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_24.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_24.3: = bound_method %.loc4_24.1, %.loc4_24.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc4_24: init i32 = call %.loc4_24.3(%.loc4_24.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc4_24.4: i32 = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_24.5: i32 = converted %.loc4_24.1, %.loc4_24.4 [template = constants.%.30] -// CHECK:STDOUT: %int.and: init i32 = call %And.ref(%.loc4_20.5, %.loc4_24.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_19.1: %Convert.type.5 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.and, %.loc4_19.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.and [template = constants.%.31] -// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.and, %.loc4_19.3 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.and, %.loc4_19.5 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_27: type = array_type %.loc4_19.6, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 12 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_24.1: Core.IntLiteral = int_value 10 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_20.4: = specific_function %.loc4_20.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %.loc4_20.4(%.loc4_20.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.5: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.6: %i32 = converted %.loc4_20.1, %.loc4_20.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_24.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_24.3: = bound_method %.loc4_24.1, %.loc4_24.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_24.4: = specific_function %.loc4_24.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc4_24: init %i32 = call %.loc4_24.4(%.loc4_24.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_24.5: %i32 = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_24.6: %i32 = converted %.loc4_24.1, %.loc4_24.5 [template = constants.%.29] +// CHECK:STDOUT: %int.and: init %i32 = call %And.ref(%.loc4_20.6, %.loc4_24.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.6 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.and, %.loc4_19.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc4_19.3: = specific_function %.loc4_19.2, @Convert.4(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc4_19.4: %i32 = value_of_initializer %int.and [template = constants.%.30] +// CHECK:STDOUT: %.loc4_19.5: %i32 = converted %int.and, %.loc4_19.4 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.3(%.loc4_19.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.7: Core.IntLiteral = converted %int.and, %.loc4_19.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_27: type = array_type %.loc4_19.7, %i32 [template = constants.%.35] // CHECK:STDOUT: %arr.var: ref %.35 = var arr // CHECK:STDOUT: %arr: ref %.35 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_13.1) [template = constants.%i32] // CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 8 [template = constants.%.34] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_13.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_13.3: type = converted %int.make_type_signed.loc5, %.loc5_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, %i32 [template = constants.%.35] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.35 [template = constants.%.36] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.3: type = converted %int.make_type_signed.loc7_19, %.loc7_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%.loc7_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.3: type = converted %int.make_type_signed.loc7_27, %.loc7_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%.loc7_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.3: type = converted %int.make_type_signed.loc7_35, %.loc7_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @And(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.and"; +// CHECK:STDOUT: fn @And(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.and"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %And.ref: %And.type = name_ref And, file.%And.decl [template = constants.%And] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %int.and: init i32 = call %And.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: i32 = value_of_initializer %int.and -// CHECK:STDOUT: %.loc8_19.2: i32 = converted %int.and, %.loc8_19.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %int.and: init %i32 = call %And.ref(%a.ref, %b.ref) +// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.and +// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.and, %.loc8_19.1 // CHECK:STDOUT: return %.loc8_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/complement.carbon b/toolchain/check/testdata/builtins/int/complement.carbon index 7c10187bab33..26c301d57fc2 100644 --- a/toolchain/check/testdata/builtins/int/complement.carbon +++ b/toolchain/check/testdata/builtins/int/complement.carbon @@ -23,31 +23,36 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: --- int_complement.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Complement.type: type = fn_type @Complement [template] // CHECK:STDOUT: %Complement: %Complement.type = struct_value () [template] // CHECK:STDOUT: %And.type: type = fn_type @And [template] // CHECK:STDOUT: %And: %And.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1193046 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1193046 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1193046 [template] +// CHECK:STDOUT: %.26: %i32 = int_value -1193047 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 16777215 [template] +// CHECK:STDOUT: %.28: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 16777215 [template] +// CHECK:STDOUT: %.31: %i32 = int_value 15584169 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1193046 [template] -// CHECK:STDOUT: %.28: i32 = int_value -1193047 [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 16777215 [template] -// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 16777215 [template] -// CHECK:STDOUT: %.32: i32 = int_value 15584169 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.33: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.34: = bound_method %.32, %Convert.16 [template] +// CHECK:STDOUT: %.32: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.15 [template] +// CHECK:STDOUT: %.34: = specific_function %.33, @Convert.4(%.1) [template] // CHECK:STDOUT: %.35: Core.IntLiteral = int_value 15584169 [template] -// CHECK:STDOUT: %.36: type = array_type %.35, i32 [template] +// CHECK:STDOUT: %.36: type = array_type %.35, %i32 [template] // CHECK:STDOUT: %.37: type = ptr_type %.36 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] @@ -55,7 +60,7 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -73,113 +78,125 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Complement.decl: %Complement.type = fn_decl @Complement [template = constants.%Complement] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %int.make_type_32.loc2_18 [template = i32] -// CHECK:STDOUT: %.loc2_18.2: type = converted %int.make_type_32.loc2_18, %.loc2_18.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_26: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %int.make_type_32.loc2_26 [template = i32] -// CHECK:STDOUT: %.loc2_26.2: type = converted %int.make_type_32.loc2_26, %.loc2_26.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_18: init type = call constants.%Int(%.loc2_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_18.2: type = value_of_initializer %int.make_type_signed.loc2_18 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_18.3: type = converted %int.make_type_signed.loc2_18, %.loc2_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_26.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_26: init type = call constants.%Int(%.loc2_26.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_26.2: type = value_of_initializer %int.make_type_signed.loc2_26 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_26.3: type = converted %int.make_type_signed.loc2_26, %.loc2_26.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %And.decl: %And.type = fn_decl @And [template = constants.%And] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc3_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc3_11.1: type = value_of_initializer %int.make_type_32.loc3_11 [template = i32] -// CHECK:STDOUT: %.loc3_11.2: type = converted %int.make_type_32.loc3_11, %.loc3_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc3_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc3_19.1: type = value_of_initializer %int.make_type_32.loc3_19 [template = i32] -// CHECK:STDOUT: %.loc3_19.2: type = converted %int.make_type_32.loc3_19, %.loc3_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc3_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc3_27.1: type = value_of_initializer %int.make_type_32.loc3_27 [template = i32] -// CHECK:STDOUT: %.loc3_27.2: type = converted %int.make_type_32.loc3_27, %.loc3_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc3_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc3_11: init type = call constants.%Int(%.loc3_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc3_11.2: type = value_of_initializer %int.make_type_signed.loc3_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_11.3: type = converted %int.make_type_signed.loc3_11, %.loc3_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc3_19: init type = call constants.%Int(%.loc3_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc3_19.2: type = value_of_initializer %int.make_type_signed.loc3_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_19.3: type = converted %int.make_type_signed.loc3_19, %.loc3_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc3_27: init type = call constants.%Int(%.loc3_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc3_27.2: type = value_of_initializer %int.make_type_signed.loc3_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_27.3: type = converted %int.make_type_signed.loc3_27, %.loc3_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_11.1) [template = constants.%i32] // CHECK:STDOUT: %And.ref: %And.type = name_ref And, %And.decl [template = constants.%And] // CHECK:STDOUT: %Complement.ref: %Complement.type = name_ref Complement, %Complement.decl [template = constants.%Complement] -// CHECK:STDOUT: %.loc5_31.1: Core.IntLiteral = int_value 1193046 [template = constants.%.1] -// CHECK:STDOUT: %.loc5_31.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc5_31.3: = bound_method %.loc5_31.1, %.loc5_31.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc5_31: init i32 = call %.loc5_31.3(%.loc5_31.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc5_31.4: i32 = value_of_initializer %int.convert_checked.loc5_31 [template = constants.%.27] -// CHECK:STDOUT: %.loc5_31.5: i32 = converted %.loc5_31.1, %.loc5_31.4 [template = constants.%.27] -// CHECK:STDOUT: %int.complement: init i32 = call %Complement.ref(%.loc5_31.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc5_42.1: Core.IntLiteral = int_value 16777215 [template = constants.%.29] -// CHECK:STDOUT: %.loc5_30.1: i32 = value_of_initializer %int.complement [template = constants.%.28] -// CHECK:STDOUT: %.loc5_30.2: i32 = converted %int.complement, %.loc5_30.1 [template = constants.%.28] -// CHECK:STDOUT: %.loc5_42.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc5_42.3: = bound_method %.loc5_42.1, %.loc5_42.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc5_42: init i32 = call %.loc5_42.3(%.loc5_42.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc5_42.4: i32 = value_of_initializer %int.convert_checked.loc5_42 [template = constants.%.31] -// CHECK:STDOUT: %.loc5_42.5: i32 = converted %.loc5_42.1, %.loc5_42.4 [template = constants.%.31] -// CHECK:STDOUT: %int.and: init i32 = call %And.ref(%.loc5_30.2, %.loc5_42.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_32.loc5, %.loc5_11.1 [template = i32] -// CHECK:STDOUT: %.loc5_19.1: %Convert.type.5 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc5_19.2: = bound_method %int.and, %.loc5_19.1 [template = constants.%.34] -// CHECK:STDOUT: %.loc5_19.3: i32 = value_of_initializer %int.and [template = constants.%.32] -// CHECK:STDOUT: %.loc5_19.4: i32 = converted %int.and, %.loc5_19.3 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc5_19: init Core.IntLiteral = call %.loc5_19.2(%.loc5_19.4) [template = constants.%.35] -// CHECK:STDOUT: %.loc5_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5_19 [template = constants.%.35] -// CHECK:STDOUT: %.loc5_19.6: Core.IntLiteral = converted %int.and, %.loc5_19.5 [template = constants.%.35] -// CHECK:STDOUT: %.loc5_51: type = array_type %.loc5_19.6, i32 [template = constants.%.36] +// CHECK:STDOUT: %.loc5_31.1: Core.IntLiteral = int_value 1193046 [template = constants.%.2] +// CHECK:STDOUT: %.loc5_31.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc5_31.3: = bound_method %.loc5_31.1, %.loc5_31.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc5_31.4: = specific_function %.loc5_31.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc5_31: init %i32 = call %.loc5_31.4(%.loc5_31.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc5_31.5: %i32 = value_of_initializer %int.convert_checked.loc5_31 [template = constants.%.25] +// CHECK:STDOUT: %.loc5_31.6: %i32 = converted %.loc5_31.1, %.loc5_31.5 [template = constants.%.25] +// CHECK:STDOUT: %int.complement: init %i32 = call %Complement.ref(%.loc5_31.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc5_42.1: Core.IntLiteral = int_value 16777215 [template = constants.%.27] +// CHECK:STDOUT: %.loc5_30.1: %i32 = value_of_initializer %int.complement [template = constants.%.26] +// CHECK:STDOUT: %.loc5_30.2: %i32 = converted %int.complement, %.loc5_30.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc5_42.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc5_42.3: = bound_method %.loc5_42.1, %.loc5_42.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc5_42.4: = specific_function %.loc5_42.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc5_42: init %i32 = call %.loc5_42.4(%.loc5_42.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc5_42.5: %i32 = value_of_initializer %int.convert_checked.loc5_42 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_42.6: %i32 = converted %.loc5_42.1, %.loc5_42.5 [template = constants.%.30] +// CHECK:STDOUT: %int.and: init %i32 = call %And.ref(%.loc5_30.2, %.loc5_42.6) [template = constants.%.31] +// CHECK:STDOUT: %.loc5_11.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_11.3: type = converted %int.make_type_signed.loc5, %.loc5_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.1: %Convert.type.6 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc5_19.2: = bound_method %int.and, %.loc5_19.1 [template = constants.%.33] +// CHECK:STDOUT: %.loc5_19.3: = specific_function %.loc5_19.2, @Convert.4(constants.%.1) [template = constants.%.34] +// CHECK:STDOUT: %.loc5_19.4: %i32 = value_of_initializer %int.and [template = constants.%.31] +// CHECK:STDOUT: %.loc5_19.5: %i32 = converted %int.and, %.loc5_19.4 [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc5_19: init Core.IntLiteral = call %.loc5_19.3(%.loc5_19.5) [template = constants.%.35] +// CHECK:STDOUT: %.loc5_19.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5_19 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_19.7: Core.IntLiteral = converted %int.and, %.loc5_19.6 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_51: type = array_type %.loc5_19.7, %i32 [template = constants.%.36] // CHECK:STDOUT: %arr.var: ref %.36 = var arr // CHECK:STDOUT: %arr: ref %.36 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc6_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_13.1) [template = constants.%i32] // CHECK:STDOUT: %.loc6_18: Core.IntLiteral = int_value 15584169 [template = constants.%.35] -// CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_13.2: type = converted %int.make_type_32.loc6, %.loc6_13.1 [template = i32] -// CHECK:STDOUT: %.loc6_26: type = array_type %.loc6_18, i32 [template = constants.%.36] +// CHECK:STDOUT: %.loc6_13.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_13.3: type = converted %int.make_type_signed.loc6, %.loc6_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_26: type = array_type %.loc6_18, %i32 [template = constants.%.36] // CHECK:STDOUT: %.loc6_27: type = ptr_type %.36 [template = constants.%.37] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc8_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_19.1: type = value_of_initializer %int.make_type_32.loc8_19 [template = i32] -// CHECK:STDOUT: %.loc8_19.2: type = converted %int.make_type_32.loc8_19, %.loc8_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc8_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_27.1: type = value_of_initializer %int.make_type_32.loc8_27 [template = i32] -// CHECK:STDOUT: %.loc8_27.2: type = converted %int.make_type_32.loc8_27, %.loc8_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc8_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8_19: init type = call constants.%Int(%.loc8_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_19.2: type = value_of_initializer %int.make_type_signed.loc8_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_19.3: type = converted %int.make_type_signed.loc8_19, %.loc8_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8_27: init type = call constants.%Int(%.loc8_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_27.2: type = value_of_initializer %int.make_type_signed.loc8_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_27.3: type = converted %int.make_type_signed.loc8_27, %.loc8_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Complement(%a.param_patt: i32) -> i32 = "int.complement"; +// CHECK:STDOUT: fn @Complement(%a.param_patt: %i32) -> %i32 = "int.complement"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @And(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.and"; +// CHECK:STDOUT: fn @And(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.and"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Complement.ref: %Complement.type = name_ref Complement, file.%Complement.decl [template = constants.%Complement] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %int.complement: init i32 = call %Complement.ref(%a.ref) -// CHECK:STDOUT: %.loc9_23.1: i32 = value_of_initializer %int.complement -// CHECK:STDOUT: %.loc9_23.2: i32 = converted %int.complement, %.loc9_23.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %int.complement: init %i32 = call %Complement.ref(%a.ref) +// CHECK:STDOUT: %.loc9_23.1: %i32 = value_of_initializer %int.complement +// CHECK:STDOUT: %.loc9_23.2: %i32 = converted %int.complement, %.loc9_23.1 // CHECK:STDOUT: return %.loc9_23.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/convert_checked.carbon b/toolchain/check/testdata/builtins/int/convert_checked.carbon index d4099c4a795a..2bd870cef5bb 100644 --- a/toolchain/check/testdata/builtins/int/convert_checked.carbon +++ b/toolchain/check/testdata/builtins/int/convert_checked.carbon @@ -251,16 +251,17 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: --- int_ops.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %NegateI32.type: type = fn_type @NegateI32 [template] // CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template] // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template] // CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = int_type unsigned, %.1 [template] +// CHECK:STDOUT: %u32: type = int_type unsigned, %.1 [template] // CHECK:STDOUT: %AddU32.type: type = fn_type @AddU32 [template] // CHECK:STDOUT: %AddU32: %AddU32.type = struct_value () [template] // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] @@ -275,13 +276,11 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToUint32: %Uint32ToUint32.type = struct_value () [template] // CHECK:STDOUT: %IntLiteralToIntLiteral.type: type = fn_type @IntLiteralToIntLiteral [template] // CHECK:STDOUT: %IntLiteralToIntLiteral: %IntLiteralToIntLiteral.type = struct_value () [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = int_type signed, %.3 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 16 [template] +// CHECK:STDOUT: %i16: type = int_type signed, %.2 [template] // CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template] // CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = int_type unsigned, %.3 [template] +// CHECK:STDOUT: %u16: type = int_type unsigned, %.2 [template] // CHECK:STDOUT: %Int32ToUint16.type: type = fn_type @Int32ToUint16 [template] // CHECK:STDOUT: %Int32ToUint16: %Int32ToUint16.type = struct_value () [template] // CHECK:STDOUT: %Uint32ToInt16.type: type = fn_type @Uint32ToInt16 [template] @@ -292,11 +291,11 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %IntLiteralToInt16: %IntLiteralToInt16.type = struct_value () [template] // CHECK:STDOUT: %IntLiteralToUint16.type: type = fn_type @IntLiteralToUint16 [template] // CHECK:STDOUT: %IntLiteralToUint16: %IntLiteralToUint16.type = struct_value () [template] -// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %.7: type = int_type signed, %.6 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %i64: type = int_type signed, %.3 [template] // CHECK:STDOUT: %Int32ToInt64.type: type = fn_type @Int32ToInt64 [template] // CHECK:STDOUT: %Int32ToInt64: %Int32ToInt64.type = struct_value () [template] -// CHECK:STDOUT: %.8: type = int_type unsigned, %.6 [template] +// CHECK:STDOUT: %u64: type = int_type unsigned, %.3 [template] // CHECK:STDOUT: %Int32ToUint64.type: type = fn_type @Int32ToUint64 [template] // CHECK:STDOUT: %Int32ToUint64: %Int32ToUint64.type = struct_value () [template] // CHECK:STDOUT: %Uint32ToInt64.type: type = fn_type @Uint32ToInt64 [template] @@ -311,9 +310,8 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .UInt = %import_ref.2 -// CHECK:STDOUT: .Int = %import_ref.3 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -346,72 +344,77 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NegateI32.decl: %NegateI32.type = fn_decl @NegateI32 [template = constants.%NegateI32] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_17.1: type = value_of_initializer %int.make_type_32.loc4_17 [template = i32] -// CHECK:STDOUT: %.loc4_17.2: type = converted %int.make_type_32.loc4_17, %.loc4_17.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_25.1: type = value_of_initializer %int.make_type_32.loc4_25 [template = i32] -// CHECK:STDOUT: %.loc4_25.2: type = converted %int.make_type_32.loc4_25, %.loc4_25.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_17: init type = call constants.%Int(%.loc4_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_17.2: type = value_of_initializer %int.make_type_signed.loc4_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_17.3: type = converted %int.make_type_signed.loc4_17, %.loc4_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_25: init type = call constants.%Int(%.loc4_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_25.2: type = value_of_initializer %int.make_type_signed.loc4_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_25.3: type = converted %int.make_type_signed.loc4_25, %.loc4_25.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %SubI32.decl: %SubI32.type = fn_decl @SubI32 [template = constants.%SubI32] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc5_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_14.1: type = value_of_initializer %int.make_type_32.loc5_14 [template = i32] -// CHECK:STDOUT: %.loc5_14.2: type = converted %int.make_type_32.loc5_14, %.loc5_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int.make_type_32.loc5_22 [template = i32] -// CHECK:STDOUT: %.loc5_22.2: type = converted %int.make_type_32.loc5_22, %.loc5_22.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_30: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_30.1: type = value_of_initializer %int.make_type_32.loc5_30 [template = i32] -// CHECK:STDOUT: %.loc5_30.2: type = converted %int.make_type_32.loc5_30, %.loc5_30.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc5_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_14: init type = call constants.%Int(%.loc5_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_14.2: type = value_of_initializer %int.make_type_signed.loc5_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_14.3: type = converted %int.make_type_signed.loc5_14, %.loc5_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_22: init type = call constants.%Int(%.loc5_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_22.2: type = value_of_initializer %int.make_type_signed.loc5_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_22.3: type = converted %int.make_type_signed.loc5_22, %.loc5_22.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_30.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_30: init type = call constants.%Int(%.loc5_30.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_30.2: type = value_of_initializer %int.make_type_signed.loc5_30 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_30.3: type = converted %int.make_type_signed.loc5_30, %.loc5_30.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %AddU32.decl: %AddU32.type = fn_decl @AddU32 [template = constants.%AddU32] { -// CHECK:STDOUT: %a.patt: %.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %.2 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %.2 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %.2 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %u32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %u32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc6_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc6_14: init type = call constants.%UInt(%.loc6_14.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_unsigned.loc6_14 [template = constants.%.2] -// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_unsigned.loc6_14, %.loc6_14.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned.loc6_14: init type = call constants.%UInt(%.loc6_14.1) [template = constants.%u32] +// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_unsigned.loc6_14 [template = constants.%u32] +// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_unsigned.loc6_14, %.loc6_14.2 [template = constants.%u32] // CHECK:STDOUT: %.loc6_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc6_22: init type = call constants.%UInt(%.loc6_22.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc6_22.2: type = value_of_initializer %int.make_type_unsigned.loc6_22 [template = constants.%.2] -// CHECK:STDOUT: %.loc6_22.3: type = converted %int.make_type_unsigned.loc6_22, %.loc6_22.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned.loc6_22: init type = call constants.%UInt(%.loc6_22.1) [template = constants.%u32] +// CHECK:STDOUT: %.loc6_22.2: type = value_of_initializer %int.make_type_unsigned.loc6_22 [template = constants.%u32] +// CHECK:STDOUT: %.loc6_22.3: type = converted %int.make_type_unsigned.loc6_22, %.loc6_22.2 [template = constants.%u32] // CHECK:STDOUT: %.loc6_30.1: Core.IntLiteral = int_value 32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc6_30: init type = call constants.%UInt(%.loc6_30.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc6_30.2: type = value_of_initializer %int.make_type_unsigned.loc6_30 [template = constants.%.2] -// CHECK:STDOUT: %.loc6_30.3: type = converted %int.make_type_unsigned.loc6_30, %.loc6_30.2 [template = constants.%.2] -// CHECK:STDOUT: %a.param: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %a: %.2 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %.2 = value_param runtime_param1 -// CHECK:STDOUT: %b: %.2 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param +// CHECK:STDOUT: %int.make_type_unsigned.loc6_30: init type = call constants.%UInt(%.loc6_30.1) [template = constants.%u32] +// CHECK:STDOUT: %.loc6_30.2: type = value_of_initializer %int.make_type_unsigned.loc6_30 [template = constants.%u32] +// CHECK:STDOUT: %.loc6_30.3: type = converted %int.make_type_unsigned.loc6_30, %.loc6_30.2 [template = constants.%u32] +// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %u32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %u32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %u32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] { // CHECK:STDOUT: %return.patt: type = return_slot_pattern @@ -421,76 +424,80 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return: ref type = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Int32ToInt32.decl: %Int32ToInt32.type = fn_decl @Int32ToInt32 [template = constants.%Int32ToInt32] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc10_20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_20.1: type = value_of_initializer %int.make_type_32.loc10_20 [template = i32] -// CHECK:STDOUT: %.loc10_20.2: type = converted %int.make_type_32.loc10_20, %.loc10_20.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc10_28: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_28.1: type = value_of_initializer %int.make_type_32.loc10_28 [template = i32] -// CHECK:STDOUT: %.loc10_28.2: type = converted %int.make_type_32.loc10_28, %.loc10_28.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc10_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc10_20: init type = call constants.%Int(%.loc10_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_20.2: type = value_of_initializer %int.make_type_signed.loc10_20 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_20.3: type = converted %int.make_type_signed.loc10_20, %.loc10_20.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_28.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc10_28: init type = call constants.%Int(%.loc10_28.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_28.2: type = value_of_initializer %int.make_type_signed.loc10_28 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_28.3: type = converted %int.make_type_signed.loc10_28, %.loc10_28.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Int32ToUint32.decl: %Int32ToUint32.type = fn_decl @Int32ToUint32 [template = constants.%Int32ToUint32] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_21.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_21.2: type = converted %int.make_type_32, %.loc11_21.1 [template = i32] +// CHECK:STDOUT: %.loc11_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_21.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_21.3: type = converted %int.make_type_signed, %.loc11_21.2 [template = constants.%i32] // CHECK:STDOUT: %.loc11_29.1: Core.IntLiteral = int_value 32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc11_29.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc11_29.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%.2] -// CHECK:STDOUT: %.loc11_29.3: type = converted %int.make_type_unsigned, %.loc11_29.2 [template = constants.%.2] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param +// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc11_29.1) [template = constants.%u32] +// CHECK:STDOUT: %.loc11_29.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%u32] +// CHECK:STDOUT: %.loc11_29.3: type = converted %int.make_type_unsigned, %.loc11_29.2 [template = constants.%u32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %u32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Uint32ToInt32.decl: %Uint32ToInt32.type = fn_decl @Uint32ToInt32 [template = constants.%Uint32ToInt32] { -// CHECK:STDOUT: %a.patt: %.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %.2 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc12_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc12_21.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc12_21.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%.2] -// CHECK:STDOUT: %.loc12_21.3: type = converted %int.make_type_unsigned, %.loc12_21.2 [template = constants.%.2] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_29.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_29.2: type = converted %int.make_type_32, %.loc12_29.1 [template = i32] -// CHECK:STDOUT: %a.param: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %a: %.2 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc12_21.1) [template = constants.%u32] +// CHECK:STDOUT: %.loc12_21.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%u32] +// CHECK:STDOUT: %.loc12_21.3: type = converted %int.make_type_unsigned, %.loc12_21.2 [template = constants.%u32] +// CHECK:STDOUT: %.loc12_29.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_29.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_29.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_29.3: type = converted %int.make_type_signed, %.loc12_29.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Uint32ToUint32.decl: %Uint32ToUint32.type = fn_decl @Uint32ToUint32 [template = constants.%Uint32ToUint32] { -// CHECK:STDOUT: %a.patt: %.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %.2 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc13_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc13_22: init type = call constants.%UInt(%.loc13_22.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc13_22.2: type = value_of_initializer %int.make_type_unsigned.loc13_22 [template = constants.%.2] -// CHECK:STDOUT: %.loc13_22.3: type = converted %int.make_type_unsigned.loc13_22, %.loc13_22.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned.loc13_22: init type = call constants.%UInt(%.loc13_22.1) [template = constants.%u32] +// CHECK:STDOUT: %.loc13_22.2: type = value_of_initializer %int.make_type_unsigned.loc13_22 [template = constants.%u32] +// CHECK:STDOUT: %.loc13_22.3: type = converted %int.make_type_unsigned.loc13_22, %.loc13_22.2 [template = constants.%u32] // CHECK:STDOUT: %.loc13_30.1: Core.IntLiteral = int_value 32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc13_30: init type = call constants.%UInt(%.loc13_30.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc13_30.2: type = value_of_initializer %int.make_type_unsigned.loc13_30 [template = constants.%.2] -// CHECK:STDOUT: %.loc13_30.3: type = converted %int.make_type_unsigned.loc13_30, %.loc13_30.2 [template = constants.%.2] -// CHECK:STDOUT: %a.param: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %a: %.2 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param +// CHECK:STDOUT: %int.make_type_unsigned.loc13_30: init type = call constants.%UInt(%.loc13_30.1) [template = constants.%u32] +// CHECK:STDOUT: %.loc13_30.2: type = value_of_initializer %int.make_type_unsigned.loc13_30 [template = constants.%u32] +// CHECK:STDOUT: %.loc13_30.3: type = converted %int.make_type_unsigned.loc13_30, %.loc13_30.2 [template = constants.%u32] +// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %u32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %IntLiteralToIntLiteral.decl: %IntLiteralToIntLiteral.type = fn_decl @IntLiteralToIntLiteral [template = constants.%IntLiteralToIntLiteral] { // CHECK:STDOUT: %a.patt: Core.IntLiteral = binding_pattern a @@ -512,332 +519,342 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Int32ToInt16.decl: %Int32ToInt16.type = fn_decl @Int32ToInt16 [template = constants.%Int32ToInt16] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.4 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.4 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i16 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc18_20.2: type = converted %int.make_type_32, %.loc18_20.1 [template = i32] -// CHECK:STDOUT: %.loc18_28.1: Core.IntLiteral = int_value 16 [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc18_28.1) [template = constants.%.4] -// CHECK:STDOUT: %.loc18_28.2: type = value_of_initializer %int.make_type_signed [template = constants.%.4] -// CHECK:STDOUT: %.loc18_28.3: type = converted %int.make_type_signed, %.loc18_28.2 [template = constants.%.4] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %.4 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.4 = return_slot %return.param +// CHECK:STDOUT: %.loc18_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18_20: init type = call constants.%Int(%.loc18_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_20.2: type = value_of_initializer %int.make_type_signed.loc18_20 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_20.3: type = converted %int.make_type_signed.loc18_20, %.loc18_20.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_28.1: Core.IntLiteral = int_value 16 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc18_28: init type = call constants.%Int(%.loc18_28.1) [template = constants.%i16] +// CHECK:STDOUT: %.loc18_28.2: type = value_of_initializer %int.make_type_signed.loc18_28 [template = constants.%i16] +// CHECK:STDOUT: %.loc18_28.3: type = converted %int.make_type_signed.loc18_28, %.loc18_28.2 [template = constants.%i16] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i16 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i16 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Int32ToUint16.decl: %Int32ToUint16.type = fn_decl @Int32ToUint16 [template = constants.%Int32ToUint16] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.5 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.5 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %u16 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %u16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_21.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc19_21.2: type = converted %int.make_type_32, %.loc19_21.1 [template = i32] -// CHECK:STDOUT: %.loc19_29.1: Core.IntLiteral = int_value 16 [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc19_29.1) [template = constants.%.5] -// CHECK:STDOUT: %.loc19_29.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%.5] -// CHECK:STDOUT: %.loc19_29.3: type = converted %int.make_type_unsigned, %.loc19_29.2 [template = constants.%.5] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %.5 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.5 = return_slot %return.param +// CHECK:STDOUT: %.loc19_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc19_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_21.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc19_21.3: type = converted %int.make_type_signed, %.loc19_21.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_29.1: Core.IntLiteral = int_value 16 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc19_29.1) [template = constants.%u16] +// CHECK:STDOUT: %.loc19_29.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%u16] +// CHECK:STDOUT: %.loc19_29.3: type = converted %int.make_type_unsigned, %.loc19_29.2 [template = constants.%u16] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %u16 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %u16 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Uint32ToInt16.decl: %Uint32ToInt16.type = fn_decl @Uint32ToInt16 [template = constants.%Uint32ToInt16] { -// CHECK:STDOUT: %a.patt: %.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %.2 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.4 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.4 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i16 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc20_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc20_21.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc20_21.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%.2] -// CHECK:STDOUT: %.loc20_21.3: type = converted %int.make_type_unsigned, %.loc20_21.2 [template = constants.%.2] -// CHECK:STDOUT: %.loc20_29.1: Core.IntLiteral = int_value 16 [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc20_29.1) [template = constants.%.4] -// CHECK:STDOUT: %.loc20_29.2: type = value_of_initializer %int.make_type_signed [template = constants.%.4] -// CHECK:STDOUT: %.loc20_29.3: type = converted %int.make_type_signed, %.loc20_29.2 [template = constants.%.4] -// CHECK:STDOUT: %a.param: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %a: %.2 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %.4 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.4 = return_slot %return.param +// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc20_21.1) [template = constants.%u32] +// CHECK:STDOUT: %.loc20_21.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%u32] +// CHECK:STDOUT: %.loc20_21.3: type = converted %int.make_type_unsigned, %.loc20_21.2 [template = constants.%u32] +// CHECK:STDOUT: %.loc20_29.1: Core.IntLiteral = int_value 16 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc20_29.1) [template = constants.%i16] +// CHECK:STDOUT: %.loc20_29.2: type = value_of_initializer %int.make_type_signed [template = constants.%i16] +// CHECK:STDOUT: %.loc20_29.3: type = converted %int.make_type_signed, %.loc20_29.2 [template = constants.%i16] +// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i16 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i16 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Uint32ToUint16.decl: %Uint32ToUint16.type = fn_decl @Uint32ToUint16 [template = constants.%Uint32ToUint16] { -// CHECK:STDOUT: %a.patt: %.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %.2 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.5 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.5 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %u16 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %u16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc21_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc21_22: init type = call constants.%UInt(%.loc21_22.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc21_22.2: type = value_of_initializer %int.make_type_unsigned.loc21_22 [template = constants.%.2] -// CHECK:STDOUT: %.loc21_22.3: type = converted %int.make_type_unsigned.loc21_22, %.loc21_22.2 [template = constants.%.2] -// CHECK:STDOUT: %.loc21_30.1: Core.IntLiteral = int_value 16 [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_unsigned.loc21_30: init type = call constants.%UInt(%.loc21_30.1) [template = constants.%.5] -// CHECK:STDOUT: %.loc21_30.2: type = value_of_initializer %int.make_type_unsigned.loc21_30 [template = constants.%.5] -// CHECK:STDOUT: %.loc21_30.3: type = converted %int.make_type_unsigned.loc21_30, %.loc21_30.2 [template = constants.%.5] -// CHECK:STDOUT: %a.param: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %a: %.2 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %.5 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.5 = return_slot %return.param +// CHECK:STDOUT: %int.make_type_unsigned.loc21_22: init type = call constants.%UInt(%.loc21_22.1) [template = constants.%u32] +// CHECK:STDOUT: %.loc21_22.2: type = value_of_initializer %int.make_type_unsigned.loc21_22 [template = constants.%u32] +// CHECK:STDOUT: %.loc21_22.3: type = converted %int.make_type_unsigned.loc21_22, %.loc21_22.2 [template = constants.%u32] +// CHECK:STDOUT: %.loc21_30.1: Core.IntLiteral = int_value 16 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned.loc21_30: init type = call constants.%UInt(%.loc21_30.1) [template = constants.%u16] +// CHECK:STDOUT: %.loc21_30.2: type = value_of_initializer %int.make_type_unsigned.loc21_30 [template = constants.%u16] +// CHECK:STDOUT: %.loc21_30.3: type = converted %int.make_type_unsigned.loc21_30, %.loc21_30.2 [template = constants.%u16] +// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %u16 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %u16 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %IntLiteralToInt16.decl: %IntLiteralToInt16.type = fn_decl @IntLiteralToInt16 [template = constants.%IntLiteralToInt16] { // CHECK:STDOUT: %a.patt: Core.IntLiteral = binding_pattern a // CHECK:STDOUT: %a.param_patt: Core.IntLiteral = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.4 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.4 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i16 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc22_36.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc22_36.2: type = converted %int_literal.make_type, %.loc22_36.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc22_42.1: Core.IntLiteral = int_value 16 [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc22_42.1) [template = constants.%.4] -// CHECK:STDOUT: %.loc22_42.2: type = value_of_initializer %int.make_type_signed [template = constants.%.4] -// CHECK:STDOUT: %.loc22_42.3: type = converted %int.make_type_signed, %.loc22_42.2 [template = constants.%.4] +// CHECK:STDOUT: %.loc22_42.1: Core.IntLiteral = int_value 16 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc22_42.1) [template = constants.%i16] +// CHECK:STDOUT: %.loc22_42.2: type = value_of_initializer %int.make_type_signed [template = constants.%i16] +// CHECK:STDOUT: %.loc22_42.3: type = converted %int.make_type_signed, %.loc22_42.2 [template = constants.%i16] // CHECK:STDOUT: %a.param: Core.IntLiteral = value_param runtime_param0 // CHECK:STDOUT: %a: Core.IntLiteral = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %.4 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.4 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i16 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i16 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %IntLiteralToUint16.decl: %IntLiteralToUint16.type = fn_decl @IntLiteralToUint16 [template = constants.%IntLiteralToUint16] { // CHECK:STDOUT: %a.patt: Core.IntLiteral = binding_pattern a // CHECK:STDOUT: %a.param_patt: Core.IntLiteral = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.5 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.5 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %u16 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %u16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc23_37.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc23_37.2: type = converted %int_literal.make_type, %.loc23_37.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc23_43.1: Core.IntLiteral = int_value 16 [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc23_43.1) [template = constants.%.5] -// CHECK:STDOUT: %.loc23_43.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%.5] -// CHECK:STDOUT: %.loc23_43.3: type = converted %int.make_type_unsigned, %.loc23_43.2 [template = constants.%.5] +// CHECK:STDOUT: %.loc23_43.1: Core.IntLiteral = int_value 16 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc23_43.1) [template = constants.%u16] +// CHECK:STDOUT: %.loc23_43.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%u16] +// CHECK:STDOUT: %.loc23_43.3: type = converted %int.make_type_unsigned, %.loc23_43.2 [template = constants.%u16] // CHECK:STDOUT: %a.param: Core.IntLiteral = value_param runtime_param0 // CHECK:STDOUT: %a: Core.IntLiteral = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %.5 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.5 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %u16 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %u16 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Int32ToInt64.decl: %Int32ToInt64.type = fn_decl @Int32ToInt64 [template = constants.%Int32ToInt64] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.7 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.7 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i64 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc26_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc26_20.2: type = converted %int.make_type_32, %.loc26_20.1 [template = i32] -// CHECK:STDOUT: %.loc26_28.1: Core.IntLiteral = int_value 64 [template = constants.%.6] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc26_28.1) [template = constants.%.7] -// CHECK:STDOUT: %.loc26_28.2: type = value_of_initializer %int.make_type_signed [template = constants.%.7] -// CHECK:STDOUT: %.loc26_28.3: type = converted %int.make_type_signed, %.loc26_28.2 [template = constants.%.7] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %.7 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.7 = return_slot %return.param +// CHECK:STDOUT: %.loc26_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc26_20: init type = call constants.%Int(%.loc26_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc26_20.2: type = value_of_initializer %int.make_type_signed.loc26_20 [template = constants.%i32] +// CHECK:STDOUT: %.loc26_20.3: type = converted %int.make_type_signed.loc26_20, %.loc26_20.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc26_28.1: Core.IntLiteral = int_value 64 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc26_28: init type = call constants.%Int(%.loc26_28.1) [template = constants.%i64] +// CHECK:STDOUT: %.loc26_28.2: type = value_of_initializer %int.make_type_signed.loc26_28 [template = constants.%i64] +// CHECK:STDOUT: %.loc26_28.3: type = converted %int.make_type_signed.loc26_28, %.loc26_28.2 [template = constants.%i64] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i64 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i64 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Int32ToUint64.decl: %Int32ToUint64.type = fn_decl @Int32ToUint64 [template = constants.%Int32ToUint64] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.8 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.8 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %u64 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %u64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc27_21.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc27_21.2: type = converted %int.make_type_32, %.loc27_21.1 [template = i32] -// CHECK:STDOUT: %.loc27_29.1: Core.IntLiteral = int_value 64 [template = constants.%.6] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc27_29.1) [template = constants.%.8] -// CHECK:STDOUT: %.loc27_29.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%.8] -// CHECK:STDOUT: %.loc27_29.3: type = converted %int.make_type_unsigned, %.loc27_29.2 [template = constants.%.8] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %.8 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.8 = return_slot %return.param +// CHECK:STDOUT: %.loc27_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc27_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc27_21.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc27_21.3: type = converted %int.make_type_signed, %.loc27_21.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc27_29.1: Core.IntLiteral = int_value 64 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc27_29.1) [template = constants.%u64] +// CHECK:STDOUT: %.loc27_29.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%u64] +// CHECK:STDOUT: %.loc27_29.3: type = converted %int.make_type_unsigned, %.loc27_29.2 [template = constants.%u64] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %u64 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %u64 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Uint32ToInt64.decl: %Uint32ToInt64.type = fn_decl @Uint32ToInt64 [template = constants.%Uint32ToInt64] { -// CHECK:STDOUT: %a.patt: %.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %.2 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.7 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.7 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i64 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc28_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc28_21.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc28_21.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%.2] -// CHECK:STDOUT: %.loc28_21.3: type = converted %int.make_type_unsigned, %.loc28_21.2 [template = constants.%.2] -// CHECK:STDOUT: %.loc28_29.1: Core.IntLiteral = int_value 64 [template = constants.%.6] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc28_29.1) [template = constants.%.7] -// CHECK:STDOUT: %.loc28_29.2: type = value_of_initializer %int.make_type_signed [template = constants.%.7] -// CHECK:STDOUT: %.loc28_29.3: type = converted %int.make_type_signed, %.loc28_29.2 [template = constants.%.7] -// CHECK:STDOUT: %a.param: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %a: %.2 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %.7 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.7 = return_slot %return.param +// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc28_21.1) [template = constants.%u32] +// CHECK:STDOUT: %.loc28_21.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%u32] +// CHECK:STDOUT: %.loc28_21.3: type = converted %int.make_type_unsigned, %.loc28_21.2 [template = constants.%u32] +// CHECK:STDOUT: %.loc28_29.1: Core.IntLiteral = int_value 64 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc28_29.1) [template = constants.%i64] +// CHECK:STDOUT: %.loc28_29.2: type = value_of_initializer %int.make_type_signed [template = constants.%i64] +// CHECK:STDOUT: %.loc28_29.3: type = converted %int.make_type_signed, %.loc28_29.2 [template = constants.%i64] +// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i64 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i64 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Uint32ToUint64.decl: %Uint32ToUint64.type = fn_decl @Uint32ToUint64 [template = constants.%Uint32ToUint64] { -// CHECK:STDOUT: %a.patt: %.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %.2 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.8 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.8 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %u64 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %u64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc29_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc29_22: init type = call constants.%UInt(%.loc29_22.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc29_22.2: type = value_of_initializer %int.make_type_unsigned.loc29_22 [template = constants.%.2] -// CHECK:STDOUT: %.loc29_22.3: type = converted %int.make_type_unsigned.loc29_22, %.loc29_22.2 [template = constants.%.2] -// CHECK:STDOUT: %.loc29_30.1: Core.IntLiteral = int_value 64 [template = constants.%.6] -// CHECK:STDOUT: %int.make_type_unsigned.loc29_30: init type = call constants.%UInt(%.loc29_30.1) [template = constants.%.8] -// CHECK:STDOUT: %.loc29_30.2: type = value_of_initializer %int.make_type_unsigned.loc29_30 [template = constants.%.8] -// CHECK:STDOUT: %.loc29_30.3: type = converted %int.make_type_unsigned.loc29_30, %.loc29_30.2 [template = constants.%.8] -// CHECK:STDOUT: %a.param: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %a: %.2 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %.8 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.8 = return_slot %return.param +// CHECK:STDOUT: %int.make_type_unsigned.loc29_22: init type = call constants.%UInt(%.loc29_22.1) [template = constants.%u32] +// CHECK:STDOUT: %.loc29_22.2: type = value_of_initializer %int.make_type_unsigned.loc29_22 [template = constants.%u32] +// CHECK:STDOUT: %.loc29_22.3: type = converted %int.make_type_unsigned.loc29_22, %.loc29_22.2 [template = constants.%u32] +// CHECK:STDOUT: %.loc29_30.1: Core.IntLiteral = int_value 64 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_unsigned.loc29_30: init type = call constants.%UInt(%.loc29_30.1) [template = constants.%u64] +// CHECK:STDOUT: %.loc29_30.2: type = value_of_initializer %int.make_type_unsigned.loc29_30 [template = constants.%u64] +// CHECK:STDOUT: %.loc29_30.3: type = converted %int.make_type_unsigned.loc29_30, %.loc29_30.2 [template = constants.%u64] +// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %u64 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %u64 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Int32ToIntLiteral.decl: %Int32ToIntLiteral.type = fn_decl @Int32ToIntLiteral [template = constants.%Int32ToIntLiteral] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc30_25.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc30_25.2: type = converted %int.make_type_32, %.loc30_25.1 [template = i32] +// CHECK:STDOUT: %.loc30_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc30_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc30_25.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc30_25.3: type = converted %int.make_type_signed, %.loc30_25.2 [template = constants.%i32] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc30_44.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc30_44.2: type = converted %int_literal.make_type, %.loc30_44.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Uint32ToUintLiteral.decl: %Uint32ToUintLiteral.type = fn_decl @Uint32ToUintLiteral [template = constants.%Uint32ToUintLiteral] { -// CHECK:STDOUT: %a.patt: %.2 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %.2 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc31_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc31_27.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc31_27.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%.2] -// CHECK:STDOUT: %.loc31_27.3: type = converted %int.make_type_unsigned, %.loc31_27.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc31_27.1) [template = constants.%u32] +// CHECK:STDOUT: %.loc31_27.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%u32] +// CHECK:STDOUT: %.loc31_27.3: type = converted %int.make_type_unsigned, %.loc31_27.2 [template = constants.%u32] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc31_46.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc31_46.2: type = converted %int_literal.make_type, %.loc31_46.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %a.param: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %a: %.2 = bind_name a, %a.param +// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @NegateI32(%a.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @NegateI32(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubI32(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.ssub"; +// CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AddU32(%a.param_patt: %.2, %b.param_patt: %.2) -> %.2 = "int.uadd"; +// CHECK:STDOUT: fn @AddU32(%a.param_patt: %u32, %b.param_patt: %u32) -> %u32 = "int.uadd"; // CHECK:STDOUT: // CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt32(%a.param_patt: i32) -> i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToInt32(%a.param_patt: %i32) -> %i32 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: i32) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToInt32(%a.param_patt: %.2) -> i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @Uint32ToInt32(%a.param_patt: %u32) -> %i32 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToUint32(%a.param_patt: %.2) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @Uint32ToUint32(%a.param_patt: %u32) -> %u32 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: fn @IntLiteralToIntLiteral(%a.param_patt: Core.IntLiteral) -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: i32) -> %.4 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: i32) -> %.5 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToInt16(%a.param_patt: %.2) -> %.4 = "int.convert_checked"; +// CHECK:STDOUT: fn @Uint32ToInt16(%a.param_patt: %u32) -> %i16 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToUint16(%a.param_patt: %.2) -> %.5 = "int.convert_checked"; +// CHECK:STDOUT: fn @Uint32ToUint16(%a.param_patt: %u32) -> %u16 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteralToInt16(%a.param_patt: Core.IntLiteral) -> %.4 = "int.convert_checked"; +// CHECK:STDOUT: fn @IntLiteralToInt16(%a.param_patt: Core.IntLiteral) -> %i16 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteralToUint16(%a.param_patt: Core.IntLiteral) -> %.5 = "int.convert_checked"; +// CHECK:STDOUT: fn @IntLiteralToUint16(%a.param_patt: Core.IntLiteral) -> %u16 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt64(%a.param_patt: i32) -> %.7 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToInt64(%a.param_patt: %i32) -> %i64 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint64(%a.param_patt: i32) -> %.8 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToUint64(%a.param_patt: %i32) -> %u64 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToInt64(%a.param_patt: %.2) -> %.7 = "int.convert_checked"; +// CHECK:STDOUT: fn @Uint32ToInt64(%a.param_patt: %u32) -> %i64 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToUint64(%a.param_patt: %.2) -> %.8 = "int.convert_checked"; +// CHECK:STDOUT: fn @Uint32ToUint64(%a.param_patt: %u32) -> %u64 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToIntLiteral(%a.param_patt: i32) -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToIntLiteral(%a.param_patt: %i32) -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToUintLiteral(%a.param_patt: %.2) -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn @Uint32ToUintLiteral(%a.param_patt: %u32) -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: --- identity.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Int32ToInt32.type: type = fn_type @Int32ToInt32 [template] // CHECK:STDOUT: %Int32ToInt32: %Int32ToInt32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %.27: = bound_method %.26, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template] // CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template] // CHECK:STDOUT: %NegateI32.type: type = fn_type @NegateI32 [template] // CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template] -// CHECK:STDOUT: %.31: i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 1 [template] -// CHECK:STDOUT: %.35: i32 = int_value -2147483648 [template] +// CHECK:STDOUT: %.30: %i32 = int_value -2147483647 [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.32: = bound_method %.31, %Convert.14 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.35: %i32 = int_value -2147483648 [template] // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] // CHECK:STDOUT: %IntLiteralToIntLiteral.type: type = fn_type @IntLiteralToIntLiteral [template] // CHECK:STDOUT: %IntLiteralToIntLiteral: %IntLiteralToIntLiteral.type = struct_value () [template] // CHECK:STDOUT: %Int32ToIntLiteral.type: type = fn_type @Int32ToIntLiteral [template] // CHECK:STDOUT: %Int32ToIntLiteral: %Int32ToIntLiteral.type = struct_value () [template] -// CHECK:STDOUT: %.36: i32 = int_value -1 [template] +// CHECK:STDOUT: %.36: %i32 = int_value -1 [template] // CHECK:STDOUT: %.37: Core.IntLiteral = int_value -1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, inst+25, loaded [template = constants.%NegateI32] -// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, inst+49, loaded [template = constants.%SubI32] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+89, unloaded -// CHECK:STDOUT: %import_ref.4: %IntLiteral.type = import_ref Main//int_ops, inst+96, loaded [template = constants.%IntLiteral] -// CHECK:STDOUT: %import_ref.5: %Int32ToInt32.type = import_ref Main//int_ops, inst+113, loaded [template = constants.%Int32ToInt32] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+131, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+149, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+168, unloaded -// CHECK:STDOUT: %import_ref.9: %IntLiteralToIntLiteral.type = import_ref Main//int_ops, inst+187, loaded [template = constants.%IntLiteralToIntLiteral] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+218, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+237, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+256, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+275, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+294, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+313, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+352, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+371, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+390, unloaded -// CHECK:STDOUT: %import_ref.20: %Int32ToIntLiteral.type = import_ref Main//int_ops, inst+408, loaded [template = constants.%Int32ToIntLiteral] -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+427, unloaded +// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, inst+33, loaded [template = constants.%NegateI32] +// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, inst+60, loaded [template = constants.%SubI32] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+99, unloaded +// CHECK:STDOUT: %import_ref.4: %IntLiteral.type = import_ref Main//int_ops, inst+106, loaded [template = constants.%IntLiteral] +// CHECK:STDOUT: %import_ref.5: %Int32ToInt32.type = import_ref Main//int_ops, inst+125, loaded [template = constants.%Int32ToInt32] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+144, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+163, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+182, unloaded +// CHECK:STDOUT: %import_ref.9: %IntLiteralToIntLiteral.type = import_ref Main//int_ops, inst+201, loaded [template = constants.%IntLiteralToIntLiteral] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+222, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+242, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+261, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+280, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+299, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+318, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+339, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+359, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+378, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+397, unloaded +// CHECK:STDOUT: %import_ref.20: %Int32ToIntLiteral.type = import_ref Main//int_ops, inst+416, loaded [template = constants.%Int32ToIntLiteral] +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+435, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.22 +// CHECK:STDOUT: .Int = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -875,94 +892,102 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_8.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_8.2: type = converted %int.make_type_32.loc5, %.loc5_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] +// CHECK:STDOUT: %.loc5_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_8.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_8.3: type = converted %int.make_type_signed.loc5, %.loc5_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.3: type = converted %int.make_type_signed.loc6, %.loc6_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%.loc7_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.2: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.3: type = converted %int.make_type_signed.loc7, %.loc7_8.2 [template = constants.%i32] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.4 [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc8_19.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc8_19.2: type = converted %int_literal.make_type, %.loc8_19.1 [template = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt32(%a.param_patt: i32) -> i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToInt32(%a.param_patt: %i32) -> %i32 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubI32(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.ssub"; +// CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @NegateI32(%a.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @NegateI32(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @IntLiteralToIntLiteral(%a.param_patt: Core.IntLiteral) -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToIntLiteral(%a.param_patt: i32) -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToIntLiteral(%a.param_patt: %i32) -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToInt32.ref.loc5: %Int32ToInt32.type = name_ref Int32ToInt32, imports.%import_ref.5 [template = constants.%Int32ToInt32] -// CHECK:STDOUT: %.loc5_27.1: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc5_27.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc5_27.3: = bound_method %.loc5_27.1, %.loc5_27.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc5_27: init i32 = call %.loc5_27.3(%.loc5_27.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc5_27.4: i32 = value_of_initializer %int.convert_checked.loc5_27 [template = constants.%.27] -// CHECK:STDOUT: %.loc5_27.5: i32 = converted %.loc5_27.1, %.loc5_27.4 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc5_26: init i32 = call %Int32ToInt32.ref.loc5(%.loc5_27.5) [template = constants.%.27] -// CHECK:STDOUT: %.loc5_29.1: i32 = value_of_initializer %int.convert_checked.loc5_26 [template = constants.%.27] -// CHECK:STDOUT: %.loc5_29.2: i32 = converted %int.convert_checked.loc5_26, %.loc5_29.1 [template = constants.%.27] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc5_29.2 +// CHECK:STDOUT: %.loc5_27.1: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc5_27.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc5_27.3: = bound_method %.loc5_27.1, %.loc5_27.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc5_27.4: = specific_function %.loc5_27.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc5_27: init %i32 = call %.loc5_27.4(%.loc5_27.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc5_27.5: %i32 = value_of_initializer %int.convert_checked.loc5_27 [template = constants.%.25] +// CHECK:STDOUT: %.loc5_27.6: %i32 = converted %.loc5_27.1, %.loc5_27.5 [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc5_26: init %i32 = call %Int32ToInt32.ref.loc5(%.loc5_27.6) [template = constants.%.25] +// CHECK:STDOUT: %.loc5_29.1: %i32 = value_of_initializer %int.convert_checked.loc5_26 [template = constants.%.25] +// CHECK:STDOUT: %.loc5_29.2: %i32 = converted %int.convert_checked.loc5_26, %.loc5_29.1 [template = constants.%.25] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc5_29.2 // CHECK:STDOUT: %Int32ToInt32.ref.loc6: %Int32ToInt32.type = name_ref Int32ToInt32, imports.%import_ref.5 [template = constants.%Int32ToInt32] -// CHECK:STDOUT: %.loc6_27.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_27.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_27.3: = bound_method %.loc6_27.1, %.loc6_27.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc6_27: init i32 = call %.loc6_27.3(%.loc6_27.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc6_27.4: i32 = value_of_initializer %int.convert_checked.loc6_27 [template = constants.%.30] -// CHECK:STDOUT: %.loc6_27.5: i32 = converted %.loc6_27.1, %.loc6_27.4 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc6_26: init i32 = call %Int32ToInt32.ref.loc6(%.loc6_27.5) [template = constants.%.30] -// CHECK:STDOUT: %.loc6_39.1: i32 = value_of_initializer %int.convert_checked.loc6_26 [template = constants.%.30] -// CHECK:STDOUT: %.loc6_39.2: i32 = converted %int.convert_checked.loc6_26, %.loc6_39.1 [template = constants.%.30] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc6_39.2 +// CHECK:STDOUT: %.loc6_27.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.26] +// CHECK:STDOUT: %.loc6_27.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_27.3: = bound_method %.loc6_27.1, %.loc6_27.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc6_27.4: = specific_function %.loc6_27.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc6_27: init %i32 = call %.loc6_27.4(%.loc6_27.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc6_27.5: %i32 = value_of_initializer %int.convert_checked.loc6_27 [template = constants.%.29] +// CHECK:STDOUT: %.loc6_27.6: %i32 = converted %.loc6_27.1, %.loc6_27.5 [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc6_26: init %i32 = call %Int32ToInt32.ref.loc6(%.loc6_27.6) [template = constants.%.29] +// CHECK:STDOUT: %.loc6_39.1: %i32 = value_of_initializer %int.convert_checked.loc6_26 [template = constants.%.29] +// CHECK:STDOUT: %.loc6_39.2: %i32 = converted %int.convert_checked.loc6_26, %.loc6_39.1 [template = constants.%.29] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc6_39.2 // CHECK:STDOUT: %Int32ToInt32.ref.loc7: %Int32ToInt32.type = name_ref Int32ToInt32, imports.%import_ref.5 [template = constants.%Int32ToInt32] // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] // CHECK:STDOUT: %NegateI32.ref.loc7: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] -// CHECK:STDOUT: %.loc7_44.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.28] -// CHECK:STDOUT: %.loc7_44.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_44.3: = bound_method %.loc7_44.1, %.loc7_44.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc7_44: init i32 = call %.loc7_44.3(%.loc7_44.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc7_44.4: i32 = value_of_initializer %int.convert_checked.loc7_44 [template = constants.%.30] -// CHECK:STDOUT: %.loc7_44.5: i32 = converted %.loc7_44.1, %.loc7_44.4 [template = constants.%.30] -// CHECK:STDOUT: %int.snegate.loc7: init i32 = call %NegateI32.ref.loc7(%.loc7_44.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc7_58.1: Core.IntLiteral = int_value 1 [template = constants.%.32] -// CHECK:STDOUT: %.loc7_43.1: i32 = value_of_initializer %int.snegate.loc7 [template = constants.%.31] -// CHECK:STDOUT: %.loc7_43.2: i32 = converted %int.snegate.loc7, %.loc7_43.1 [template = constants.%.31] -// CHECK:STDOUT: %.loc7_58.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_58.3: = bound_method %.loc7_58.1, %.loc7_58.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc7_58: init i32 = call %.loc7_58.3(%.loc7_58.1) [template = constants.%.34] -// CHECK:STDOUT: %.loc7_58.4: i32 = value_of_initializer %int.convert_checked.loc7_58 [template = constants.%.34] -// CHECK:STDOUT: %.loc7_58.5: i32 = converted %.loc7_58.1, %.loc7_58.4 [template = constants.%.34] -// CHECK:STDOUT: %int.ssub: init i32 = call %SubI32.ref(%.loc7_43.2, %.loc7_58.5) [template = constants.%.35] -// CHECK:STDOUT: %.loc7_33.1: i32 = value_of_initializer %int.ssub [template = constants.%.35] -// CHECK:STDOUT: %.loc7_33.2: i32 = converted %int.ssub, %.loc7_33.1 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc7_26: init i32 = call %Int32ToInt32.ref.loc7(%.loc7_33.2) [template = constants.%.35] -// CHECK:STDOUT: %.loc7_61.1: i32 = value_of_initializer %int.convert_checked.loc7_26 [template = constants.%.35] -// CHECK:STDOUT: %.loc7_61.2: i32 = converted %int.convert_checked.loc7_26, %.loc7_61.1 [template = constants.%.35] -// CHECK:STDOUT: %c: i32 = bind_name c, %.loc7_61.2 +// CHECK:STDOUT: %.loc7_44.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.26] +// CHECK:STDOUT: %.loc7_44.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_44.3: = bound_method %.loc7_44.1, %.loc7_44.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc7_44.4: = specific_function %.loc7_44.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc7_44: init %i32 = call %.loc7_44.4(%.loc7_44.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc7_44.5: %i32 = value_of_initializer %int.convert_checked.loc7_44 [template = constants.%.29] +// CHECK:STDOUT: %.loc7_44.6: %i32 = converted %.loc7_44.1, %.loc7_44.5 [template = constants.%.29] +// CHECK:STDOUT: %int.snegate.loc7: init %i32 = call %NegateI32.ref.loc7(%.loc7_44.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc7_58.1: Core.IntLiteral = int_value 1 [template = constants.%.31] +// CHECK:STDOUT: %.loc7_43.1: %i32 = value_of_initializer %int.snegate.loc7 [template = constants.%.30] +// CHECK:STDOUT: %.loc7_43.2: %i32 = converted %int.snegate.loc7, %.loc7_43.1 [template = constants.%.30] +// CHECK:STDOUT: %.loc7_58.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_58.3: = bound_method %.loc7_58.1, %.loc7_58.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc7_58.4: = specific_function %.loc7_58.3, @Convert.2(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc7_58: init %i32 = call %.loc7_58.4(%.loc7_58.1) [template = constants.%.34] +// CHECK:STDOUT: %.loc7_58.5: %i32 = value_of_initializer %int.convert_checked.loc7_58 [template = constants.%.34] +// CHECK:STDOUT: %.loc7_58.6: %i32 = converted %.loc7_58.1, %.loc7_58.5 [template = constants.%.34] +// CHECK:STDOUT: %int.ssub: init %i32 = call %SubI32.ref(%.loc7_43.2, %.loc7_58.6) [template = constants.%.35] +// CHECK:STDOUT: %.loc7_33.1: %i32 = value_of_initializer %int.ssub [template = constants.%.35] +// CHECK:STDOUT: %.loc7_33.2: %i32 = converted %int.ssub, %.loc7_33.1 [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc7_26: init %i32 = call %Int32ToInt32.ref.loc7(%.loc7_33.2) [template = constants.%.35] +// CHECK:STDOUT: %.loc7_61.1: %i32 = value_of_initializer %int.convert_checked.loc7_26 [template = constants.%.35] +// CHECK:STDOUT: %.loc7_61.2: %i32 = converted %int.convert_checked.loc7_26, %.loc7_61.1 [template = constants.%.35] +// CHECK:STDOUT: %c: %i32 = bind_name c, %.loc7_61.2 // CHECK:STDOUT: %IntLiteralToIntLiteral.ref: %IntLiteralToIntLiteral.type = name_ref IntLiteralToIntLiteral, imports.%import_ref.9 [template = constants.%IntLiteralToIntLiteral] // CHECK:STDOUT: %Int32ToIntLiteral.ref: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] // CHECK:STDOUT: %NegateI32.ref.loc8: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] -// CHECK:STDOUT: %.loc8_74.1: Core.IntLiteral = int_value 1 [template = constants.%.32] -// CHECK:STDOUT: %.loc8_74.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_74.3: = bound_method %.loc8_74.1, %.loc8_74.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc8_74: init i32 = call %.loc8_74.3(%.loc8_74.1) [template = constants.%.34] -// CHECK:STDOUT: %.loc8_74.4: i32 = value_of_initializer %int.convert_checked.loc8_74 [template = constants.%.34] -// CHECK:STDOUT: %.loc8_74.5: i32 = converted %.loc8_74.1, %.loc8_74.4 [template = constants.%.34] -// CHECK:STDOUT: %int.snegate.loc8: init i32 = call %NegateI32.ref.loc8(%.loc8_74.5) [template = constants.%.36] -// CHECK:STDOUT: %.loc8_73.1: i32 = value_of_initializer %int.snegate.loc8 [template = constants.%.36] -// CHECK:STDOUT: %.loc8_73.2: i32 = converted %int.snegate.loc8, %.loc8_73.1 [template = constants.%.36] +// CHECK:STDOUT: %.loc8_74.1: Core.IntLiteral = int_value 1 [template = constants.%.31] +// CHECK:STDOUT: %.loc8_74.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_74.3: = bound_method %.loc8_74.1, %.loc8_74.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc8_74.4: = specific_function %.loc8_74.3, @Convert.2(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc8_74: init %i32 = call %.loc8_74.4(%.loc8_74.1) [template = constants.%.34] +// CHECK:STDOUT: %.loc8_74.5: %i32 = value_of_initializer %int.convert_checked.loc8_74 [template = constants.%.34] +// CHECK:STDOUT: %.loc8_74.6: %i32 = converted %.loc8_74.1, %.loc8_74.5 [template = constants.%.34] +// CHECK:STDOUT: %int.snegate.loc8: init %i32 = call %NegateI32.ref.loc8(%.loc8_74.6) [template = constants.%.36] +// CHECK:STDOUT: %.loc8_73.1: %i32 = value_of_initializer %int.snegate.loc8 [template = constants.%.36] +// CHECK:STDOUT: %.loc8_73.2: %i32 = converted %int.snegate.loc8, %.loc8_73.1 [template = constants.%.36] // CHECK:STDOUT: %int.convert_checked.loc8_63: init Core.IntLiteral = call %Int32ToIntLiteral.ref(%.loc8_73.2) [template = constants.%.37] // CHECK:STDOUT: %.loc8_63.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc8_63 [template = constants.%.37] // CHECK:STDOUT: %.loc8_63.2: Core.IntLiteral = converted %int.convert_checked.loc8_63, %.loc8_63.1 [template = constants.%.37] @@ -979,49 +1004,51 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = int_type unsigned, %.1 [template] +// CHECK:STDOUT: %u32: type = int_type unsigned, %.1 [template] // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %.30: %.2 = int_value 2147483647 [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.26: %u32 = int_value 2147483647 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %Uint32ToInt32.type: type = fn_type @Uint32ToInt32 [template] // CHECK:STDOUT: %Uint32ToInt32: %Uint32ToInt32.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+25, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+49, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+89, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+96, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+113, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+131, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7: %Uint32ToInt32.type = import_ref Main//int_ops, inst+149, loaded [template = constants.%Uint32ToInt32] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+168, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+187, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+218, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+237, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+256, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+275, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+294, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+313, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+352, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+371, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+390, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+408, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+427, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+33, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+60, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+99, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+106, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+125, unloaded +// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+144, loaded [template = constants.%Int32ToUint32] +// CHECK:STDOUT: %import_ref.7: %Uint32ToInt32.type = import_ref Main//int_ops, inst+163, loaded [template = constants.%Uint32ToInt32] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+182, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+201, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+222, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+242, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+261, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+280, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+299, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+318, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+339, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+359, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+378, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+397, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+416, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+435, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 -// CHECK:STDOUT: .Int32 = %import_ref.72 +// CHECK:STDOUT: .Int = %import_ref.59 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1057,46 +1084,49 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc5_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc5_10.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc5_10.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%.2] -// CHECK:STDOUT: %.loc5_10.3: type = converted %int.make_type_unsigned, %.loc5_10.2 [template = constants.%.2] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc6_20.2: type = converted %int.make_type_32, %.loc6_20.1 [template = i32] +// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc5_10.1) [template = constants.%u32] +// CHECK:STDOUT: %.loc5_10.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%u32] +// CHECK:STDOUT: %.loc5_10.3: type = converted %int.make_type_unsigned, %.loc5_10.2 [template = constants.%u32] +// CHECK:STDOUT: %.loc6_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc6_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc6_20.3: type = converted %int.make_type_signed, %.loc6_20.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: i32) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToInt32(%a.param_patt: %.2) -> i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @Uint32ToInt32(%a.param_patt: %u32) -> %i32 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToUint32.ref.loc5: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %.loc5_30.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.3] -// CHECK:STDOUT: %.loc5_30.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc5_30.3: = bound_method %.loc5_30.1, %.loc5_30.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc5_30: init i32 = call %.loc5_30.3(%.loc5_30.1) [template = constants.%.29] -// CHECK:STDOUT: %.loc5_30.4: i32 = value_of_initializer %int.convert_checked.loc5_30 [template = constants.%.29] -// CHECK:STDOUT: %.loc5_30.5: i32 = converted %.loc5_30.1, %.loc5_30.4 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc5_29: init %.2 = call %Int32ToUint32.ref.loc5(%.loc5_30.5) [template = constants.%.30] -// CHECK:STDOUT: %.loc5_42.1: %.2 = value_of_initializer %int.convert_checked.loc5_29 [template = constants.%.30] -// CHECK:STDOUT: %.loc5_42.2: %.2 = converted %int.convert_checked.loc5_29, %.loc5_42.1 [template = constants.%.30] -// CHECK:STDOUT: %max: %.2 = bind_name max, %.loc5_42.2 +// CHECK:STDOUT: %.loc5_30.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc5_30.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc5_30.3: = bound_method %.loc5_30.1, %.loc5_30.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc5_30.4: = specific_function %.loc5_30.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc5_30: init %i32 = call %.loc5_30.4(%.loc5_30.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc5_30.5: %i32 = value_of_initializer %int.convert_checked.loc5_30 [template = constants.%.25] +// CHECK:STDOUT: %.loc5_30.6: %i32 = converted %.loc5_30.1, %.loc5_30.5 [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc5_29: init %u32 = call %Int32ToUint32.ref.loc5(%.loc5_30.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc5_42.1: %u32 = value_of_initializer %int.convert_checked.loc5_29 [template = constants.%.26] +// CHECK:STDOUT: %.loc5_42.2: %u32 = converted %int.convert_checked.loc5_29, %.loc5_42.1 [template = constants.%.26] +// CHECK:STDOUT: %max: %u32 = bind_name max, %.loc5_42.2 // CHECK:STDOUT: %Uint32ToInt32.ref: %Uint32ToInt32.type = name_ref Uint32ToInt32, imports.%import_ref.7 [template = constants.%Uint32ToInt32] // CHECK:STDOUT: %Int32ToUint32.ref.loc6: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %.loc6_54.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.3] -// CHECK:STDOUT: %.loc6_54.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_54.3: = bound_method %.loc6_54.1, %.loc6_54.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc6_54: init i32 = call %.loc6_54.3(%.loc6_54.1) [template = constants.%.29] -// CHECK:STDOUT: %.loc6_54.4: i32 = value_of_initializer %int.convert_checked.loc6_54 [template = constants.%.29] -// CHECK:STDOUT: %.loc6_54.5: i32 = converted %.loc6_54.1, %.loc6_54.4 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc6_53: init %.2 = call %Int32ToUint32.ref.loc6(%.loc6_54.5) [template = constants.%.30] -// CHECK:STDOUT: %.loc6_53.1: %.2 = value_of_initializer %int.convert_checked.loc6_53 [template = constants.%.30] -// CHECK:STDOUT: %.loc6_53.2: %.2 = converted %int.convert_checked.loc6_53, %.loc6_53.1 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc6_39: init i32 = call %Uint32ToInt32.ref(%.loc6_53.2) [template = constants.%.29] -// CHECK:STDOUT: %.loc6_67.1: i32 = value_of_initializer %int.convert_checked.loc6_39 [template = constants.%.29] -// CHECK:STDOUT: %.loc6_67.2: i32 = converted %int.convert_checked.loc6_39, %.loc6_67.1 [template = constants.%.29] -// CHECK:STDOUT: %max_roundtrip: i32 = bind_name max_roundtrip, %.loc6_67.2 +// CHECK:STDOUT: %.loc6_54.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc6_54.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_54.3: = bound_method %.loc6_54.1, %.loc6_54.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc6_54.4: = specific_function %.loc6_54.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc6_54: init %i32 = call %.loc6_54.4(%.loc6_54.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc6_54.5: %i32 = value_of_initializer %int.convert_checked.loc6_54 [template = constants.%.25] +// CHECK:STDOUT: %.loc6_54.6: %i32 = converted %.loc6_54.1, %.loc6_54.5 [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc6_53: init %u32 = call %Int32ToUint32.ref.loc6(%.loc6_54.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc6_53.1: %u32 = value_of_initializer %int.convert_checked.loc6_53 [template = constants.%.26] +// CHECK:STDOUT: %.loc6_53.2: %u32 = converted %int.convert_checked.loc6_53, %.loc6_53.1 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc6_39: init %i32 = call %Uint32ToInt32.ref(%.loc6_53.2) [template = constants.%.25] +// CHECK:STDOUT: %.loc6_67.1: %i32 = value_of_initializer %int.convert_checked.loc6_39 [template = constants.%.25] +// CHECK:STDOUT: %.loc6_67.2: %i32 = converted %int.convert_checked.loc6_39, %.loc6_67.1 [template = constants.%.25] +// CHECK:STDOUT: %max_roundtrip: %i32 = bind_name max_roundtrip, %.loc6_67.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1106,84 +1136,89 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 16 [template] // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = int_type unsigned, %.1 [template] +// CHECK:STDOUT: %u16: type = int_type unsigned, %.1 [template] // CHECK:STDOUT: %Int32ToUint16.type: type = fn_type @Int32ToUint16 [template] // CHECK:STDOUT: %Int32ToUint16: %Int32ToUint16.type = struct_value () [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.2 [template] // CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 0 [template] -// CHECK:STDOUT: %.30: %.2 = int_value 0 [template] -// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 65535 [template] -// CHECK:STDOUT: %.32: = bound_method %.31, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 65535 [template] -// CHECK:STDOUT: %.34: %.2 = int_value 65535 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.2) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.27: %u16 = int_value 0 [template] +// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 65535 [template] +// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.14 [template] +// CHECK:STDOUT: %.30: = specific_function %.29, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.31: %i32 = int_value 65535 [template] +// CHECK:STDOUT: %.32: %u16 = int_value 65535 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %.35: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %i16: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template] // CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template] -// CHECK:STDOUT: %.36: Core.IntLiteral = int_value 32767 [template] -// CHECK:STDOUT: %.37: = bound_method %.36, %Convert.15 [template] -// CHECK:STDOUT: %.38: i32 = int_value 32767 [template] -// CHECK:STDOUT: %.39: %.35 = int_value 32767 [template] +// CHECK:STDOUT: %.33: Core.IntLiteral = int_value 32767 [template] +// CHECK:STDOUT: %.34: = bound_method %.33, %Convert.14 [template] +// CHECK:STDOUT: %.35: = specific_function %.34, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.36: %i32 = int_value 32767 [template] +// CHECK:STDOUT: %.37: %i16 = int_value 32767 [template] // CHECK:STDOUT: %NegateI32.type: type = fn_type @NegateI32 [template] // CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template] -// CHECK:STDOUT: %.40: Core.IntLiteral = int_value 32768 [template] -// CHECK:STDOUT: %.41: = bound_method %.40, %Convert.15 [template] -// CHECK:STDOUT: %.42: i32 = int_value 32768 [template] -// CHECK:STDOUT: %.43: i32 = int_value -32768 [template] -// CHECK:STDOUT: %.44: %.35 = int_value -32768 [template] +// CHECK:STDOUT: %.38: Core.IntLiteral = int_value 32768 [template] +// CHECK:STDOUT: %.39: = bound_method %.38, %Convert.14 [template] +// CHECK:STDOUT: %.40: = specific_function %.39, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.41: %i32 = int_value 32768 [template] +// CHECK:STDOUT: %.42: %i32 = int_value -32768 [template] +// CHECK:STDOUT: %.43: %i16 = int_value -32768 [template] // CHECK:STDOUT: %Uint32ToUint16.type: type = fn_type @Uint32ToUint16 [template] // CHECK:STDOUT: %Uint32ToUint16: %Uint32ToUint16.type = struct_value () [template] -// CHECK:STDOUT: %.45: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %.46: type = int_type unsigned, %.45 [template] +// CHECK:STDOUT: %u32: type = int_type unsigned, %.2 [template] // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %.47: %.46 = int_value 0 [template] -// CHECK:STDOUT: %.48: %.46 = int_value 65535 [template] +// CHECK:STDOUT: %.44: %u32 = int_value 0 [template] +// CHECK:STDOUT: %.45: %u32 = int_value 65535 [template] // CHECK:STDOUT: %Uint32ToInt16.type: type = fn_type @Uint32ToInt16 [template] // CHECK:STDOUT: %Uint32ToInt16: %Uint32ToInt16.type = struct_value () [template] -// CHECK:STDOUT: %.49: %.35 = int_value 0 [template] -// CHECK:STDOUT: %.50: %.46 = int_value 32767 [template] +// CHECK:STDOUT: %.46: %i16 = int_value 0 [template] +// CHECK:STDOUT: %.47: %u32 = int_value 32767 [template] // CHECK:STDOUT: %IntLiteralToInt16.type: type = fn_type @IntLiteralToInt16 [template] // CHECK:STDOUT: %IntLiteralToInt16: %IntLiteralToInt16.type = struct_value () [template] // CHECK:STDOUT: %Int32ToIntLiteral.type: type = fn_type @Int32ToIntLiteral [template] // CHECK:STDOUT: %Int32ToIntLiteral: %Int32ToIntLiteral.type = struct_value () [template] -// CHECK:STDOUT: %.51: Core.IntLiteral = int_value -32768 [template] +// CHECK:STDOUT: %.48: Core.IntLiteral = int_value -32768 [template] // CHECK:STDOUT: %IntLiteralToUint16.type: type = fn_type @IntLiteralToUint16 [template] // CHECK:STDOUT: %IntLiteralToUint16: %IntLiteralToUint16.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, inst+25, loaded [template = constants.%NegateI32] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+49, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+89, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+96, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+113, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+131, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+149, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+168, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+187, unloaded -// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, inst+218, loaded [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, inst+237, loaded [template = constants.%Int32ToUint16] -// CHECK:STDOUT: %import_ref.12: %Uint32ToInt16.type = import_ref Main//int_ops, inst+256, loaded [template = constants.%Uint32ToInt16] -// CHECK:STDOUT: %import_ref.13: %Uint32ToUint16.type = import_ref Main//int_ops, inst+275, loaded [template = constants.%Uint32ToUint16] -// CHECK:STDOUT: %import_ref.14: %IntLiteralToInt16.type = import_ref Main//int_ops, inst+294, loaded [template = constants.%IntLiteralToInt16] -// CHECK:STDOUT: %import_ref.15: %IntLiteralToUint16.type = import_ref Main//int_ops, inst+313, loaded [template = constants.%IntLiteralToUint16] -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+352, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+371, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+390, unloaded -// CHECK:STDOUT: %import_ref.20: %Int32ToIntLiteral.type = import_ref Main//int_ops, inst+408, loaded [template = constants.%Int32ToIntLiteral] -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+427, unloaded +// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, inst+33, loaded [template = constants.%NegateI32] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+60, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+99, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+106, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+125, unloaded +// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+144, loaded [template = constants.%Int32ToUint32] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+163, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+182, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+201, unloaded +// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, inst+222, loaded [template = constants.%Int32ToInt16] +// CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, inst+242, loaded [template = constants.%Int32ToUint16] +// CHECK:STDOUT: %import_ref.12: %Uint32ToInt16.type = import_ref Main//int_ops, inst+261, loaded [template = constants.%Uint32ToInt16] +// CHECK:STDOUT: %import_ref.13: %Uint32ToUint16.type = import_ref Main//int_ops, inst+280, loaded [template = constants.%Uint32ToUint16] +// CHECK:STDOUT: %import_ref.14: %IntLiteralToInt16.type = import_ref Main//int_ops, inst+299, loaded [template = constants.%IntLiteralToInt16] +// CHECK:STDOUT: %import_ref.15: %IntLiteralToUint16.type = import_ref Main//int_ops, inst+318, loaded [template = constants.%IntLiteralToUint16] +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+339, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+359, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+378, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+397, unloaded +// CHECK:STDOUT: %import_ref.20: %Int32ToIntLiteral.type = import_ref Main//int_ops, inst+416, loaded [template = constants.%Int32ToIntLiteral] +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+435, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 -// CHECK:STDOUT: .Int = %import_ref.72 +// CHECK:STDOUT: .Int = %import_ref.59 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1229,247 +1264,259 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc5_8.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc5: init type = call constants.%UInt(%.loc5_8.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc5_8.2: type = value_of_initializer %int.make_type_unsigned.loc5 [template = constants.%.2] -// CHECK:STDOUT: %.loc5_8.3: type = converted %int.make_type_unsigned.loc5, %.loc5_8.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned.loc5: init type = call constants.%UInt(%.loc5_8.1) [template = constants.%u16] +// CHECK:STDOUT: %.loc5_8.2: type = value_of_initializer %int.make_type_unsigned.loc5 [template = constants.%u16] +// CHECK:STDOUT: %.loc5_8.3: type = converted %int.make_type_unsigned.loc5, %.loc5_8.2 [template = constants.%u16] // CHECK:STDOUT: %.loc6_8.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc6: init type = call constants.%UInt(%.loc6_8.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc6_8.2: type = value_of_initializer %int.make_type_unsigned.loc6 [template = constants.%.2] -// CHECK:STDOUT: %.loc6_8.3: type = converted %int.make_type_unsigned.loc6, %.loc6_8.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned.loc6: init type = call constants.%UInt(%.loc6_8.1) [template = constants.%u16] +// CHECK:STDOUT: %.loc6_8.2: type = value_of_initializer %int.make_type_unsigned.loc6 [template = constants.%u16] +// CHECK:STDOUT: %.loc6_8.3: type = converted %int.make_type_unsigned.loc6, %.loc6_8.2 [template = constants.%u16] // CHECK:STDOUT: %.loc8_8.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_8.1) [template = constants.%.35] -// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%.35] -// CHECK:STDOUT: %.loc8_8.3: type = converted %int.make_type_signed.loc8, %.loc8_8.2 [template = constants.%.35] +// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_8.1) [template = constants.%i16] +// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i16] +// CHECK:STDOUT: %.loc8_8.3: type = converted %int.make_type_signed.loc8, %.loc8_8.2 [template = constants.%i16] // CHECK:STDOUT: %.loc9_8.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%.loc9_8.1) [template = constants.%.35] -// CHECK:STDOUT: %.loc9_8.2: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%.35] -// CHECK:STDOUT: %.loc9_8.3: type = converted %int.make_type_signed.loc9, %.loc9_8.2 [template = constants.%.35] +// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%.loc9_8.1) [template = constants.%i16] +// CHECK:STDOUT: %.loc9_8.2: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i16] +// CHECK:STDOUT: %.loc9_8.3: type = converted %int.make_type_signed.loc9, %.loc9_8.2 [template = constants.%i16] // CHECK:STDOUT: %.loc11_8.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc11: init type = call constants.%UInt(%.loc11_8.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc11_8.2: type = value_of_initializer %int.make_type_unsigned.loc11 [template = constants.%.2] -// CHECK:STDOUT: %.loc11_8.3: type = converted %int.make_type_unsigned.loc11, %.loc11_8.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned.loc11: init type = call constants.%UInt(%.loc11_8.1) [template = constants.%u16] +// CHECK:STDOUT: %.loc11_8.2: type = value_of_initializer %int.make_type_unsigned.loc11 [template = constants.%u16] +// CHECK:STDOUT: %.loc11_8.3: type = converted %int.make_type_unsigned.loc11, %.loc11_8.2 [template = constants.%u16] // CHECK:STDOUT: %.loc12_8.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc12: init type = call constants.%UInt(%.loc12_8.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc12_8.2: type = value_of_initializer %int.make_type_unsigned.loc12 [template = constants.%.2] -// CHECK:STDOUT: %.loc12_8.3: type = converted %int.make_type_unsigned.loc12, %.loc12_8.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned.loc12: init type = call constants.%UInt(%.loc12_8.1) [template = constants.%u16] +// CHECK:STDOUT: %.loc12_8.2: type = value_of_initializer %int.make_type_unsigned.loc12 [template = constants.%u16] +// CHECK:STDOUT: %.loc12_8.3: type = converted %int.make_type_unsigned.loc12, %.loc12_8.2 [template = constants.%u16] // CHECK:STDOUT: %.loc14_8.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%.loc14_8.1) [template = constants.%.35] -// CHECK:STDOUT: %.loc14_8.2: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%.35] -// CHECK:STDOUT: %.loc14_8.3: type = converted %int.make_type_signed.loc14, %.loc14_8.2 [template = constants.%.35] +// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%.loc14_8.1) [template = constants.%i16] +// CHECK:STDOUT: %.loc14_8.2: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i16] +// CHECK:STDOUT: %.loc14_8.3: type = converted %int.make_type_signed.loc14, %.loc14_8.2 [template = constants.%i16] // CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_8.1) [template = constants.%.35] -// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%.35] -// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed.loc15, %.loc15_8.2 [template = constants.%.35] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i16] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i16] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed.loc15, %.loc15_8.2 [template = constants.%i16] // CHECK:STDOUT: %.loc17_18.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%.loc17_18.1) [template = constants.%.35] -// CHECK:STDOUT: %.loc17_18.2: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%.35] -// CHECK:STDOUT: %.loc17_18.3: type = converted %int.make_type_signed.loc17, %.loc17_18.2 [template = constants.%.35] +// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%.loc17_18.1) [template = constants.%i16] +// CHECK:STDOUT: %.loc17_18.2: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i16] +// CHECK:STDOUT: %.loc17_18.3: type = converted %int.make_type_signed.loc17, %.loc17_18.2 [template = constants.%i16] // CHECK:STDOUT: %.loc18_18.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%.loc18_18.1) [template = constants.%.35] -// CHECK:STDOUT: %.loc18_18.2: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%.35] -// CHECK:STDOUT: %.loc18_18.3: type = converted %int.make_type_signed.loc18, %.loc18_18.2 [template = constants.%.35] +// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%.loc18_18.1) [template = constants.%i16] +// CHECK:STDOUT: %.loc18_18.2: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i16] +// CHECK:STDOUT: %.loc18_18.3: type = converted %int.make_type_signed.loc18, %.loc18_18.2 [template = constants.%i16] // CHECK:STDOUT: %.loc20_18.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc20: init type = call constants.%UInt(%.loc20_18.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc20_18.2: type = value_of_initializer %int.make_type_unsigned.loc20 [template = constants.%.2] -// CHECK:STDOUT: %.loc20_18.3: type = converted %int.make_type_unsigned.loc20, %.loc20_18.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned.loc20: init type = call constants.%UInt(%.loc20_18.1) [template = constants.%u16] +// CHECK:STDOUT: %.loc20_18.2: type = value_of_initializer %int.make_type_unsigned.loc20 [template = constants.%u16] +// CHECK:STDOUT: %.loc20_18.3: type = converted %int.make_type_unsigned.loc20, %.loc20_18.2 [template = constants.%u16] // CHECK:STDOUT: %.loc21_18.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc21: init type = call constants.%UInt(%.loc21_18.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc21_18.2: type = value_of_initializer %int.make_type_unsigned.loc21 [template = constants.%.2] -// CHECK:STDOUT: %.loc21_18.3: type = converted %int.make_type_unsigned.loc21, %.loc21_18.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned.loc21: init type = call constants.%UInt(%.loc21_18.1) [template = constants.%u16] +// CHECK:STDOUT: %.loc21_18.2: type = value_of_initializer %int.make_type_unsigned.loc21 [template = constants.%u16] +// CHECK:STDOUT: %.loc21_18.3: type = converted %int.make_type_unsigned.loc21, %.loc21_18.2 [template = constants.%u16] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: i32) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: i32) -> %.35 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @NegateI32(%a.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @NegateI32(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToUint16(%a.param_patt: %.46) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @Uint32ToUint16(%a.param_patt: %u32) -> %u16 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: i32) -> %.46 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToInt16(%a.param_patt: %.46) -> %.35 = "int.convert_checked"; +// CHECK:STDOUT: fn @Uint32ToInt16(%a.param_patt: %u32) -> %i16 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteralToInt16(%a.param_patt: Core.IntLiteral) -> %.35 = "int.convert_checked"; +// CHECK:STDOUT: fn @IntLiteralToInt16(%a.param_patt: Core.IntLiteral) -> %i16 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToIntLiteral(%a.param_patt: i32) -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToIntLiteral(%a.param_patt: %i32) -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteralToUint16(%a.param_patt: Core.IntLiteral) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @IntLiteralToUint16(%a.param_patt: Core.IntLiteral) -> %u16 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToUint16.ref.loc5: %Int32ToUint16.type = name_ref Int32ToUint16, imports.%import_ref.11 [template = constants.%Int32ToUint16] // CHECK:STDOUT: %.loc5_28.1: Core.IntLiteral = int_value 0 [template = constants.%.3] -// CHECK:STDOUT: %.loc5_28.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc5_28.3: = bound_method %.loc5_28.1, %.loc5_28.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc5_28: init i32 = call %.loc5_28.3(%.loc5_28.1) [template = constants.%.29] -// CHECK:STDOUT: %.loc5_28.4: i32 = value_of_initializer %int.convert_checked.loc5_28 [template = constants.%.29] -// CHECK:STDOUT: %.loc5_28.5: i32 = converted %.loc5_28.1, %.loc5_28.4 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc5_27: init %.2 = call %Int32ToUint16.ref.loc5(%.loc5_28.5) [template = constants.%.30] -// CHECK:STDOUT: %.loc5_30.1: %.2 = value_of_initializer %int.convert_checked.loc5_27 [template = constants.%.30] -// CHECK:STDOUT: %.loc5_30.2: %.2 = converted %int.convert_checked.loc5_27, %.loc5_30.1 [template = constants.%.30] -// CHECK:STDOUT: %a: %.2 = bind_name a, %.loc5_30.2 +// CHECK:STDOUT: %.loc5_28.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc5_28.3: = bound_method %.loc5_28.1, %.loc5_28.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc5_28.4: = specific_function %.loc5_28.3, @Convert.2(constants.%.2) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc5_28: init %i32 = call %.loc5_28.4(%.loc5_28.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc5_28.5: %i32 = value_of_initializer %int.convert_checked.loc5_28 [template = constants.%.26] +// CHECK:STDOUT: %.loc5_28.6: %i32 = converted %.loc5_28.1, %.loc5_28.5 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc5_27: init %u16 = call %Int32ToUint16.ref.loc5(%.loc5_28.6) [template = constants.%.27] +// CHECK:STDOUT: %.loc5_30.1: %u16 = value_of_initializer %int.convert_checked.loc5_27 [template = constants.%.27] +// CHECK:STDOUT: %.loc5_30.2: %u16 = converted %int.convert_checked.loc5_27, %.loc5_30.1 [template = constants.%.27] +// CHECK:STDOUT: %a: %u16 = bind_name a, %.loc5_30.2 // CHECK:STDOUT: %Int32ToUint16.ref.loc6: %Int32ToUint16.type = name_ref Int32ToUint16, imports.%import_ref.11 [template = constants.%Int32ToUint16] -// CHECK:STDOUT: %.loc6_28.1: Core.IntLiteral = int_value 65535 [template = constants.%.31] -// CHECK:STDOUT: %.loc6_28.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_28.3: = bound_method %.loc6_28.1, %.loc6_28.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc6_28: init i32 = call %.loc6_28.3(%.loc6_28.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc6_28.4: i32 = value_of_initializer %int.convert_checked.loc6_28 [template = constants.%.33] -// CHECK:STDOUT: %.loc6_28.5: i32 = converted %.loc6_28.1, %.loc6_28.4 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc6_27: init %.2 = call %Int32ToUint16.ref.loc6(%.loc6_28.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc6_35.1: %.2 = value_of_initializer %int.convert_checked.loc6_27 [template = constants.%.34] -// CHECK:STDOUT: %.loc6_35.2: %.2 = converted %int.convert_checked.loc6_27, %.loc6_35.1 [template = constants.%.34] -// CHECK:STDOUT: %b: %.2 = bind_name b, %.loc6_35.2 +// CHECK:STDOUT: %.loc6_28.1: Core.IntLiteral = int_value 65535 [template = constants.%.28] +// CHECK:STDOUT: %.loc6_28.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_28.3: = bound_method %.loc6_28.1, %.loc6_28.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc6_28.4: = specific_function %.loc6_28.3, @Convert.2(constants.%.2) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %.loc6_28.4(%.loc6_28.1) [template = constants.%.31] +// CHECK:STDOUT: %.loc6_28.5: %i32 = value_of_initializer %int.convert_checked.loc6_28 [template = constants.%.31] +// CHECK:STDOUT: %.loc6_28.6: %i32 = converted %.loc6_28.1, %.loc6_28.5 [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc6_27: init %u16 = call %Int32ToUint16.ref.loc6(%.loc6_28.6) [template = constants.%.32] +// CHECK:STDOUT: %.loc6_35.1: %u16 = value_of_initializer %int.convert_checked.loc6_27 [template = constants.%.32] +// CHECK:STDOUT: %.loc6_35.2: %u16 = converted %int.convert_checked.loc6_27, %.loc6_35.1 [template = constants.%.32] +// CHECK:STDOUT: %b: %u16 = bind_name b, %.loc6_35.2 // CHECK:STDOUT: %Int32ToInt16.ref.loc8: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %.loc8_27.1: Core.IntLiteral = int_value 32767 [template = constants.%.36] -// CHECK:STDOUT: %.loc8_27.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_27.3: = bound_method %.loc8_27.1, %.loc8_27.2 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc8_27: init i32 = call %.loc8_27.3(%.loc8_27.1) [template = constants.%.38] -// CHECK:STDOUT: %.loc8_27.4: i32 = value_of_initializer %int.convert_checked.loc8_27 [template = constants.%.38] -// CHECK:STDOUT: %.loc8_27.5: i32 = converted %.loc8_27.1, %.loc8_27.4 [template = constants.%.38] -// CHECK:STDOUT: %int.convert_checked.loc8_26: init %.35 = call %Int32ToInt16.ref.loc8(%.loc8_27.5) [template = constants.%.39] -// CHECK:STDOUT: %.loc8_34.1: %.35 = value_of_initializer %int.convert_checked.loc8_26 [template = constants.%.39] -// CHECK:STDOUT: %.loc8_34.2: %.35 = converted %int.convert_checked.loc8_26, %.loc8_34.1 [template = constants.%.39] -// CHECK:STDOUT: %c: %.35 = bind_name c, %.loc8_34.2 +// CHECK:STDOUT: %.loc8_27.1: Core.IntLiteral = int_value 32767 [template = constants.%.33] +// CHECK:STDOUT: %.loc8_27.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_27.3: = bound_method %.loc8_27.1, %.loc8_27.2 [template = constants.%.34] +// CHECK:STDOUT: %.loc8_27.4: = specific_function %.loc8_27.3, @Convert.2(constants.%.2) [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc8_27: init %i32 = call %.loc8_27.4(%.loc8_27.1) [template = constants.%.36] +// CHECK:STDOUT: %.loc8_27.5: %i32 = value_of_initializer %int.convert_checked.loc8_27 [template = constants.%.36] +// CHECK:STDOUT: %.loc8_27.6: %i32 = converted %.loc8_27.1, %.loc8_27.5 [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc8_26: init %i16 = call %Int32ToInt16.ref.loc8(%.loc8_27.6) [template = constants.%.37] +// CHECK:STDOUT: %.loc8_34.1: %i16 = value_of_initializer %int.convert_checked.loc8_26 [template = constants.%.37] +// CHECK:STDOUT: %.loc8_34.2: %i16 = converted %int.convert_checked.loc8_26, %.loc8_34.1 [template = constants.%.37] +// CHECK:STDOUT: %c: %i16 = bind_name c, %.loc8_34.2 // CHECK:STDOUT: %Int32ToInt16.ref.loc9: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] // CHECK:STDOUT: %NegateI32.ref.loc9: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] -// CHECK:STDOUT: %.loc9_37.1: Core.IntLiteral = int_value 32768 [template = constants.%.40] -// CHECK:STDOUT: %.loc9_37.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_37.3: = bound_method %.loc9_37.1, %.loc9_37.2 [template = constants.%.41] -// CHECK:STDOUT: %int.convert_checked.loc9_37: init i32 = call %.loc9_37.3(%.loc9_37.1) [template = constants.%.42] -// CHECK:STDOUT: %.loc9_37.4: i32 = value_of_initializer %int.convert_checked.loc9_37 [template = constants.%.42] -// CHECK:STDOUT: %.loc9_37.5: i32 = converted %.loc9_37.1, %.loc9_37.4 [template = constants.%.42] -// CHECK:STDOUT: %int.snegate.loc9: init i32 = call %NegateI32.ref.loc9(%.loc9_37.5) [template = constants.%.43] -// CHECK:STDOUT: %.loc9_36.1: i32 = value_of_initializer %int.snegate.loc9 [template = constants.%.43] -// CHECK:STDOUT: %.loc9_36.2: i32 = converted %int.snegate.loc9, %.loc9_36.1 [template = constants.%.43] -// CHECK:STDOUT: %int.convert_checked.loc9_26: init %.35 = call %Int32ToInt16.ref.loc9(%.loc9_36.2) [template = constants.%.44] -// CHECK:STDOUT: %.loc9_45.1: %.35 = value_of_initializer %int.convert_checked.loc9_26 [template = constants.%.44] -// CHECK:STDOUT: %.loc9_45.2: %.35 = converted %int.convert_checked.loc9_26, %.loc9_45.1 [template = constants.%.44] -// CHECK:STDOUT: %d: %.35 = bind_name d, %.loc9_45.2 +// CHECK:STDOUT: %.loc9_37.1: Core.IntLiteral = int_value 32768 [template = constants.%.38] +// CHECK:STDOUT: %.loc9_37.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_37.3: = bound_method %.loc9_37.1, %.loc9_37.2 [template = constants.%.39] +// CHECK:STDOUT: %.loc9_37.4: = specific_function %.loc9_37.3, @Convert.2(constants.%.2) [template = constants.%.40] +// CHECK:STDOUT: %int.convert_checked.loc9_37: init %i32 = call %.loc9_37.4(%.loc9_37.1) [template = constants.%.41] +// CHECK:STDOUT: %.loc9_37.5: %i32 = value_of_initializer %int.convert_checked.loc9_37 [template = constants.%.41] +// CHECK:STDOUT: %.loc9_37.6: %i32 = converted %.loc9_37.1, %.loc9_37.5 [template = constants.%.41] +// CHECK:STDOUT: %int.snegate.loc9: init %i32 = call %NegateI32.ref.loc9(%.loc9_37.6) [template = constants.%.42] +// CHECK:STDOUT: %.loc9_36.1: %i32 = value_of_initializer %int.snegate.loc9 [template = constants.%.42] +// CHECK:STDOUT: %.loc9_36.2: %i32 = converted %int.snegate.loc9, %.loc9_36.1 [template = constants.%.42] +// CHECK:STDOUT: %int.convert_checked.loc9_26: init %i16 = call %Int32ToInt16.ref.loc9(%.loc9_36.2) [template = constants.%.43] +// CHECK:STDOUT: %.loc9_45.1: %i16 = value_of_initializer %int.convert_checked.loc9_26 [template = constants.%.43] +// CHECK:STDOUT: %.loc9_45.2: %i16 = converted %int.convert_checked.loc9_26, %.loc9_45.1 [template = constants.%.43] +// CHECK:STDOUT: %d: %i16 = bind_name d, %.loc9_45.2 // CHECK:STDOUT: %Uint32ToUint16.ref.loc11: %Uint32ToUint16.type = name_ref Uint32ToUint16, imports.%import_ref.13 [template = constants.%Uint32ToUint16] // CHECK:STDOUT: %Int32ToUint32.ref.loc11: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %.loc11_43.1: Core.IntLiteral = int_value 0 [template = constants.%.3] -// CHECK:STDOUT: %.loc11_43.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_43.3: = bound_method %.loc11_43.1, %.loc11_43.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc11_43: init i32 = call %.loc11_43.3(%.loc11_43.1) [template = constants.%.29] -// CHECK:STDOUT: %.loc11_43.4: i32 = value_of_initializer %int.convert_checked.loc11_43 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_43.5: i32 = converted %.loc11_43.1, %.loc11_43.4 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc11_42: init %.46 = call %Int32ToUint32.ref.loc11(%.loc11_43.5) [template = constants.%.47] -// CHECK:STDOUT: %.loc11_42.1: %.46 = value_of_initializer %int.convert_checked.loc11_42 [template = constants.%.47] -// CHECK:STDOUT: %.loc11_42.2: %.46 = converted %int.convert_checked.loc11_42, %.loc11_42.1 [template = constants.%.47] -// CHECK:STDOUT: %int.convert_checked.loc11_28: init %.2 = call %Uint32ToUint16.ref.loc11(%.loc11_42.2) [template = constants.%.30] -// CHECK:STDOUT: %.loc11_46.1: %.2 = value_of_initializer %int.convert_checked.loc11_28 [template = constants.%.30] -// CHECK:STDOUT: %.loc11_46.2: %.2 = converted %int.convert_checked.loc11_28, %.loc11_46.1 [template = constants.%.30] -// CHECK:STDOUT: %e: %.2 = bind_name e, %.loc11_46.2 +// CHECK:STDOUT: %.loc11_43.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_43.3: = bound_method %.loc11_43.1, %.loc11_43.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc11_43.4: = specific_function %.loc11_43.3, @Convert.2(constants.%.2) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc11_43: init %i32 = call %.loc11_43.4(%.loc11_43.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc11_43.5: %i32 = value_of_initializer %int.convert_checked.loc11_43 [template = constants.%.26] +// CHECK:STDOUT: %.loc11_43.6: %i32 = converted %.loc11_43.1, %.loc11_43.5 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc11_42: init %u32 = call %Int32ToUint32.ref.loc11(%.loc11_43.6) [template = constants.%.44] +// CHECK:STDOUT: %.loc11_42.1: %u32 = value_of_initializer %int.convert_checked.loc11_42 [template = constants.%.44] +// CHECK:STDOUT: %.loc11_42.2: %u32 = converted %int.convert_checked.loc11_42, %.loc11_42.1 [template = constants.%.44] +// CHECK:STDOUT: %int.convert_checked.loc11_28: init %u16 = call %Uint32ToUint16.ref.loc11(%.loc11_42.2) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_46.1: %u16 = value_of_initializer %int.convert_checked.loc11_28 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_46.2: %u16 = converted %int.convert_checked.loc11_28, %.loc11_46.1 [template = constants.%.27] +// CHECK:STDOUT: %e: %u16 = bind_name e, %.loc11_46.2 // CHECK:STDOUT: %Uint32ToUint16.ref.loc12: %Uint32ToUint16.type = name_ref Uint32ToUint16, imports.%import_ref.13 [template = constants.%Uint32ToUint16] // CHECK:STDOUT: %Int32ToUint32.ref.loc12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %.loc12_43.1: Core.IntLiteral = int_value 65535 [template = constants.%.31] -// CHECK:STDOUT: %.loc12_43.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_43.3: = bound_method %.loc12_43.1, %.loc12_43.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc12_43: init i32 = call %.loc12_43.3(%.loc12_43.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc12_43.4: i32 = value_of_initializer %int.convert_checked.loc12_43 [template = constants.%.33] -// CHECK:STDOUT: %.loc12_43.5: i32 = converted %.loc12_43.1, %.loc12_43.4 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc12_42: init %.46 = call %Int32ToUint32.ref.loc12(%.loc12_43.5) [template = constants.%.48] -// CHECK:STDOUT: %.loc12_42.1: %.46 = value_of_initializer %int.convert_checked.loc12_42 [template = constants.%.48] -// CHECK:STDOUT: %.loc12_42.2: %.46 = converted %int.convert_checked.loc12_42, %.loc12_42.1 [template = constants.%.48] -// CHECK:STDOUT: %int.convert_checked.loc12_28: init %.2 = call %Uint32ToUint16.ref.loc12(%.loc12_42.2) [template = constants.%.34] -// CHECK:STDOUT: %.loc12_51.1: %.2 = value_of_initializer %int.convert_checked.loc12_28 [template = constants.%.34] -// CHECK:STDOUT: %.loc12_51.2: %.2 = converted %int.convert_checked.loc12_28, %.loc12_51.1 [template = constants.%.34] -// CHECK:STDOUT: %f: %.2 = bind_name f, %.loc12_51.2 +// CHECK:STDOUT: %.loc12_43.1: Core.IntLiteral = int_value 65535 [template = constants.%.28] +// CHECK:STDOUT: %.loc12_43.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_43.3: = bound_method %.loc12_43.1, %.loc12_43.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc12_43.4: = specific_function %.loc12_43.3, @Convert.2(constants.%.2) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %.loc12_43.4(%.loc12_43.1) [template = constants.%.31] +// CHECK:STDOUT: %.loc12_43.5: %i32 = value_of_initializer %int.convert_checked.loc12_43 [template = constants.%.31] +// CHECK:STDOUT: %.loc12_43.6: %i32 = converted %.loc12_43.1, %.loc12_43.5 [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc12_42: init %u32 = call %Int32ToUint32.ref.loc12(%.loc12_43.6) [template = constants.%.45] +// CHECK:STDOUT: %.loc12_42.1: %u32 = value_of_initializer %int.convert_checked.loc12_42 [template = constants.%.45] +// CHECK:STDOUT: %.loc12_42.2: %u32 = converted %int.convert_checked.loc12_42, %.loc12_42.1 [template = constants.%.45] +// CHECK:STDOUT: %int.convert_checked.loc12_28: init %u16 = call %Uint32ToUint16.ref.loc12(%.loc12_42.2) [template = constants.%.32] +// CHECK:STDOUT: %.loc12_51.1: %u16 = value_of_initializer %int.convert_checked.loc12_28 [template = constants.%.32] +// CHECK:STDOUT: %.loc12_51.2: %u16 = converted %int.convert_checked.loc12_28, %.loc12_51.1 [template = constants.%.32] +// CHECK:STDOUT: %f: %u16 = bind_name f, %.loc12_51.2 // CHECK:STDOUT: %Uint32ToInt16.ref.loc14: %Uint32ToInt16.type = name_ref Uint32ToInt16, imports.%import_ref.12 [template = constants.%Uint32ToInt16] // CHECK:STDOUT: %Int32ToUint32.ref.loc14: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %.loc14_42.1: Core.IntLiteral = int_value 0 [template = constants.%.3] -// CHECK:STDOUT: %.loc14_42.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_42.3: = bound_method %.loc14_42.1, %.loc14_42.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc14_42: init i32 = call %.loc14_42.3(%.loc14_42.1) [template = constants.%.29] -// CHECK:STDOUT: %.loc14_42.4: i32 = value_of_initializer %int.convert_checked.loc14_42 [template = constants.%.29] -// CHECK:STDOUT: %.loc14_42.5: i32 = converted %.loc14_42.1, %.loc14_42.4 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc14_41: init %.46 = call %Int32ToUint32.ref.loc14(%.loc14_42.5) [template = constants.%.47] -// CHECK:STDOUT: %.loc14_41.1: %.46 = value_of_initializer %int.convert_checked.loc14_41 [template = constants.%.47] -// CHECK:STDOUT: %.loc14_41.2: %.46 = converted %int.convert_checked.loc14_41, %.loc14_41.1 [template = constants.%.47] -// CHECK:STDOUT: %int.convert_checked.loc14_27: init %.35 = call %Uint32ToInt16.ref.loc14(%.loc14_41.2) [template = constants.%.49] -// CHECK:STDOUT: %.loc14_45.1: %.35 = value_of_initializer %int.convert_checked.loc14_27 [template = constants.%.49] -// CHECK:STDOUT: %.loc14_45.2: %.35 = converted %int.convert_checked.loc14_27, %.loc14_45.1 [template = constants.%.49] -// CHECK:STDOUT: %g: %.35 = bind_name g, %.loc14_45.2 +// CHECK:STDOUT: %.loc14_42.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_42.3: = bound_method %.loc14_42.1, %.loc14_42.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc14_42.4: = specific_function %.loc14_42.3, @Convert.2(constants.%.2) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc14_42: init %i32 = call %.loc14_42.4(%.loc14_42.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc14_42.5: %i32 = value_of_initializer %int.convert_checked.loc14_42 [template = constants.%.26] +// CHECK:STDOUT: %.loc14_42.6: %i32 = converted %.loc14_42.1, %.loc14_42.5 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc14_41: init %u32 = call %Int32ToUint32.ref.loc14(%.loc14_42.6) [template = constants.%.44] +// CHECK:STDOUT: %.loc14_41.1: %u32 = value_of_initializer %int.convert_checked.loc14_41 [template = constants.%.44] +// CHECK:STDOUT: %.loc14_41.2: %u32 = converted %int.convert_checked.loc14_41, %.loc14_41.1 [template = constants.%.44] +// CHECK:STDOUT: %int.convert_checked.loc14_27: init %i16 = call %Uint32ToInt16.ref.loc14(%.loc14_41.2) [template = constants.%.46] +// CHECK:STDOUT: %.loc14_45.1: %i16 = value_of_initializer %int.convert_checked.loc14_27 [template = constants.%.46] +// CHECK:STDOUT: %.loc14_45.2: %i16 = converted %int.convert_checked.loc14_27, %.loc14_45.1 [template = constants.%.46] +// CHECK:STDOUT: %g: %i16 = bind_name g, %.loc14_45.2 // CHECK:STDOUT: %Uint32ToInt16.ref.loc15: %Uint32ToInt16.type = name_ref Uint32ToInt16, imports.%import_ref.12 [template = constants.%Uint32ToInt16] // CHECK:STDOUT: %Int32ToUint32.ref.loc15: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %.loc15_42.1: Core.IntLiteral = int_value 32767 [template = constants.%.36] -// CHECK:STDOUT: %.loc15_42.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_42.3: = bound_method %.loc15_42.1, %.loc15_42.2 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc15_42: init i32 = call %.loc15_42.3(%.loc15_42.1) [template = constants.%.38] -// CHECK:STDOUT: %.loc15_42.4: i32 = value_of_initializer %int.convert_checked.loc15_42 [template = constants.%.38] -// CHECK:STDOUT: %.loc15_42.5: i32 = converted %.loc15_42.1, %.loc15_42.4 [template = constants.%.38] -// CHECK:STDOUT: %int.convert_checked.loc15_41: init %.46 = call %Int32ToUint32.ref.loc15(%.loc15_42.5) [template = constants.%.50] -// CHECK:STDOUT: %.loc15_41.1: %.46 = value_of_initializer %int.convert_checked.loc15_41 [template = constants.%.50] -// CHECK:STDOUT: %.loc15_41.2: %.46 = converted %int.convert_checked.loc15_41, %.loc15_41.1 [template = constants.%.50] -// CHECK:STDOUT: %int.convert_checked.loc15_27: init %.35 = call %Uint32ToInt16.ref.loc15(%.loc15_41.2) [template = constants.%.39] -// CHECK:STDOUT: %.loc15_50.1: %.35 = value_of_initializer %int.convert_checked.loc15_27 [template = constants.%.39] -// CHECK:STDOUT: %.loc15_50.2: %.35 = converted %int.convert_checked.loc15_27, %.loc15_50.1 [template = constants.%.39] -// CHECK:STDOUT: %h: %.35 = bind_name h, %.loc15_50.2 +// CHECK:STDOUT: %.loc15_42.1: Core.IntLiteral = int_value 32767 [template = constants.%.33] +// CHECK:STDOUT: %.loc15_42.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_42.3: = bound_method %.loc15_42.1, %.loc15_42.2 [template = constants.%.34] +// CHECK:STDOUT: %.loc15_42.4: = specific_function %.loc15_42.3, @Convert.2(constants.%.2) [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc15_42: init %i32 = call %.loc15_42.4(%.loc15_42.1) [template = constants.%.36] +// CHECK:STDOUT: %.loc15_42.5: %i32 = value_of_initializer %int.convert_checked.loc15_42 [template = constants.%.36] +// CHECK:STDOUT: %.loc15_42.6: %i32 = converted %.loc15_42.1, %.loc15_42.5 [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc15_41: init %u32 = call %Int32ToUint32.ref.loc15(%.loc15_42.6) [template = constants.%.47] +// CHECK:STDOUT: %.loc15_41.1: %u32 = value_of_initializer %int.convert_checked.loc15_41 [template = constants.%.47] +// CHECK:STDOUT: %.loc15_41.2: %u32 = converted %int.convert_checked.loc15_41, %.loc15_41.1 [template = constants.%.47] +// CHECK:STDOUT: %int.convert_checked.loc15_27: init %i16 = call %Uint32ToInt16.ref.loc15(%.loc15_41.2) [template = constants.%.37] +// CHECK:STDOUT: %.loc15_50.1: %i16 = value_of_initializer %int.convert_checked.loc15_27 [template = constants.%.37] +// CHECK:STDOUT: %.loc15_50.2: %i16 = converted %int.convert_checked.loc15_27, %.loc15_50.1 [template = constants.%.37] +// CHECK:STDOUT: %h: %i16 = bind_name h, %.loc15_50.2 // CHECK:STDOUT: %IntLiteralToInt16.ref.loc17: %IntLiteralToInt16.type = name_ref IntLiteralToInt16, imports.%import_ref.14 [template = constants.%IntLiteralToInt16] // CHECK:STDOUT: %Int32ToIntLiteral.ref.loc17: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] // CHECK:STDOUT: %NegateI32.ref.loc17: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] -// CHECK:STDOUT: %.loc17_70.1: Core.IntLiteral = int_value 32768 [template = constants.%.40] -// CHECK:STDOUT: %.loc17_70.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc17_70.3: = bound_method %.loc17_70.1, %.loc17_70.2 [template = constants.%.41] -// CHECK:STDOUT: %int.convert_checked.loc17_70: init i32 = call %.loc17_70.3(%.loc17_70.1) [template = constants.%.42] -// CHECK:STDOUT: %.loc17_70.4: i32 = value_of_initializer %int.convert_checked.loc17_70 [template = constants.%.42] -// CHECK:STDOUT: %.loc17_70.5: i32 = converted %.loc17_70.1, %.loc17_70.4 [template = constants.%.42] -// CHECK:STDOUT: %int.snegate.loc17: init i32 = call %NegateI32.ref.loc17(%.loc17_70.5) [template = constants.%.43] -// CHECK:STDOUT: %.loc17_69.1: i32 = value_of_initializer %int.snegate.loc17 [template = constants.%.43] -// CHECK:STDOUT: %.loc17_69.2: i32 = converted %int.snegate.loc17, %.loc17_69.1 [template = constants.%.43] -// CHECK:STDOUT: %int.convert_checked.loc17_59: init Core.IntLiteral = call %Int32ToIntLiteral.ref.loc17(%.loc17_69.2) [template = constants.%.51] -// CHECK:STDOUT: %.loc17_59.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc17_59 [template = constants.%.51] -// CHECK:STDOUT: %.loc17_59.2: Core.IntLiteral = converted %int.convert_checked.loc17_59, %.loc17_59.1 [template = constants.%.51] -// CHECK:STDOUT: %int.convert_checked.loc17_41: init %.35 = call %IntLiteralToInt16.ref.loc17(%.loc17_59.2) [template = constants.%.44] -// CHECK:STDOUT: %.loc17_79.1: %.35 = value_of_initializer %int.convert_checked.loc17_41 [template = constants.%.44] -// CHECK:STDOUT: %.loc17_79.2: %.35 = converted %int.convert_checked.loc17_41, %.loc17_79.1 [template = constants.%.44] -// CHECK:STDOUT: %lit_i16_min: %.35 = bind_name lit_i16_min, %.loc17_79.2 +// CHECK:STDOUT: %.loc17_70.1: Core.IntLiteral = int_value 32768 [template = constants.%.38] +// CHECK:STDOUT: %.loc17_70.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc17_70.3: = bound_method %.loc17_70.1, %.loc17_70.2 [template = constants.%.39] +// CHECK:STDOUT: %.loc17_70.4: = specific_function %.loc17_70.3, @Convert.2(constants.%.2) [template = constants.%.40] +// CHECK:STDOUT: %int.convert_checked.loc17_70: init %i32 = call %.loc17_70.4(%.loc17_70.1) [template = constants.%.41] +// CHECK:STDOUT: %.loc17_70.5: %i32 = value_of_initializer %int.convert_checked.loc17_70 [template = constants.%.41] +// CHECK:STDOUT: %.loc17_70.6: %i32 = converted %.loc17_70.1, %.loc17_70.5 [template = constants.%.41] +// CHECK:STDOUT: %int.snegate.loc17: init %i32 = call %NegateI32.ref.loc17(%.loc17_70.6) [template = constants.%.42] +// CHECK:STDOUT: %.loc17_69.1: %i32 = value_of_initializer %int.snegate.loc17 [template = constants.%.42] +// CHECK:STDOUT: %.loc17_69.2: %i32 = converted %int.snegate.loc17, %.loc17_69.1 [template = constants.%.42] +// CHECK:STDOUT: %int.convert_checked.loc17_59: init Core.IntLiteral = call %Int32ToIntLiteral.ref.loc17(%.loc17_69.2) [template = constants.%.48] +// CHECK:STDOUT: %.loc17_59.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc17_59 [template = constants.%.48] +// CHECK:STDOUT: %.loc17_59.2: Core.IntLiteral = converted %int.convert_checked.loc17_59, %.loc17_59.1 [template = constants.%.48] +// CHECK:STDOUT: %int.convert_checked.loc17_41: init %i16 = call %IntLiteralToInt16.ref.loc17(%.loc17_59.2) [template = constants.%.43] +// CHECK:STDOUT: %.loc17_79.1: %i16 = value_of_initializer %int.convert_checked.loc17_41 [template = constants.%.43] +// CHECK:STDOUT: %.loc17_79.2: %i16 = converted %int.convert_checked.loc17_41, %.loc17_79.1 [template = constants.%.43] +// CHECK:STDOUT: %lit_i16_min: %i16 = bind_name lit_i16_min, %.loc17_79.2 // CHECK:STDOUT: %IntLiteralToInt16.ref.loc18: %IntLiteralToInt16.type = name_ref IntLiteralToInt16, imports.%import_ref.14 [template = constants.%IntLiteralToInt16] // CHECK:STDOUT: %Int32ToIntLiteral.ref.loc18: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] -// CHECK:STDOUT: %.loc18_60.1: Core.IntLiteral = int_value 32767 [template = constants.%.36] -// CHECK:STDOUT: %.loc18_60.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_60.3: = bound_method %.loc18_60.1, %.loc18_60.2 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc18_60: init i32 = call %.loc18_60.3(%.loc18_60.1) [template = constants.%.38] -// CHECK:STDOUT: %.loc18_60.4: i32 = value_of_initializer %int.convert_checked.loc18_60 [template = constants.%.38] -// CHECK:STDOUT: %.loc18_60.5: i32 = converted %.loc18_60.1, %.loc18_60.4 [template = constants.%.38] -// CHECK:STDOUT: %int.convert_checked.loc18_59: init Core.IntLiteral = call %Int32ToIntLiteral.ref.loc18(%.loc18_60.5) [template = constants.%.36] -// CHECK:STDOUT: %.loc18_59.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc18_59 [template = constants.%.36] -// CHECK:STDOUT: %.loc18_59.2: Core.IntLiteral = converted %int.convert_checked.loc18_59, %.loc18_59.1 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc18_41: init %.35 = call %IntLiteralToInt16.ref.loc18(%.loc18_59.2) [template = constants.%.39] -// CHECK:STDOUT: %.loc18_68.1: %.35 = value_of_initializer %int.convert_checked.loc18_41 [template = constants.%.39] -// CHECK:STDOUT: %.loc18_68.2: %.35 = converted %int.convert_checked.loc18_41, %.loc18_68.1 [template = constants.%.39] -// CHECK:STDOUT: %lit_i16_max: %.35 = bind_name lit_i16_max, %.loc18_68.2 +// CHECK:STDOUT: %.loc18_60.1: Core.IntLiteral = int_value 32767 [template = constants.%.33] +// CHECK:STDOUT: %.loc18_60.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_60.3: = bound_method %.loc18_60.1, %.loc18_60.2 [template = constants.%.34] +// CHECK:STDOUT: %.loc18_60.4: = specific_function %.loc18_60.3, @Convert.2(constants.%.2) [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc18_60: init %i32 = call %.loc18_60.4(%.loc18_60.1) [template = constants.%.36] +// CHECK:STDOUT: %.loc18_60.5: %i32 = value_of_initializer %int.convert_checked.loc18_60 [template = constants.%.36] +// CHECK:STDOUT: %.loc18_60.6: %i32 = converted %.loc18_60.1, %.loc18_60.5 [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc18_59: init Core.IntLiteral = call %Int32ToIntLiteral.ref.loc18(%.loc18_60.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc18_59.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc18_59 [template = constants.%.33] +// CHECK:STDOUT: %.loc18_59.2: Core.IntLiteral = converted %int.convert_checked.loc18_59, %.loc18_59.1 [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc18_41: init %i16 = call %IntLiteralToInt16.ref.loc18(%.loc18_59.2) [template = constants.%.37] +// CHECK:STDOUT: %.loc18_68.1: %i16 = value_of_initializer %int.convert_checked.loc18_41 [template = constants.%.37] +// CHECK:STDOUT: %.loc18_68.2: %i16 = converted %int.convert_checked.loc18_41, %.loc18_68.1 [template = constants.%.37] +// CHECK:STDOUT: %lit_i16_max: %i16 = bind_name lit_i16_max, %.loc18_68.2 // CHECK:STDOUT: %IntLiteralToUint16.ref.loc20: %IntLiteralToUint16.type = name_ref IntLiteralToUint16, imports.%import_ref.15 [template = constants.%IntLiteralToUint16] // CHECK:STDOUT: %Int32ToIntLiteral.ref.loc20: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] // CHECK:STDOUT: %.loc20_61.1: Core.IntLiteral = int_value 0 [template = constants.%.3] -// CHECK:STDOUT: %.loc20_61.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc20_61.3: = bound_method %.loc20_61.1, %.loc20_61.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc20_61: init i32 = call %.loc20_61.3(%.loc20_61.1) [template = constants.%.29] -// CHECK:STDOUT: %.loc20_61.4: i32 = value_of_initializer %int.convert_checked.loc20_61 [template = constants.%.29] -// CHECK:STDOUT: %.loc20_61.5: i32 = converted %.loc20_61.1, %.loc20_61.4 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc20_60: init Core.IntLiteral = call %Int32ToIntLiteral.ref.loc20(%.loc20_61.5) [template = constants.%.3] +// CHECK:STDOUT: %.loc20_61.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc20_61.3: = bound_method %.loc20_61.1, %.loc20_61.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc20_61.4: = specific_function %.loc20_61.3, @Convert.2(constants.%.2) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc20_61: init %i32 = call %.loc20_61.4(%.loc20_61.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc20_61.5: %i32 = value_of_initializer %int.convert_checked.loc20_61 [template = constants.%.26] +// CHECK:STDOUT: %.loc20_61.6: %i32 = converted %.loc20_61.1, %.loc20_61.5 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc20_60: init Core.IntLiteral = call %Int32ToIntLiteral.ref.loc20(%.loc20_61.6) [template = constants.%.3] // CHECK:STDOUT: %.loc20_60.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc20_60 [template = constants.%.3] // CHECK:STDOUT: %.loc20_60.2: Core.IntLiteral = converted %int.convert_checked.loc20_60, %.loc20_60.1 [template = constants.%.3] -// CHECK:STDOUT: %int.convert_checked.loc20_42: init %.2 = call %IntLiteralToUint16.ref.loc20(%.loc20_60.2) [template = constants.%.30] -// CHECK:STDOUT: %.loc20_64.1: %.2 = value_of_initializer %int.convert_checked.loc20_42 [template = constants.%.30] -// CHECK:STDOUT: %.loc20_64.2: %.2 = converted %int.convert_checked.loc20_42, %.loc20_64.1 [template = constants.%.30] -// CHECK:STDOUT: %lit_u16_min: %.2 = bind_name lit_u16_min, %.loc20_64.2 +// CHECK:STDOUT: %int.convert_checked.loc20_42: init %u16 = call %IntLiteralToUint16.ref.loc20(%.loc20_60.2) [template = constants.%.27] +// CHECK:STDOUT: %.loc20_64.1: %u16 = value_of_initializer %int.convert_checked.loc20_42 [template = constants.%.27] +// CHECK:STDOUT: %.loc20_64.2: %u16 = converted %int.convert_checked.loc20_42, %.loc20_64.1 [template = constants.%.27] +// CHECK:STDOUT: %lit_u16_min: %u16 = bind_name lit_u16_min, %.loc20_64.2 // CHECK:STDOUT: %IntLiteralToUint16.ref.loc21: %IntLiteralToUint16.type = name_ref IntLiteralToUint16, imports.%import_ref.15 [template = constants.%IntLiteralToUint16] // CHECK:STDOUT: %Int32ToIntLiteral.ref.loc21: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] -// CHECK:STDOUT: %.loc21_61.1: Core.IntLiteral = int_value 65535 [template = constants.%.31] -// CHECK:STDOUT: %.loc21_61.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc21_61.3: = bound_method %.loc21_61.1, %.loc21_61.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc21_61: init i32 = call %.loc21_61.3(%.loc21_61.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc21_61.4: i32 = value_of_initializer %int.convert_checked.loc21_61 [template = constants.%.33] -// CHECK:STDOUT: %.loc21_61.5: i32 = converted %.loc21_61.1, %.loc21_61.4 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc21_60: init Core.IntLiteral = call %Int32ToIntLiteral.ref.loc21(%.loc21_61.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc21_60.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc21_60 [template = constants.%.31] -// CHECK:STDOUT: %.loc21_60.2: Core.IntLiteral = converted %int.convert_checked.loc21_60, %.loc21_60.1 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc21_42: init %.2 = call %IntLiteralToUint16.ref.loc21(%.loc21_60.2) [template = constants.%.34] -// CHECK:STDOUT: %.loc21_69.1: %.2 = value_of_initializer %int.convert_checked.loc21_42 [template = constants.%.34] -// CHECK:STDOUT: %.loc21_69.2: %.2 = converted %int.convert_checked.loc21_42, %.loc21_69.1 [template = constants.%.34] -// CHECK:STDOUT: %lit_u16_max: %.2 = bind_name lit_u16_max, %.loc21_69.2 +// CHECK:STDOUT: %.loc21_61.1: Core.IntLiteral = int_value 65535 [template = constants.%.28] +// CHECK:STDOUT: %.loc21_61.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc21_61.3: = bound_method %.loc21_61.1, %.loc21_61.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc21_61.4: = specific_function %.loc21_61.3, @Convert.2(constants.%.2) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc21_61: init %i32 = call %.loc21_61.4(%.loc21_61.1) [template = constants.%.31] +// CHECK:STDOUT: %.loc21_61.5: %i32 = value_of_initializer %int.convert_checked.loc21_61 [template = constants.%.31] +// CHECK:STDOUT: %.loc21_61.6: %i32 = converted %.loc21_61.1, %.loc21_61.5 [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc21_60: init Core.IntLiteral = call %Int32ToIntLiteral.ref.loc21(%.loc21_61.6) [template = constants.%.28] +// CHECK:STDOUT: %.loc21_60.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc21_60 [template = constants.%.28] +// CHECK:STDOUT: %.loc21_60.2: Core.IntLiteral = converted %int.convert_checked.loc21_60, %.loc21_60.1 [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc21_42: init %u16 = call %IntLiteralToUint16.ref.loc21(%.loc21_60.2) [template = constants.%.32] +// CHECK:STDOUT: %.loc21_69.1: %u16 = value_of_initializer %int.convert_checked.loc21_42 [template = constants.%.32] +// CHECK:STDOUT: %.loc21_69.2: %u16 = converted %int.convert_checked.loc21_42, %.loc21_69.1 [template = constants.%.32] +// CHECK:STDOUT: %lit_u16_max: %u16 = bind_name lit_u16_max, %.loc21_69.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1479,70 +1526,74 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = int_type unsigned, %.1 [template] +// CHECK:STDOUT: %u64: type = int_type unsigned, %.1 [template] // CHECK:STDOUT: %Uint32ToUint64.type: type = fn_type @Uint32ToUint64 [template] // CHECK:STDOUT: %Uint32ToUint64: %Uint32ToUint64.type = struct_value () [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %.4: type = int_type unsigned, %.3 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %u32: type = int_type unsigned, %.2 [template] // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 0 [template] -// CHECK:STDOUT: %.32: %.4 = int_value 0 [template] -// CHECK:STDOUT: %.33: %.2 = int_value 0 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.2 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.2) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.27: %u32 = int_value 0 [template] +// CHECK:STDOUT: %.28: %u64 = int_value 0 [template] // CHECK:STDOUT: %AddU32.type: type = fn_type @AddU32 [template] // CHECK:STDOUT: %AddU32: %AddU32.type = struct_value () [template] -// CHECK:STDOUT: %.34: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %.35: = bound_method %.34, %Convert.15 [template] -// CHECK:STDOUT: %.36: i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %.37: %.4 = int_value 2147483647 [template] -// CHECK:STDOUT: %.38: %.4 = int_value 4294967294 [template] -// CHECK:STDOUT: %.39: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.40: = bound_method %.39, %Convert.15 [template] -// CHECK:STDOUT: %.41: i32 = int_value 1 [template] -// CHECK:STDOUT: %.42: %.4 = int_value 1 [template] -// CHECK:STDOUT: %.43: %.4 = int_value 4294967295 [template] -// CHECK:STDOUT: %.44: %.2 = int_value 4294967295 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.33: %u32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.34: %u32 = int_value 4294967294 [template] +// CHECK:STDOUT: %.35: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.36: = bound_method %.35, %Convert.14 [template] +// CHECK:STDOUT: %.37: = specific_function %.36, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.38: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.39: %u32 = int_value 1 [template] +// CHECK:STDOUT: %.40: %u32 = int_value 4294967295 [template] +// CHECK:STDOUT: %.41: %u64 = int_value 4294967295 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %.45: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %i64: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Uint32ToInt64.type: type = fn_type @Uint32ToInt64 [template] // CHECK:STDOUT: %Uint32ToInt64: %Uint32ToInt64.type = struct_value () [template] -// CHECK:STDOUT: %.46: %.45 = int_value 0 [template] -// CHECK:STDOUT: %.47: %.45 = int_value 4294967295 [template] +// CHECK:STDOUT: %.42: %i64 = int_value 0 [template] +// CHECK:STDOUT: %.43: %i64 = int_value 4294967295 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+25, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+49, unloaded -// CHECK:STDOUT: %import_ref.3: %AddU32.type = import_ref Main//int_ops, inst+89, loaded [template = constants.%AddU32] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+96, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+113, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+131, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+149, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+168, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+187, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+218, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+237, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+256, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+275, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+294, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+313, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+352, unloaded -// CHECK:STDOUT: %import_ref.18: %Uint32ToInt64.type = import_ref Main//int_ops, inst+371, loaded [template = constants.%Uint32ToInt64] -// CHECK:STDOUT: %import_ref.19: %Uint32ToUint64.type = import_ref Main//int_ops, inst+390, loaded [template = constants.%Uint32ToUint64] -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+408, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+427, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+33, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+60, unloaded +// CHECK:STDOUT: %import_ref.3: %AddU32.type = import_ref Main//int_ops, inst+99, loaded [template = constants.%AddU32] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+106, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+125, unloaded +// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+144, loaded [template = constants.%Int32ToUint32] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+163, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+182, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+201, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+222, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+242, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+261, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+280, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+299, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+318, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+339, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+359, unloaded +// CHECK:STDOUT: %import_ref.18: %Uint32ToInt64.type = import_ref Main//int_ops, inst+378, loaded [template = constants.%Uint32ToInt64] +// CHECK:STDOUT: %import_ref.19: %Uint32ToUint64.type = import_ref Main//int_ops, inst+397, loaded [template = constants.%Uint32ToUint64] +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+416, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+435, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 -// CHECK:STDOUT: .Int = %import_ref.72 +// CHECK:STDOUT: .Int = %import_ref.59 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1580,149 +1631,157 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc5_8.1: Core.IntLiteral = int_value 64 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc5: init type = call constants.%UInt(%.loc5_8.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc5_8.2: type = value_of_initializer %int.make_type_unsigned.loc5 [template = constants.%.2] -// CHECK:STDOUT: %.loc5_8.3: type = converted %int.make_type_unsigned.loc5, %.loc5_8.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned.loc5: init type = call constants.%UInt(%.loc5_8.1) [template = constants.%u64] +// CHECK:STDOUT: %.loc5_8.2: type = value_of_initializer %int.make_type_unsigned.loc5 [template = constants.%u64] +// CHECK:STDOUT: %.loc5_8.3: type = converted %int.make_type_unsigned.loc5, %.loc5_8.2 [template = constants.%u64] // CHECK:STDOUT: %.loc6_8.1: Core.IntLiteral = int_value 64 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc6: init type = call constants.%UInt(%.loc6_8.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc6_8.2: type = value_of_initializer %int.make_type_unsigned.loc6 [template = constants.%.2] -// CHECK:STDOUT: %.loc6_8.3: type = converted %int.make_type_unsigned.loc6, %.loc6_8.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned.loc6: init type = call constants.%UInt(%.loc6_8.1) [template = constants.%u64] +// CHECK:STDOUT: %.loc6_8.2: type = value_of_initializer %int.make_type_unsigned.loc6 [template = constants.%u64] +// CHECK:STDOUT: %.loc6_8.3: type = converted %int.make_type_unsigned.loc6, %.loc6_8.2 [template = constants.%u64] // CHECK:STDOUT: %.loc11_8.1: Core.IntLiteral = int_value 64 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_8.1) [template = constants.%.45] -// CHECK:STDOUT: %.loc11_8.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%.45] -// CHECK:STDOUT: %.loc11_8.3: type = converted %int.make_type_signed.loc11, %.loc11_8.2 [template = constants.%.45] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_8.1) [template = constants.%i64] +// CHECK:STDOUT: %.loc11_8.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i64] +// CHECK:STDOUT: %.loc11_8.3: type = converted %int.make_type_signed.loc11, %.loc11_8.2 [template = constants.%i64] // CHECK:STDOUT: %.loc12_8.1: Core.IntLiteral = int_value 64 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_8.1) [template = constants.%.45] -// CHECK:STDOUT: %.loc12_8.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%.45] -// CHECK:STDOUT: %.loc12_8.3: type = converted %int.make_type_signed.loc12, %.loc12_8.2 [template = constants.%.45] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_8.1) [template = constants.%i64] +// CHECK:STDOUT: %.loc12_8.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i64] +// CHECK:STDOUT: %.loc12_8.3: type = converted %int.make_type_signed.loc12, %.loc12_8.2 [template = constants.%i64] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToUint64(%a.param_patt: %.4) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @Uint32ToUint64(%a.param_patt: %u32) -> %u64 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: i32) -> %.4 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AddU32(%a.param_patt: %.4, %b.param_patt: %.4) -> %.4 = "int.uadd"; +// CHECK:STDOUT: fn @AddU32(%a.param_patt: %u32, %b.param_patt: %u32) -> %u32 = "int.uadd"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToInt64(%a.param_patt: %.4) -> %.45 = "int.convert_checked"; +// CHECK:STDOUT: fn @Uint32ToInt64(%a.param_patt: %u32) -> %i64 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Uint32ToUint64.ref.loc5: %Uint32ToUint64.type = name_ref Uint32ToUint64, imports.%import_ref.19 [template = constants.%Uint32ToUint64] // CHECK:STDOUT: %Int32ToUint32.ref.loc5: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %.loc5_43.1: Core.IntLiteral = int_value 0 [template = constants.%.5] -// CHECK:STDOUT: %.loc5_43.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc5_43.3: = bound_method %.loc5_43.1, %.loc5_43.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc5_43: init i32 = call %.loc5_43.3(%.loc5_43.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc5_43.4: i32 = value_of_initializer %int.convert_checked.loc5_43 [template = constants.%.31] -// CHECK:STDOUT: %.loc5_43.5: i32 = converted %.loc5_43.1, %.loc5_43.4 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc5_42: init %.4 = call %Int32ToUint32.ref.loc5(%.loc5_43.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc5_42.1: %.4 = value_of_initializer %int.convert_checked.loc5_42 [template = constants.%.32] -// CHECK:STDOUT: %.loc5_42.2: %.4 = converted %int.convert_checked.loc5_42, %.loc5_42.1 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc5_28: init %.2 = call %Uint32ToUint64.ref.loc5(%.loc5_42.2) [template = constants.%.33] -// CHECK:STDOUT: %.loc5_46.1: %.2 = value_of_initializer %int.convert_checked.loc5_28 [template = constants.%.33] -// CHECK:STDOUT: %.loc5_46.2: %.2 = converted %int.convert_checked.loc5_28, %.loc5_46.1 [template = constants.%.33] -// CHECK:STDOUT: %a: %.2 = bind_name a, %.loc5_46.2 +// CHECK:STDOUT: %.loc5_43.1: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_43.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc5_43.3: = bound_method %.loc5_43.1, %.loc5_43.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc5_43.4: = specific_function %.loc5_43.3, @Convert.2(constants.%.2) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc5_43: init %i32 = call %.loc5_43.4(%.loc5_43.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc5_43.5: %i32 = value_of_initializer %int.convert_checked.loc5_43 [template = constants.%.26] +// CHECK:STDOUT: %.loc5_43.6: %i32 = converted %.loc5_43.1, %.loc5_43.5 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc5_42: init %u32 = call %Int32ToUint32.ref.loc5(%.loc5_43.6) [template = constants.%.27] +// CHECK:STDOUT: %.loc5_42.1: %u32 = value_of_initializer %int.convert_checked.loc5_42 [template = constants.%.27] +// CHECK:STDOUT: %.loc5_42.2: %u32 = converted %int.convert_checked.loc5_42, %.loc5_42.1 [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc5_28: init %u64 = call %Uint32ToUint64.ref.loc5(%.loc5_42.2) [template = constants.%.28] +// CHECK:STDOUT: %.loc5_46.1: %u64 = value_of_initializer %int.convert_checked.loc5_28 [template = constants.%.28] +// CHECK:STDOUT: %.loc5_46.2: %u64 = converted %int.convert_checked.loc5_28, %.loc5_46.1 [template = constants.%.28] +// CHECK:STDOUT: %a: %u64 = bind_name a, %.loc5_46.2 // CHECK:STDOUT: %Uint32ToUint64.ref.loc6: %Uint32ToUint64.type = name_ref Uint32ToUint64, imports.%import_ref.19 [template = constants.%Uint32ToUint64] // CHECK:STDOUT: %AddU32.ref.loc7: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32] // CHECK:STDOUT: %AddU32.ref.loc8: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32] // CHECK:STDOUT: %Int32ToUint32.ref.loc8_12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %.loc8_26.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.34] -// CHECK:STDOUT: %.loc8_26.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_26.3: = bound_method %.loc8_26.1, %.loc8_26.2 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc8_26: init i32 = call %.loc8_26.3(%.loc8_26.1) [template = constants.%.36] -// CHECK:STDOUT: %.loc8_26.4: i32 = value_of_initializer %int.convert_checked.loc8_26 [template = constants.%.36] -// CHECK:STDOUT: %.loc8_26.5: i32 = converted %.loc8_26.1, %.loc8_26.4 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc8_25: init %.4 = call %Int32ToUint32.ref.loc8_12(%.loc8_26.5) [template = constants.%.37] +// CHECK:STDOUT: %.loc8_26.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.29] +// CHECK:STDOUT: %.loc8_26.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_26.3: = bound_method %.loc8_26.1, %.loc8_26.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc8_26.4: = specific_function %.loc8_26.3, @Convert.2(constants.%.2) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc8_26: init %i32 = call %.loc8_26.4(%.loc8_26.1) [template = constants.%.32] +// CHECK:STDOUT: %.loc8_26.5: %i32 = value_of_initializer %int.convert_checked.loc8_26 [template = constants.%.32] +// CHECK:STDOUT: %.loc8_26.6: %i32 = converted %.loc8_26.1, %.loc8_26.5 [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc8_25: init %u32 = call %Int32ToUint32.ref.loc8_12(%.loc8_26.6) [template = constants.%.33] // CHECK:STDOUT: %Int32ToUint32.ref.loc8_40: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %.loc8_54.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.34] -// CHECK:STDOUT: %.loc8_54.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_54.3: = bound_method %.loc8_54.1, %.loc8_54.2 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc8_54: init i32 = call %.loc8_54.3(%.loc8_54.1) [template = constants.%.36] -// CHECK:STDOUT: %.loc8_54.4: i32 = value_of_initializer %int.convert_checked.loc8_54 [template = constants.%.36] -// CHECK:STDOUT: %.loc8_54.5: i32 = converted %.loc8_54.1, %.loc8_54.4 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc8_53: init %.4 = call %Int32ToUint32.ref.loc8_40(%.loc8_54.5) [template = constants.%.37] -// CHECK:STDOUT: %.loc8_25.1: %.4 = value_of_initializer %int.convert_checked.loc8_25 [template = constants.%.37] -// CHECK:STDOUT: %.loc8_25.2: %.4 = converted %int.convert_checked.loc8_25, %.loc8_25.1 [template = constants.%.37] -// CHECK:STDOUT: %.loc8_53.1: %.4 = value_of_initializer %int.convert_checked.loc8_53 [template = constants.%.37] -// CHECK:STDOUT: %.loc8_53.2: %.4 = converted %int.convert_checked.loc8_53, %.loc8_53.1 [template = constants.%.37] -// CHECK:STDOUT: %int.uadd.loc8: init %.4 = call %AddU32.ref.loc8(%.loc8_25.2, %.loc8_53.2) [template = constants.%.38] +// CHECK:STDOUT: %.loc8_54.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.29] +// CHECK:STDOUT: %.loc8_54.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_54.3: = bound_method %.loc8_54.1, %.loc8_54.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc8_54.4: = specific_function %.loc8_54.3, @Convert.2(constants.%.2) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc8_54: init %i32 = call %.loc8_54.4(%.loc8_54.1) [template = constants.%.32] +// CHECK:STDOUT: %.loc8_54.5: %i32 = value_of_initializer %int.convert_checked.loc8_54 [template = constants.%.32] +// CHECK:STDOUT: %.loc8_54.6: %i32 = converted %.loc8_54.1, %.loc8_54.5 [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc8_53: init %u32 = call %Int32ToUint32.ref.loc8_40(%.loc8_54.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc8_25.1: %u32 = value_of_initializer %int.convert_checked.loc8_25 [template = constants.%.33] +// CHECK:STDOUT: %.loc8_25.2: %u32 = converted %int.convert_checked.loc8_25, %.loc8_25.1 [template = constants.%.33] +// CHECK:STDOUT: %.loc8_53.1: %u32 = value_of_initializer %int.convert_checked.loc8_53 [template = constants.%.33] +// CHECK:STDOUT: %.loc8_53.2: %u32 = converted %int.convert_checked.loc8_53, %.loc8_53.1 [template = constants.%.33] +// CHECK:STDOUT: %int.uadd.loc8: init %u32 = call %AddU32.ref.loc8(%.loc8_25.2, %.loc8_53.2) [template = constants.%.34] // CHECK:STDOUT: %Int32ToUint32.ref.loc9: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %.loc9_19.1: Core.IntLiteral = int_value 1 [template = constants.%.39] -// CHECK:STDOUT: %.loc9_19.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_19.3: = bound_method %.loc9_19.1, %.loc9_19.2 [template = constants.%.40] -// CHECK:STDOUT: %int.convert_checked.loc9_19: init i32 = call %.loc9_19.3(%.loc9_19.1) [template = constants.%.41] -// CHECK:STDOUT: %.loc9_19.4: i32 = value_of_initializer %int.convert_checked.loc9_19 [template = constants.%.41] -// CHECK:STDOUT: %.loc9_19.5: i32 = converted %.loc9_19.1, %.loc9_19.4 [template = constants.%.41] -// CHECK:STDOUT: %int.convert_checked.loc9_18: init %.4 = call %Int32ToUint32.ref.loc9(%.loc9_19.5) [template = constants.%.42] -// CHECK:STDOUT: %.loc8_11.1: %.4 = value_of_initializer %int.uadd.loc8 [template = constants.%.38] -// CHECK:STDOUT: %.loc8_11.2: %.4 = converted %int.uadd.loc8, %.loc8_11.1 [template = constants.%.38] -// CHECK:STDOUT: %.loc9_18.1: %.4 = value_of_initializer %int.convert_checked.loc9_18 [template = constants.%.42] -// CHECK:STDOUT: %.loc9_18.2: %.4 = converted %int.convert_checked.loc9_18, %.loc9_18.1 [template = constants.%.42] -// CHECK:STDOUT: %int.uadd.loc7: init %.4 = call %AddU32.ref.loc7(%.loc8_11.2, %.loc9_18.2) [template = constants.%.43] -// CHECK:STDOUT: %.loc7_9.1: %.4 = value_of_initializer %int.uadd.loc7 [template = constants.%.43] -// CHECK:STDOUT: %.loc7_9.2: %.4 = converted %int.uadd.loc7, %.loc7_9.1 [template = constants.%.43] -// CHECK:STDOUT: %int.convert_checked.loc6: init %.2 = call %Uint32ToUint64.ref.loc6(%.loc7_9.2) [template = constants.%.44] -// CHECK:STDOUT: %.loc9_23.1: %.2 = value_of_initializer %int.convert_checked.loc6 [template = constants.%.44] -// CHECK:STDOUT: %.loc9_23.2: %.2 = converted %int.convert_checked.loc6, %.loc9_23.1 [template = constants.%.44] -// CHECK:STDOUT: %b: %.2 = bind_name b, %.loc9_23.2 +// CHECK:STDOUT: %.loc9_19.1: Core.IntLiteral = int_value 1 [template = constants.%.35] +// CHECK:STDOUT: %.loc9_19.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_19.3: = bound_method %.loc9_19.1, %.loc9_19.2 [template = constants.%.36] +// CHECK:STDOUT: %.loc9_19.4: = specific_function %.loc9_19.3, @Convert.2(constants.%.2) [template = constants.%.37] +// CHECK:STDOUT: %int.convert_checked.loc9_19: init %i32 = call %.loc9_19.4(%.loc9_19.1) [template = constants.%.38] +// CHECK:STDOUT: %.loc9_19.5: %i32 = value_of_initializer %int.convert_checked.loc9_19 [template = constants.%.38] +// CHECK:STDOUT: %.loc9_19.6: %i32 = converted %.loc9_19.1, %.loc9_19.5 [template = constants.%.38] +// CHECK:STDOUT: %int.convert_checked.loc9_18: init %u32 = call %Int32ToUint32.ref.loc9(%.loc9_19.6) [template = constants.%.39] +// CHECK:STDOUT: %.loc8_11.1: %u32 = value_of_initializer %int.uadd.loc8 [template = constants.%.34] +// CHECK:STDOUT: %.loc8_11.2: %u32 = converted %int.uadd.loc8, %.loc8_11.1 [template = constants.%.34] +// CHECK:STDOUT: %.loc9_18.1: %u32 = value_of_initializer %int.convert_checked.loc9_18 [template = constants.%.39] +// CHECK:STDOUT: %.loc9_18.2: %u32 = converted %int.convert_checked.loc9_18, %.loc9_18.1 [template = constants.%.39] +// CHECK:STDOUT: %int.uadd.loc7: init %u32 = call %AddU32.ref.loc7(%.loc8_11.2, %.loc9_18.2) [template = constants.%.40] +// CHECK:STDOUT: %.loc7_9.1: %u32 = value_of_initializer %int.uadd.loc7 [template = constants.%.40] +// CHECK:STDOUT: %.loc7_9.2: %u32 = converted %int.uadd.loc7, %.loc7_9.1 [template = constants.%.40] +// CHECK:STDOUT: %int.convert_checked.loc6: init %u64 = call %Uint32ToUint64.ref.loc6(%.loc7_9.2) [template = constants.%.41] +// CHECK:STDOUT: %.loc9_23.1: %u64 = value_of_initializer %int.convert_checked.loc6 [template = constants.%.41] +// CHECK:STDOUT: %.loc9_23.2: %u64 = converted %int.convert_checked.loc6, %.loc9_23.1 [template = constants.%.41] +// CHECK:STDOUT: %b: %u64 = bind_name b, %.loc9_23.2 // CHECK:STDOUT: %Uint32ToInt64.ref.loc11: %Uint32ToInt64.type = name_ref Uint32ToInt64, imports.%import_ref.18 [template = constants.%Uint32ToInt64] // CHECK:STDOUT: %Int32ToUint32.ref.loc11: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %.loc11_42.1: Core.IntLiteral = int_value 0 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_42.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_42.3: = bound_method %.loc11_42.1, %.loc11_42.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_42: init i32 = call %.loc11_42.3(%.loc11_42.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_42.4: i32 = value_of_initializer %int.convert_checked.loc11_42 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_42.5: i32 = converted %.loc11_42.1, %.loc11_42.4 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc11_41: init %.4 = call %Int32ToUint32.ref.loc11(%.loc11_42.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc11_41.1: %.4 = value_of_initializer %int.convert_checked.loc11_41 [template = constants.%.32] -// CHECK:STDOUT: %.loc11_41.2: %.4 = converted %int.convert_checked.loc11_41, %.loc11_41.1 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc11_27: init %.45 = call %Uint32ToInt64.ref.loc11(%.loc11_41.2) [template = constants.%.46] -// CHECK:STDOUT: %.loc11_45.1: %.45 = value_of_initializer %int.convert_checked.loc11_27 [template = constants.%.46] -// CHECK:STDOUT: %.loc11_45.2: %.45 = converted %int.convert_checked.loc11_27, %.loc11_45.1 [template = constants.%.46] -// CHECK:STDOUT: %c: %.45 = bind_name c, %.loc11_45.2 +// CHECK:STDOUT: %.loc11_42.1: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_42.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_42.3: = bound_method %.loc11_42.1, %.loc11_42.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc11_42.4: = specific_function %.loc11_42.3, @Convert.2(constants.%.2) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc11_42: init %i32 = call %.loc11_42.4(%.loc11_42.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc11_42.5: %i32 = value_of_initializer %int.convert_checked.loc11_42 [template = constants.%.26] +// CHECK:STDOUT: %.loc11_42.6: %i32 = converted %.loc11_42.1, %.loc11_42.5 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc11_41: init %u32 = call %Int32ToUint32.ref.loc11(%.loc11_42.6) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_41.1: %u32 = value_of_initializer %int.convert_checked.loc11_41 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_41.2: %u32 = converted %int.convert_checked.loc11_41, %.loc11_41.1 [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc11_27: init %i64 = call %Uint32ToInt64.ref.loc11(%.loc11_41.2) [template = constants.%.42] +// CHECK:STDOUT: %.loc11_45.1: %i64 = value_of_initializer %int.convert_checked.loc11_27 [template = constants.%.42] +// CHECK:STDOUT: %.loc11_45.2: %i64 = converted %int.convert_checked.loc11_27, %.loc11_45.1 [template = constants.%.42] +// CHECK:STDOUT: %c: %i64 = bind_name c, %.loc11_45.2 // CHECK:STDOUT: %Uint32ToInt64.ref.loc12: %Uint32ToInt64.type = name_ref Uint32ToInt64, imports.%import_ref.18 [template = constants.%Uint32ToInt64] // CHECK:STDOUT: %AddU32.ref.loc13: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32] // CHECK:STDOUT: %AddU32.ref.loc14: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32] // CHECK:STDOUT: %Int32ToUint32.ref.loc14_12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %.loc14_26.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.34] -// CHECK:STDOUT: %.loc14_26.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_26.3: = bound_method %.loc14_26.1, %.loc14_26.2 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc14_26: init i32 = call %.loc14_26.3(%.loc14_26.1) [template = constants.%.36] -// CHECK:STDOUT: %.loc14_26.4: i32 = value_of_initializer %int.convert_checked.loc14_26 [template = constants.%.36] -// CHECK:STDOUT: %.loc14_26.5: i32 = converted %.loc14_26.1, %.loc14_26.4 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc14_25: init %.4 = call %Int32ToUint32.ref.loc14_12(%.loc14_26.5) [template = constants.%.37] +// CHECK:STDOUT: %.loc14_26.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.29] +// CHECK:STDOUT: %.loc14_26.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_26.3: = bound_method %.loc14_26.1, %.loc14_26.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_26.4: = specific_function %.loc14_26.3, @Convert.2(constants.%.2) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc14_26: init %i32 = call %.loc14_26.4(%.loc14_26.1) [template = constants.%.32] +// CHECK:STDOUT: %.loc14_26.5: %i32 = value_of_initializer %int.convert_checked.loc14_26 [template = constants.%.32] +// CHECK:STDOUT: %.loc14_26.6: %i32 = converted %.loc14_26.1, %.loc14_26.5 [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc14_25: init %u32 = call %Int32ToUint32.ref.loc14_12(%.loc14_26.6) [template = constants.%.33] // CHECK:STDOUT: %Int32ToUint32.ref.loc14_40: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %.loc14_54.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.34] -// CHECK:STDOUT: %.loc14_54.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_54.3: = bound_method %.loc14_54.1, %.loc14_54.2 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc14_54: init i32 = call %.loc14_54.3(%.loc14_54.1) [template = constants.%.36] -// CHECK:STDOUT: %.loc14_54.4: i32 = value_of_initializer %int.convert_checked.loc14_54 [template = constants.%.36] -// CHECK:STDOUT: %.loc14_54.5: i32 = converted %.loc14_54.1, %.loc14_54.4 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc14_53: init %.4 = call %Int32ToUint32.ref.loc14_40(%.loc14_54.5) [template = constants.%.37] -// CHECK:STDOUT: %.loc14_25.1: %.4 = value_of_initializer %int.convert_checked.loc14_25 [template = constants.%.37] -// CHECK:STDOUT: %.loc14_25.2: %.4 = converted %int.convert_checked.loc14_25, %.loc14_25.1 [template = constants.%.37] -// CHECK:STDOUT: %.loc14_53.1: %.4 = value_of_initializer %int.convert_checked.loc14_53 [template = constants.%.37] -// CHECK:STDOUT: %.loc14_53.2: %.4 = converted %int.convert_checked.loc14_53, %.loc14_53.1 [template = constants.%.37] -// CHECK:STDOUT: %int.uadd.loc14: init %.4 = call %AddU32.ref.loc14(%.loc14_25.2, %.loc14_53.2) [template = constants.%.38] +// CHECK:STDOUT: %.loc14_54.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.29] +// CHECK:STDOUT: %.loc14_54.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_54.3: = bound_method %.loc14_54.1, %.loc14_54.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_54.4: = specific_function %.loc14_54.3, @Convert.2(constants.%.2) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc14_54: init %i32 = call %.loc14_54.4(%.loc14_54.1) [template = constants.%.32] +// CHECK:STDOUT: %.loc14_54.5: %i32 = value_of_initializer %int.convert_checked.loc14_54 [template = constants.%.32] +// CHECK:STDOUT: %.loc14_54.6: %i32 = converted %.loc14_54.1, %.loc14_54.5 [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc14_53: init %u32 = call %Int32ToUint32.ref.loc14_40(%.loc14_54.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc14_25.1: %u32 = value_of_initializer %int.convert_checked.loc14_25 [template = constants.%.33] +// CHECK:STDOUT: %.loc14_25.2: %u32 = converted %int.convert_checked.loc14_25, %.loc14_25.1 [template = constants.%.33] +// CHECK:STDOUT: %.loc14_53.1: %u32 = value_of_initializer %int.convert_checked.loc14_53 [template = constants.%.33] +// CHECK:STDOUT: %.loc14_53.2: %u32 = converted %int.convert_checked.loc14_53, %.loc14_53.1 [template = constants.%.33] +// CHECK:STDOUT: %int.uadd.loc14: init %u32 = call %AddU32.ref.loc14(%.loc14_25.2, %.loc14_53.2) [template = constants.%.34] // CHECK:STDOUT: %Int32ToUint32.ref.loc15: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %.loc15_19.1: Core.IntLiteral = int_value 1 [template = constants.%.39] -// CHECK:STDOUT: %.loc15_19.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_19.3: = bound_method %.loc15_19.1, %.loc15_19.2 [template = constants.%.40] -// CHECK:STDOUT: %int.convert_checked.loc15_19: init i32 = call %.loc15_19.3(%.loc15_19.1) [template = constants.%.41] -// CHECK:STDOUT: %.loc15_19.4: i32 = value_of_initializer %int.convert_checked.loc15_19 [template = constants.%.41] -// CHECK:STDOUT: %.loc15_19.5: i32 = converted %.loc15_19.1, %.loc15_19.4 [template = constants.%.41] -// CHECK:STDOUT: %int.convert_checked.loc15_18: init %.4 = call %Int32ToUint32.ref.loc15(%.loc15_19.5) [template = constants.%.42] -// CHECK:STDOUT: %.loc14_11.1: %.4 = value_of_initializer %int.uadd.loc14 [template = constants.%.38] -// CHECK:STDOUT: %.loc14_11.2: %.4 = converted %int.uadd.loc14, %.loc14_11.1 [template = constants.%.38] -// CHECK:STDOUT: %.loc15_18.1: %.4 = value_of_initializer %int.convert_checked.loc15_18 [template = constants.%.42] -// CHECK:STDOUT: %.loc15_18.2: %.4 = converted %int.convert_checked.loc15_18, %.loc15_18.1 [template = constants.%.42] -// CHECK:STDOUT: %int.uadd.loc13: init %.4 = call %AddU32.ref.loc13(%.loc14_11.2, %.loc15_18.2) [template = constants.%.43] -// CHECK:STDOUT: %.loc13_9.1: %.4 = value_of_initializer %int.uadd.loc13 [template = constants.%.43] -// CHECK:STDOUT: %.loc13_9.2: %.4 = converted %int.uadd.loc13, %.loc13_9.1 [template = constants.%.43] -// CHECK:STDOUT: %int.convert_checked.loc12: init %.45 = call %Uint32ToInt64.ref.loc12(%.loc13_9.2) [template = constants.%.47] -// CHECK:STDOUT: %.loc15_23.1: %.45 = value_of_initializer %int.convert_checked.loc12 [template = constants.%.47] -// CHECK:STDOUT: %.loc15_23.2: %.45 = converted %int.convert_checked.loc12, %.loc15_23.1 [template = constants.%.47] -// CHECK:STDOUT: %d: %.45 = bind_name d, %.loc15_23.2 +// CHECK:STDOUT: %.loc15_19.1: Core.IntLiteral = int_value 1 [template = constants.%.35] +// CHECK:STDOUT: %.loc15_19.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_19.3: = bound_method %.loc15_19.1, %.loc15_19.2 [template = constants.%.36] +// CHECK:STDOUT: %.loc15_19.4: = specific_function %.loc15_19.3, @Convert.2(constants.%.2) [template = constants.%.37] +// CHECK:STDOUT: %int.convert_checked.loc15_19: init %i32 = call %.loc15_19.4(%.loc15_19.1) [template = constants.%.38] +// CHECK:STDOUT: %.loc15_19.5: %i32 = value_of_initializer %int.convert_checked.loc15_19 [template = constants.%.38] +// CHECK:STDOUT: %.loc15_19.6: %i32 = converted %.loc15_19.1, %.loc15_19.5 [template = constants.%.38] +// CHECK:STDOUT: %int.convert_checked.loc15_18: init %u32 = call %Int32ToUint32.ref.loc15(%.loc15_19.6) [template = constants.%.39] +// CHECK:STDOUT: %.loc14_11.1: %u32 = value_of_initializer %int.uadd.loc14 [template = constants.%.34] +// CHECK:STDOUT: %.loc14_11.2: %u32 = converted %int.uadd.loc14, %.loc14_11.1 [template = constants.%.34] +// CHECK:STDOUT: %.loc15_18.1: %u32 = value_of_initializer %int.convert_checked.loc15_18 [template = constants.%.39] +// CHECK:STDOUT: %.loc15_18.2: %u32 = converted %int.convert_checked.loc15_18, %.loc15_18.1 [template = constants.%.39] +// CHECK:STDOUT: %int.uadd.loc13: init %u32 = call %AddU32.ref.loc13(%.loc14_11.2, %.loc15_18.2) [template = constants.%.40] +// CHECK:STDOUT: %.loc13_9.1: %u32 = value_of_initializer %int.uadd.loc13 [template = constants.%.40] +// CHECK:STDOUT: %.loc13_9.2: %u32 = converted %int.uadd.loc13, %.loc13_9.1 [template = constants.%.40] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i64 = call %Uint32ToInt64.ref.loc12(%.loc13_9.2) [template = constants.%.43] +// CHECK:STDOUT: %.loc15_23.1: %i64 = value_of_initializer %int.convert_checked.loc12 [template = constants.%.43] +// CHECK:STDOUT: %.loc15_23.2: %i64 = converted %int.convert_checked.loc12, %.loc15_23.1 [template = constants.%.43] +// CHECK:STDOUT: %d: %i64 = bind_name d, %.loc15_23.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1732,65 +1791,70 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = int_type unsigned, %.1 [template] +// CHECK:STDOUT: %u64: type = int_type unsigned, %.1 [template] // CHECK:STDOUT: %Int32ToUint64.type: type = fn_type @Int32ToUint64 [template] // CHECK:STDOUT: %Int32ToUint64: %Int32ToUint64.type = struct_value () [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.2 [template] // CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 0 [template] -// CHECK:STDOUT: %.30: %.2 = int_value 0 [template] -// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %.32: = bound_method %.31, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %.34: %.2 = int_value 2147483647 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.2) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.27: %u64 = int_value 0 [template] +// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.14 [template] +// CHECK:STDOUT: %.30: = specific_function %.29, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.31: %i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.32: %u64 = int_value 2147483647 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %.35: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %i64: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Int32ToInt64.type: type = fn_type @Int32ToInt64 [template] // CHECK:STDOUT: %Int32ToInt64: %Int32ToInt64.type = struct_value () [template] // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template] // CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template] // CHECK:STDOUT: %NegateI32.type: type = fn_type @NegateI32 [template] // CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template] -// CHECK:STDOUT: %.36: i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %.37: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.38: = bound_method %.37, %Convert.15 [template] -// CHECK:STDOUT: %.39: i32 = int_value 1 [template] -// CHECK:STDOUT: %.40: i32 = int_value -2147483648 [template] -// CHECK:STDOUT: %.41: %.35 = int_value -2147483648 [template] -// CHECK:STDOUT: %.42: %.35 = int_value 2147483647 [template] +// CHECK:STDOUT: %.33: %i32 = int_value -2147483647 [template] +// CHECK:STDOUT: %.34: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.35: = bound_method %.34, %Convert.14 [template] +// CHECK:STDOUT: %.36: = specific_function %.35, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.37: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.38: %i32 = int_value -2147483648 [template] +// CHECK:STDOUT: %.39: %i64 = int_value -2147483648 [template] +// CHECK:STDOUT: %.40: %i64 = int_value 2147483647 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, inst+25, loaded [template = constants.%NegateI32] -// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, inst+49, loaded [template = constants.%SubI32] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+89, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+96, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+113, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+131, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+149, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+168, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+187, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+218, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+237, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+256, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+275, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+294, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+313, unloaded -// CHECK:STDOUT: %import_ref.16: %Int32ToInt64.type = import_ref Main//int_ops, inst+333, loaded [template = constants.%Int32ToInt64] -// CHECK:STDOUT: %import_ref.17: %Int32ToUint64.type = import_ref Main//int_ops, inst+352, loaded [template = constants.%Int32ToUint64] -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+371, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+390, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+408, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+427, unloaded +// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, inst+33, loaded [template = constants.%NegateI32] +// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, inst+60, loaded [template = constants.%SubI32] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+99, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+106, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+125, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+144, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+163, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+182, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+201, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+222, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+242, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+261, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+280, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+299, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+318, unloaded +// CHECK:STDOUT: %import_ref.16: %Int32ToInt64.type = import_ref Main//int_ops, inst+339, loaded [template = constants.%Int32ToInt64] +// CHECK:STDOUT: %import_ref.17: %Int32ToUint64.type = import_ref Main//int_ops, inst+359, loaded [template = constants.%Int32ToUint64] +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+378, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+397, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+416, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+435, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 -// CHECK:STDOUT: .Int = %import_ref.72 +// CHECK:STDOUT: .Int = %import_ref.59 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1828,147 +1892,155 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc5_8.1: Core.IntLiteral = int_value 64 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc5: init type = call constants.%UInt(%.loc5_8.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc5_8.2: type = value_of_initializer %int.make_type_unsigned.loc5 [template = constants.%.2] -// CHECK:STDOUT: %.loc5_8.3: type = converted %int.make_type_unsigned.loc5, %.loc5_8.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned.loc5: init type = call constants.%UInt(%.loc5_8.1) [template = constants.%u64] +// CHECK:STDOUT: %.loc5_8.2: type = value_of_initializer %int.make_type_unsigned.loc5 [template = constants.%u64] +// CHECK:STDOUT: %.loc5_8.3: type = converted %int.make_type_unsigned.loc5, %.loc5_8.2 [template = constants.%u64] // CHECK:STDOUT: %.loc6_8.1: Core.IntLiteral = int_value 64 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned.loc6: init type = call constants.%UInt(%.loc6_8.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc6_8.2: type = value_of_initializer %int.make_type_unsigned.loc6 [template = constants.%.2] -// CHECK:STDOUT: %.loc6_8.3: type = converted %int.make_type_unsigned.loc6, %.loc6_8.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned.loc6: init type = call constants.%UInt(%.loc6_8.1) [template = constants.%u64] +// CHECK:STDOUT: %.loc6_8.2: type = value_of_initializer %int.make_type_unsigned.loc6 [template = constants.%u64] +// CHECK:STDOUT: %.loc6_8.3: type = converted %int.make_type_unsigned.loc6, %.loc6_8.2 [template = constants.%u64] // CHECK:STDOUT: %.loc8_8.1: Core.IntLiteral = int_value 64 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_8.1) [template = constants.%.35] -// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%.35] -// CHECK:STDOUT: %.loc8_8.3: type = converted %int.make_type_signed.loc8, %.loc8_8.2 [template = constants.%.35] +// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_8.1) [template = constants.%i64] +// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i64] +// CHECK:STDOUT: %.loc8_8.3: type = converted %int.make_type_signed.loc8, %.loc8_8.2 [template = constants.%i64] // CHECK:STDOUT: %.loc9_8.1: Core.IntLiteral = int_value 64 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%.loc9_8.1) [template = constants.%.35] -// CHECK:STDOUT: %.loc9_8.2: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%.35] -// CHECK:STDOUT: %.loc9_8.3: type = converted %int.make_type_signed.loc9, %.loc9_8.2 [template = constants.%.35] +// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%.loc9_8.1) [template = constants.%i64] +// CHECK:STDOUT: %.loc9_8.2: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i64] +// CHECK:STDOUT: %.loc9_8.3: type = converted %int.make_type_signed.loc9, %.loc9_8.2 [template = constants.%i64] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint64(%a.param_patt: i32) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToUint64(%a.param_patt: %i32) -> %u64 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt64(%a.param_patt: i32) -> %.35 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToInt64(%a.param_patt: %i32) -> %i64 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubI32(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.ssub"; +// CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @NegateI32(%a.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @NegateI32(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToUint64.ref.loc5: %Int32ToUint64.type = name_ref Int32ToUint64, imports.%import_ref.17 [template = constants.%Int32ToUint64] // CHECK:STDOUT: %.loc5_28.1: Core.IntLiteral = int_value 0 [template = constants.%.3] -// CHECK:STDOUT: %.loc5_28.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc5_28.3: = bound_method %.loc5_28.1, %.loc5_28.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc5_28: init i32 = call %.loc5_28.3(%.loc5_28.1) [template = constants.%.29] -// CHECK:STDOUT: %.loc5_28.4: i32 = value_of_initializer %int.convert_checked.loc5_28 [template = constants.%.29] -// CHECK:STDOUT: %.loc5_28.5: i32 = converted %.loc5_28.1, %.loc5_28.4 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc5_27: init %.2 = call %Int32ToUint64.ref.loc5(%.loc5_28.5) [template = constants.%.30] -// CHECK:STDOUT: %.loc5_30.1: %.2 = value_of_initializer %int.convert_checked.loc5_27 [template = constants.%.30] -// CHECK:STDOUT: %.loc5_30.2: %.2 = converted %int.convert_checked.loc5_27, %.loc5_30.1 [template = constants.%.30] -// CHECK:STDOUT: %a: %.2 = bind_name a, %.loc5_30.2 +// CHECK:STDOUT: %.loc5_28.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc5_28.3: = bound_method %.loc5_28.1, %.loc5_28.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc5_28.4: = specific_function %.loc5_28.3, @Convert.2(constants.%.2) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc5_28: init %i32 = call %.loc5_28.4(%.loc5_28.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc5_28.5: %i32 = value_of_initializer %int.convert_checked.loc5_28 [template = constants.%.26] +// CHECK:STDOUT: %.loc5_28.6: %i32 = converted %.loc5_28.1, %.loc5_28.5 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc5_27: init %u64 = call %Int32ToUint64.ref.loc5(%.loc5_28.6) [template = constants.%.27] +// CHECK:STDOUT: %.loc5_30.1: %u64 = value_of_initializer %int.convert_checked.loc5_27 [template = constants.%.27] +// CHECK:STDOUT: %.loc5_30.2: %u64 = converted %int.convert_checked.loc5_27, %.loc5_30.1 [template = constants.%.27] +// CHECK:STDOUT: %a: %u64 = bind_name a, %.loc5_30.2 // CHECK:STDOUT: %Int32ToUint64.ref.loc6: %Int32ToUint64.type = name_ref Int32ToUint64, imports.%import_ref.17 [template = constants.%Int32ToUint64] -// CHECK:STDOUT: %.loc6_28.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.31] -// CHECK:STDOUT: %.loc6_28.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_28.3: = bound_method %.loc6_28.1, %.loc6_28.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc6_28: init i32 = call %.loc6_28.3(%.loc6_28.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc6_28.4: i32 = value_of_initializer %int.convert_checked.loc6_28 [template = constants.%.33] -// CHECK:STDOUT: %.loc6_28.5: i32 = converted %.loc6_28.1, %.loc6_28.4 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc6_27: init %.2 = call %Int32ToUint64.ref.loc6(%.loc6_28.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc6_40.1: %.2 = value_of_initializer %int.convert_checked.loc6_27 [template = constants.%.34] -// CHECK:STDOUT: %.loc6_40.2: %.2 = converted %int.convert_checked.loc6_27, %.loc6_40.1 [template = constants.%.34] -// CHECK:STDOUT: %b: %.2 = bind_name b, %.loc6_40.2 +// CHECK:STDOUT: %.loc6_28.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.28] +// CHECK:STDOUT: %.loc6_28.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_28.3: = bound_method %.loc6_28.1, %.loc6_28.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc6_28.4: = specific_function %.loc6_28.3, @Convert.2(constants.%.2) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %.loc6_28.4(%.loc6_28.1) [template = constants.%.31] +// CHECK:STDOUT: %.loc6_28.5: %i32 = value_of_initializer %int.convert_checked.loc6_28 [template = constants.%.31] +// CHECK:STDOUT: %.loc6_28.6: %i32 = converted %.loc6_28.1, %.loc6_28.5 [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc6_27: init %u64 = call %Int32ToUint64.ref.loc6(%.loc6_28.6) [template = constants.%.32] +// CHECK:STDOUT: %.loc6_40.1: %u64 = value_of_initializer %int.convert_checked.loc6_27 [template = constants.%.32] +// CHECK:STDOUT: %.loc6_40.2: %u64 = converted %int.convert_checked.loc6_27, %.loc6_40.1 [template = constants.%.32] +// CHECK:STDOUT: %b: %u64 = bind_name b, %.loc6_40.2 // CHECK:STDOUT: %Int32ToInt64.ref.loc8: %Int32ToInt64.type = name_ref Int32ToInt64, imports.%import_ref.16 [template = constants.%Int32ToInt64] // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] // CHECK:STDOUT: %NegateI32.ref: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] -// CHECK:STDOUT: %.loc8_44.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.31] -// CHECK:STDOUT: %.loc8_44.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_44.3: = bound_method %.loc8_44.1, %.loc8_44.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc8_44: init i32 = call %.loc8_44.3(%.loc8_44.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc8_44.4: i32 = value_of_initializer %int.convert_checked.loc8_44 [template = constants.%.33] -// CHECK:STDOUT: %.loc8_44.5: i32 = converted %.loc8_44.1, %.loc8_44.4 [template = constants.%.33] -// CHECK:STDOUT: %int.snegate: init i32 = call %NegateI32.ref(%.loc8_44.5) [template = constants.%.36] -// CHECK:STDOUT: %.loc8_58.1: Core.IntLiteral = int_value 1 [template = constants.%.37] -// CHECK:STDOUT: %.loc8_43.1: i32 = value_of_initializer %int.snegate [template = constants.%.36] -// CHECK:STDOUT: %.loc8_43.2: i32 = converted %int.snegate, %.loc8_43.1 [template = constants.%.36] -// CHECK:STDOUT: %.loc8_58.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_58.3: = bound_method %.loc8_58.1, %.loc8_58.2 [template = constants.%.38] -// CHECK:STDOUT: %int.convert_checked.loc8_58: init i32 = call %.loc8_58.3(%.loc8_58.1) [template = constants.%.39] -// CHECK:STDOUT: %.loc8_58.4: i32 = value_of_initializer %int.convert_checked.loc8_58 [template = constants.%.39] -// CHECK:STDOUT: %.loc8_58.5: i32 = converted %.loc8_58.1, %.loc8_58.4 [template = constants.%.39] -// CHECK:STDOUT: %int.ssub: init i32 = call %SubI32.ref(%.loc8_43.2, %.loc8_58.5) [template = constants.%.40] -// CHECK:STDOUT: %.loc8_33.1: i32 = value_of_initializer %int.ssub [template = constants.%.40] -// CHECK:STDOUT: %.loc8_33.2: i32 = converted %int.ssub, %.loc8_33.1 [template = constants.%.40] -// CHECK:STDOUT: %int.convert_checked.loc8_26: init %.35 = call %Int32ToInt64.ref.loc8(%.loc8_33.2) [template = constants.%.41] -// CHECK:STDOUT: %.loc8_61.1: %.35 = value_of_initializer %int.convert_checked.loc8_26 [template = constants.%.41] -// CHECK:STDOUT: %.loc8_61.2: %.35 = converted %int.convert_checked.loc8_26, %.loc8_61.1 [template = constants.%.41] -// CHECK:STDOUT: %c: %.35 = bind_name c, %.loc8_61.2 +// CHECK:STDOUT: %.loc8_44.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.28] +// CHECK:STDOUT: %.loc8_44.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_44.3: = bound_method %.loc8_44.1, %.loc8_44.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc8_44.4: = specific_function %.loc8_44.3, @Convert.2(constants.%.2) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc8_44: init %i32 = call %.loc8_44.4(%.loc8_44.1) [template = constants.%.31] +// CHECK:STDOUT: %.loc8_44.5: %i32 = value_of_initializer %int.convert_checked.loc8_44 [template = constants.%.31] +// CHECK:STDOUT: %.loc8_44.6: %i32 = converted %.loc8_44.1, %.loc8_44.5 [template = constants.%.31] +// CHECK:STDOUT: %int.snegate: init %i32 = call %NegateI32.ref(%.loc8_44.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc8_58.1: Core.IntLiteral = int_value 1 [template = constants.%.34] +// CHECK:STDOUT: %.loc8_43.1: %i32 = value_of_initializer %int.snegate [template = constants.%.33] +// CHECK:STDOUT: %.loc8_43.2: %i32 = converted %int.snegate, %.loc8_43.1 [template = constants.%.33] +// CHECK:STDOUT: %.loc8_58.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_58.3: = bound_method %.loc8_58.1, %.loc8_58.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc8_58.4: = specific_function %.loc8_58.3, @Convert.2(constants.%.2) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc8_58: init %i32 = call %.loc8_58.4(%.loc8_58.1) [template = constants.%.37] +// CHECK:STDOUT: %.loc8_58.5: %i32 = value_of_initializer %int.convert_checked.loc8_58 [template = constants.%.37] +// CHECK:STDOUT: %.loc8_58.6: %i32 = converted %.loc8_58.1, %.loc8_58.5 [template = constants.%.37] +// CHECK:STDOUT: %int.ssub: init %i32 = call %SubI32.ref(%.loc8_43.2, %.loc8_58.6) [template = constants.%.38] +// CHECK:STDOUT: %.loc8_33.1: %i32 = value_of_initializer %int.ssub [template = constants.%.38] +// CHECK:STDOUT: %.loc8_33.2: %i32 = converted %int.ssub, %.loc8_33.1 [template = constants.%.38] +// CHECK:STDOUT: %int.convert_checked.loc8_26: init %i64 = call %Int32ToInt64.ref.loc8(%.loc8_33.2) [template = constants.%.39] +// CHECK:STDOUT: %.loc8_61.1: %i64 = value_of_initializer %int.convert_checked.loc8_26 [template = constants.%.39] +// CHECK:STDOUT: %.loc8_61.2: %i64 = converted %int.convert_checked.loc8_26, %.loc8_61.1 [template = constants.%.39] +// CHECK:STDOUT: %c: %i64 = bind_name c, %.loc8_61.2 // CHECK:STDOUT: %Int32ToInt64.ref.loc9: %Int32ToInt64.type = name_ref Int32ToInt64, imports.%import_ref.16 [template = constants.%Int32ToInt64] -// CHECK:STDOUT: %.loc9_27.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_27.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_27.3: = bound_method %.loc9_27.1, %.loc9_27.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc9_27: init i32 = call %.loc9_27.3(%.loc9_27.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc9_27.4: i32 = value_of_initializer %int.convert_checked.loc9_27 [template = constants.%.33] -// CHECK:STDOUT: %.loc9_27.5: i32 = converted %.loc9_27.1, %.loc9_27.4 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc9_26: init %.35 = call %Int32ToInt64.ref.loc9(%.loc9_27.5) [template = constants.%.42] -// CHECK:STDOUT: %.loc9_39.1: %.35 = value_of_initializer %int.convert_checked.loc9_26 [template = constants.%.42] -// CHECK:STDOUT: %.loc9_39.2: %.35 = converted %int.convert_checked.loc9_26, %.loc9_39.1 [template = constants.%.42] -// CHECK:STDOUT: %d: %.35 = bind_name d, %.loc9_39.2 +// CHECK:STDOUT: %.loc9_27.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.28] +// CHECK:STDOUT: %.loc9_27.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_27.3: = bound_method %.loc9_27.1, %.loc9_27.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc9_27.4: = specific_function %.loc9_27.3, @Convert.2(constants.%.2) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc9_27: init %i32 = call %.loc9_27.4(%.loc9_27.1) [template = constants.%.31] +// CHECK:STDOUT: %.loc9_27.5: %i32 = value_of_initializer %int.convert_checked.loc9_27 [template = constants.%.31] +// CHECK:STDOUT: %.loc9_27.6: %i32 = converted %.loc9_27.1, %.loc9_27.5 [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc9_26: init %i64 = call %Int32ToInt64.ref.loc9(%.loc9_27.6) [template = constants.%.40] +// CHECK:STDOUT: %.loc9_39.1: %i64 = value_of_initializer %int.convert_checked.loc9_26 [template = constants.%.40] +// CHECK:STDOUT: %.loc9_39.2: %i64 = converted %int.convert_checked.loc9_26, %.loc9_39.1 [template = constants.%.40] +// CHECK:STDOUT: %d: %i64 = bind_name d, %.loc9_39.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_too_large_u32_for_i32.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Uint32ToInt32.type: type = fn_type @Uint32ToInt32 [template] // CHECK:STDOUT: %Uint32ToInt32: %Uint32ToInt32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %.2: type = int_type unsigned, %.1 [template] +// CHECK:STDOUT: %u32: type = int_type unsigned, %.1 [template] // CHECK:STDOUT: %AddU32.type: type = fn_type @AddU32 [template] // CHECK:STDOUT: %AddU32: %AddU32.type = struct_value () [template] // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %.30: %.2 = int_value 2147483647 [template] -// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.32: = bound_method %.31, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 1 [template] -// CHECK:STDOUT: %.34: %.2 = int_value 1 [template] -// CHECK:STDOUT: %.35: %.2 = int_value 2147483648 [template] -// CHECK:STDOUT: %.36: i32 = int_value 2147483648 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.26: %u32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: %u32 = int_value 1 [template] +// CHECK:STDOUT: %.32: %u32 = int_value 2147483648 [template] +// CHECK:STDOUT: %.33: %i32 = int_value 2147483648 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+25, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+49, unloaded -// CHECK:STDOUT: %import_ref.3: %AddU32.type = import_ref Main//int_ops, inst+89, loaded [template = constants.%AddU32] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+96, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+113, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+131, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7: %Uint32ToInt32.type = import_ref Main//int_ops, inst+149, loaded [template = constants.%Uint32ToInt32] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+168, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+187, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+218, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+237, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+256, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+275, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+294, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+313, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+352, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+371, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+390, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+408, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+427, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+33, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+60, unloaded +// CHECK:STDOUT: %import_ref.3: %AddU32.type = import_ref Main//int_ops, inst+99, loaded [template = constants.%AddU32] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+106, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+125, unloaded +// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+144, loaded [template = constants.%Int32ToUint32] +// CHECK:STDOUT: %import_ref.7: %Uint32ToInt32.type = import_ref Main//int_ops, inst+163, loaded [template = constants.%Uint32ToInt32] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+182, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+201, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+222, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+242, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+261, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+280, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+299, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+318, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+339, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+359, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+378, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+397, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+416, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+435, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.22 +// CHECK:STDOUT: .Int = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -2003,48 +2075,51 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_32, %.loc5_19.1 [template = i32] +// CHECK:STDOUT: %.loc5_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc5_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.3: type = converted %int.make_type_signed, %.loc5_19.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToInt32(%a.param_patt: %.2) -> i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @Uint32ToInt32(%a.param_patt: %u32) -> %i32 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AddU32(%a.param_patt: %.2, %b.param_patt: %.2) -> %.2 = "int.uadd"; +// CHECK:STDOUT: fn @AddU32(%a.param_patt: %u32, %b.param_patt: %u32) -> %u32 = "int.uadd"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: i32) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Uint32ToInt32.ref: %Uint32ToInt32.type = name_ref Uint32ToInt32, imports.%import_ref.7 [template = constants.%Uint32ToInt32] // CHECK:STDOUT: %AddU32.ref: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32] // CHECK:STDOUT: %Int32ToUint32.ref.loc11: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %.loc11_26.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.3] -// CHECK:STDOUT: %.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_26.3: = bound_method %.loc11_26.1, %.loc11_26.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc11_26: init i32 = call %.loc11_26.3(%.loc11_26.1) [template = constants.%.29] -// CHECK:STDOUT: %.loc11_26.4: i32 = value_of_initializer %int.convert_checked.loc11_26 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_26.5: i32 = converted %.loc11_26.1, %.loc11_26.4 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc11_25: init %.2 = call %Int32ToUint32.ref.loc11(%.loc11_26.5) [template = constants.%.30] +// CHECK:STDOUT: %.loc11_26.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_26.3: = bound_method %.loc11_26.1, %.loc11_26.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc11_26.4: = specific_function %.loc11_26.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc11_26: init %i32 = call %.loc11_26.4(%.loc11_26.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc11_26.5: %i32 = value_of_initializer %int.convert_checked.loc11_26 [template = constants.%.25] +// CHECK:STDOUT: %.loc11_26.6: %i32 = converted %.loc11_26.1, %.loc11_26.5 [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc11_25: init %u32 = call %Int32ToUint32.ref.loc11(%.loc11_26.6) [template = constants.%.26] // CHECK:STDOUT: %Int32ToUint32.ref.loc12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %.loc12_26.1: Core.IntLiteral = int_value 1 [template = constants.%.31] -// CHECK:STDOUT: %.loc12_26.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_26.3: = bound_method %.loc12_26.1, %.loc12_26.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc12_26: init i32 = call %.loc12_26.3(%.loc12_26.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc12_26.4: i32 = value_of_initializer %int.convert_checked.loc12_26 [template = constants.%.33] -// CHECK:STDOUT: %.loc12_26.5: i32 = converted %.loc12_26.1, %.loc12_26.4 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc12_25: init %.2 = call %Int32ToUint32.ref.loc12(%.loc12_26.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc11_25.1: %.2 = value_of_initializer %int.convert_checked.loc11_25 [template = constants.%.30] -// CHECK:STDOUT: %.loc11_25.2: %.2 = converted %int.convert_checked.loc11_25, %.loc11_25.1 [template = constants.%.30] -// CHECK:STDOUT: %.loc12_25.1: %.2 = value_of_initializer %int.convert_checked.loc12_25 [template = constants.%.34] -// CHECK:STDOUT: %.loc12_25.2: %.2 = converted %int.convert_checked.loc12_25, %.loc12_25.1 [template = constants.%.34] -// CHECK:STDOUT: %int.uadd: init %.2 = call %AddU32.ref(%.loc11_25.2, %.loc12_25.2) [template = constants.%.35] -// CHECK:STDOUT: %.loc11_11.1: %.2 = value_of_initializer %int.uadd [template = constants.%.35] -// CHECK:STDOUT: %.loc11_11.2: %.2 = converted %int.uadd, %.loc11_11.1 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc10: init i32 = call %Uint32ToInt32.ref(%.loc11_11.2) [template = constants.%.36] -// CHECK:STDOUT: %.loc12_30.1: i32 = value_of_initializer %int.convert_checked.loc10 [template = constants.%.36] -// CHECK:STDOUT: %.loc12_30.2: i32 = converted %int.convert_checked.loc10, %.loc12_30.1 [template = constants.%.36] -// CHECK:STDOUT: %max_plus_one: i32 = bind_name max_plus_one, %.loc12_30.2 +// CHECK:STDOUT: %.loc12_26.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_26.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_26.3: = bound_method %.loc12_26.1, %.loc12_26.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc12_26.4: = specific_function %.loc12_26.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc12_26: init %i32 = call %.loc12_26.4(%.loc12_26.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc12_26.5: %i32 = value_of_initializer %int.convert_checked.loc12_26 [template = constants.%.30] +// CHECK:STDOUT: %.loc12_26.6: %i32 = converted %.loc12_26.1, %.loc12_26.5 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc12_25: init %u32 = call %Int32ToUint32.ref.loc12(%.loc12_26.6) [template = constants.%.31] +// CHECK:STDOUT: %.loc11_25.1: %u32 = value_of_initializer %int.convert_checked.loc11_25 [template = constants.%.26] +// CHECK:STDOUT: %.loc11_25.2: %u32 = converted %int.convert_checked.loc11_25, %.loc11_25.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_25.1: %u32 = value_of_initializer %int.convert_checked.loc12_25 [template = constants.%.31] +// CHECK:STDOUT: %.loc12_25.2: %u32 = converted %int.convert_checked.loc12_25, %.loc12_25.1 [template = constants.%.31] +// CHECK:STDOUT: %int.uadd: init %u32 = call %AddU32.ref(%.loc11_25.2, %.loc12_25.2) [template = constants.%.32] +// CHECK:STDOUT: %.loc11_11.1: %u32 = value_of_initializer %int.uadd [template = constants.%.32] +// CHECK:STDOUT: %.loc11_11.2: %u32 = converted %int.uadd, %.loc11_11.1 [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc10: init %i32 = call %Uint32ToInt32.ref(%.loc11_11.2) [template = constants.%.33] +// CHECK:STDOUT: %.loc12_30.1: %i32 = value_of_initializer %int.convert_checked.loc10 [template = constants.%.33] +// CHECK:STDOUT: %.loc12_30.2: %i32 = converted %int.convert_checked.loc10, %.loc12_30.1 [template = constants.%.33] +// CHECK:STDOUT: %max_plus_one: %i32 = bind_name max_plus_one, %.loc12_30.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2054,41 +2129,44 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 16 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %i16: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template] // CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.2 [template] // CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32768 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 32768 [template] -// CHECK:STDOUT: %.30: %.2 = int_value 32768 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.2) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 32768 [template] +// CHECK:STDOUT: %.27: %i16 = int_value 32768 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+25, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+49, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+89, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+96, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+113, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+131, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+149, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+168, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+187, unloaded -// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, inst+218, loaded [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+237, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+256, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+275, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+294, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+313, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+352, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+371, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+390, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+408, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+427, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+33, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+60, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+99, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+106, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+125, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+144, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+163, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+182, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+201, unloaded +// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, inst+222, loaded [template = constants.%Int32ToInt16] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+242, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+261, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+280, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+299, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+318, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+339, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+359, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+378, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+397, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+416, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+435, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -2126,26 +2204,27 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc9_19.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc9_19.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc9_19.2: type = value_of_initializer %int.make_type_signed [template = constants.%.2] -// CHECK:STDOUT: %.loc9_19.3: type = converted %int.make_type_signed, %.loc9_19.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc9_19.1) [template = constants.%i16] +// CHECK:STDOUT: %.loc9_19.2: type = value_of_initializer %int.make_type_signed [template = constants.%i16] +// CHECK:STDOUT: %.loc9_19.3: type = converted %int.make_type_signed, %.loc9_19.2 [template = constants.%i16] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: i32) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToInt16.ref: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] // CHECK:STDOUT: %.loc9_38.1: Core.IntLiteral = int_value 32768 [template = constants.%.3] -// CHECK:STDOUT: %.loc9_38.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_38.3: = bound_method %.loc9_38.1, %.loc9_38.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc9_38: init i32 = call %.loc9_38.3(%.loc9_38.1) [template = constants.%.29] -// CHECK:STDOUT: %.loc9_38.4: i32 = value_of_initializer %int.convert_checked.loc9_38 [template = constants.%.29] -// CHECK:STDOUT: %.loc9_38.5: i32 = converted %.loc9_38.1, %.loc9_38.4 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc9_37: init %.2 = call %Int32ToInt16.ref(%.loc9_38.5) [template = constants.%.30] -// CHECK:STDOUT: %.loc9_45.1: %.2 = value_of_initializer %int.convert_checked.loc9_37 [template = constants.%.30] -// CHECK:STDOUT: %.loc9_45.2: %.2 = converted %int.convert_checked.loc9_37, %.loc9_45.1 [template = constants.%.30] -// CHECK:STDOUT: %max_plus_one: %.2 = bind_name max_plus_one, %.loc9_45.2 +// CHECK:STDOUT: %.loc9_38.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_38.3: = bound_method %.loc9_38.1, %.loc9_38.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc9_38.4: = specific_function %.loc9_38.3, @Convert.2(constants.%.2) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc9_38: init %i32 = call %.loc9_38.4(%.loc9_38.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc9_38.5: %i32 = value_of_initializer %int.convert_checked.loc9_38 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_38.6: %i32 = converted %.loc9_38.1, %.loc9_38.5 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc9_37: init %i16 = call %Int32ToInt16.ref(%.loc9_38.6) [template = constants.%.27] +// CHECK:STDOUT: %.loc9_45.1: %i16 = value_of_initializer %int.convert_checked.loc9_37 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_45.2: %i16 = converted %int.convert_checked.loc9_37, %.loc9_45.1 [template = constants.%.27] +// CHECK:STDOUT: %max_plus_one: %i16 = bind_name max_plus_one, %.loc9_45.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2155,41 +2234,44 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 16 [template] // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = int_type unsigned, %.1 [template] +// CHECK:STDOUT: %u16: type = int_type unsigned, %.1 [template] // CHECK:STDOUT: %Int32ToUint16.type: type = fn_type @Int32ToUint16 [template] // CHECK:STDOUT: %Int32ToUint16: %Int32ToUint16.type = struct_value () [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.2 [template] // CHECK:STDOUT: %.3: Core.IntLiteral = int_value 65536 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 65536 [template] -// CHECK:STDOUT: %.30: %.2 = int_value 65536 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.2) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 65536 [template] +// CHECK:STDOUT: %.27: %u16 = int_value 65536 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+25, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+49, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+89, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+96, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+113, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+131, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+149, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+168, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+187, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+218, unloaded -// CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, inst+237, loaded [template = constants.%Int32ToUint16] -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+256, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+275, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+294, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+313, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+352, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+371, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+390, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+408, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+427, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+33, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+60, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+99, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+106, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+125, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+144, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+163, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+182, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+201, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+222, unloaded +// CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, inst+242, loaded [template = constants.%Int32ToUint16] +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+261, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+280, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+299, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+318, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+339, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+359, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+378, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+397, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+416, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+435, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -2227,26 +2309,27 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc9_19.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc9_19.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc9_19.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%.2] -// CHECK:STDOUT: %.loc9_19.3: type = converted %int.make_type_unsigned, %.loc9_19.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc9_19.1) [template = constants.%u16] +// CHECK:STDOUT: %.loc9_19.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%u16] +// CHECK:STDOUT: %.loc9_19.3: type = converted %int.make_type_unsigned, %.loc9_19.2 [template = constants.%u16] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: i32) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToUint16.ref: %Int32ToUint16.type = name_ref Int32ToUint16, imports.%import_ref.11 [template = constants.%Int32ToUint16] // CHECK:STDOUT: %.loc9_39.1: Core.IntLiteral = int_value 65536 [template = constants.%.3] -// CHECK:STDOUT: %.loc9_39.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_39.3: = bound_method %.loc9_39.1, %.loc9_39.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc9_39: init i32 = call %.loc9_39.3(%.loc9_39.1) [template = constants.%.29] -// CHECK:STDOUT: %.loc9_39.4: i32 = value_of_initializer %int.convert_checked.loc9_39 [template = constants.%.29] -// CHECK:STDOUT: %.loc9_39.5: i32 = converted %.loc9_39.1, %.loc9_39.4 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc9_38: init %.2 = call %Int32ToUint16.ref(%.loc9_39.5) [template = constants.%.30] -// CHECK:STDOUT: %.loc9_48.1: %.2 = value_of_initializer %int.convert_checked.loc9_38 [template = constants.%.30] -// CHECK:STDOUT: %.loc9_48.2: %.2 = converted %int.convert_checked.loc9_38, %.loc9_48.1 [template = constants.%.30] -// CHECK:STDOUT: %max_plus_one: %.2 = bind_name max_plus_one, %.loc9_48.2 +// CHECK:STDOUT: %.loc9_39.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_39.3: = bound_method %.loc9_39.1, %.loc9_39.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc9_39.4: = specific_function %.loc9_39.3, @Convert.2(constants.%.2) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc9_39: init %i32 = call %.loc9_39.4(%.loc9_39.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc9_39.5: %i32 = value_of_initializer %int.convert_checked.loc9_39 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_39.6: %i32 = converted %.loc9_39.1, %.loc9_39.5 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc9_38: init %u16 = call %Int32ToUint16.ref(%.loc9_39.6) [template = constants.%.27] +// CHECK:STDOUT: %.loc9_48.1: %u16 = value_of_initializer %int.convert_checked.loc9_38 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_48.2: %u16 = converted %int.convert_checked.loc9_38, %.loc9_48.1 [template = constants.%.27] +// CHECK:STDOUT: %max_plus_one: %u16 = bind_name max_plus_one, %.loc9_48.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2256,46 +2339,48 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 16 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %i16: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Uint32ToInt16.type: type = fn_type @Uint32ToInt16 [template] // CHECK:STDOUT: %Uint32ToInt16: %Uint32ToInt16.type = struct_value () [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %.4: type = int_type unsigned, %.3 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %u32: type = int_type unsigned, %.2 [template] // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 32768 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 32768 [template] -// CHECK:STDOUT: %.32: %.4 = int_value 32768 [template] -// CHECK:STDOUT: %.33: %.2 = int_value 32768 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.2 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32768 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.2) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 32768 [template] +// CHECK:STDOUT: %.27: %u32 = int_value 32768 [template] +// CHECK:STDOUT: %.28: %i16 = int_value 32768 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+25, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+49, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+89, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+96, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+113, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+131, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+149, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+168, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+187, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+218, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+237, unloaded -// CHECK:STDOUT: %import_ref.12: %Uint32ToInt16.type = import_ref Main//int_ops, inst+256, loaded [template = constants.%Uint32ToInt16] -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+275, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+294, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+313, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+352, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+371, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+390, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+408, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+427, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+33, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+60, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+99, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+106, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+125, unloaded +// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+144, loaded [template = constants.%Int32ToUint32] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+163, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+182, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+201, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+222, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+242, unloaded +// CHECK:STDOUT: %import_ref.12: %Uint32ToInt16.type = import_ref Main//int_ops, inst+261, loaded [template = constants.%Uint32ToInt16] +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+280, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+299, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+318, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+339, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+359, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+378, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+397, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+416, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+435, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -2333,32 +2418,33 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc9_19.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc9_19.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc9_19.2: type = value_of_initializer %int.make_type_signed [template = constants.%.2] -// CHECK:STDOUT: %.loc9_19.3: type = converted %int.make_type_signed, %.loc9_19.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc9_19.1) [template = constants.%i16] +// CHECK:STDOUT: %.loc9_19.2: type = value_of_initializer %int.make_type_signed [template = constants.%i16] +// CHECK:STDOUT: %.loc9_19.3: type = converted %int.make_type_signed, %.loc9_19.2 [template = constants.%i16] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToInt16(%a.param_patt: %.4) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @Uint32ToInt16(%a.param_patt: %u32) -> %i16 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: i32) -> %.4 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Uint32ToInt16.ref: %Uint32ToInt16.type = name_ref Uint32ToInt16, imports.%import_ref.12 [template = constants.%Uint32ToInt16] // CHECK:STDOUT: %Int32ToUint32.ref: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %.loc9_53.1: Core.IntLiteral = int_value 32768 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_53.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_53.3: = bound_method %.loc9_53.1, %.loc9_53.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc9_53: init i32 = call %.loc9_53.3(%.loc9_53.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc9_53.4: i32 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_53.5: i32 = converted %.loc9_53.1, %.loc9_53.4 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc9_52: init %.4 = call %Int32ToUint32.ref(%.loc9_53.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc9_52.1: %.4 = value_of_initializer %int.convert_checked.loc9_52 [template = constants.%.32] -// CHECK:STDOUT: %.loc9_52.2: %.4 = converted %int.convert_checked.loc9_52, %.loc9_52.1 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc9_38: init %.2 = call %Uint32ToInt16.ref(%.loc9_52.2) [template = constants.%.33] -// CHECK:STDOUT: %.loc9_61.1: %.2 = value_of_initializer %int.convert_checked.loc9_38 [template = constants.%.33] -// CHECK:STDOUT: %.loc9_61.2: %.2 = converted %int.convert_checked.loc9_38, %.loc9_61.1 [template = constants.%.33] -// CHECK:STDOUT: %max_plus_one: %.2 = bind_name max_plus_one, %.loc9_61.2 +// CHECK:STDOUT: %.loc9_53.1: Core.IntLiteral = int_value 32768 [template = constants.%.3] +// CHECK:STDOUT: %.loc9_53.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_53.3: = bound_method %.loc9_53.1, %.loc9_53.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc9_53.4: = specific_function %.loc9_53.3, @Convert.2(constants.%.2) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %.loc9_53.4(%.loc9_53.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc9_53.5: %i32 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_53.6: %i32 = converted %.loc9_53.1, %.loc9_53.5 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc9_52: init %u32 = call %Int32ToUint32.ref(%.loc9_53.6) [template = constants.%.27] +// CHECK:STDOUT: %.loc9_52.1: %u32 = value_of_initializer %int.convert_checked.loc9_52 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_52.2: %u32 = converted %int.convert_checked.loc9_52, %.loc9_52.1 [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc9_38: init %i16 = call %Uint32ToInt16.ref(%.loc9_52.2) [template = constants.%.28] +// CHECK:STDOUT: %.loc9_61.1: %i16 = value_of_initializer %int.convert_checked.loc9_38 [template = constants.%.28] +// CHECK:STDOUT: %.loc9_61.2: %i16 = converted %int.convert_checked.loc9_38, %.loc9_61.1 [template = constants.%.28] +// CHECK:STDOUT: %max_plus_one: %i16 = bind_name max_plus_one, %.loc9_61.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2368,46 +2454,48 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 16 [template] // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = int_type unsigned, %.1 [template] +// CHECK:STDOUT: %u16: type = int_type unsigned, %.1 [template] // CHECK:STDOUT: %Uint32ToUint16.type: type = fn_type @Uint32ToUint16 [template] // CHECK:STDOUT: %Uint32ToUint16: %Uint32ToUint16.type = struct_value () [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %.4: type = int_type unsigned, %.3 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %u32: type = int_type unsigned, %.2 [template] // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 65536 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 65536 [template] -// CHECK:STDOUT: %.32: %.4 = int_value 65536 [template] -// CHECK:STDOUT: %.33: %.2 = int_value 65536 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.2 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 65536 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.2) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 65536 [template] +// CHECK:STDOUT: %.27: %u32 = int_value 65536 [template] +// CHECK:STDOUT: %.28: %u16 = int_value 65536 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+25, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+49, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+89, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+96, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+113, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+131, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+149, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+168, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+187, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+218, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+237, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+256, unloaded -// CHECK:STDOUT: %import_ref.13: %Uint32ToUint16.type = import_ref Main//int_ops, inst+275, loaded [template = constants.%Uint32ToUint16] -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+294, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+313, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+352, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+371, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+390, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+408, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+427, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+33, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+60, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+99, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+106, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+125, unloaded +// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+144, loaded [template = constants.%Int32ToUint32] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+163, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+182, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+201, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+222, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+242, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+261, unloaded +// CHECK:STDOUT: %import_ref.13: %Uint32ToUint16.type = import_ref Main//int_ops, inst+280, loaded [template = constants.%Uint32ToUint16] +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+299, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+318, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+339, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+359, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+378, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+397, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+416, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+435, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -2445,32 +2533,33 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc9_19.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc9_19.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc9_19.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%.2] -// CHECK:STDOUT: %.loc9_19.3: type = converted %int.make_type_unsigned, %.loc9_19.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc9_19.1) [template = constants.%u16] +// CHECK:STDOUT: %.loc9_19.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%u16] +// CHECK:STDOUT: %.loc9_19.3: type = converted %int.make_type_unsigned, %.loc9_19.2 [template = constants.%u16] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToUint16(%a.param_patt: %.4) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @Uint32ToUint16(%a.param_patt: %u32) -> %u16 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: i32) -> %.4 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Uint32ToUint16.ref: %Uint32ToUint16.type = name_ref Uint32ToUint16, imports.%import_ref.13 [template = constants.%Uint32ToUint16] // CHECK:STDOUT: %Int32ToUint32.ref: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %.loc9_54.1: Core.IntLiteral = int_value 65536 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_54.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_54.3: = bound_method %.loc9_54.1, %.loc9_54.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc9_54: init i32 = call %.loc9_54.3(%.loc9_54.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc9_54.4: i32 = value_of_initializer %int.convert_checked.loc9_54 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_54.5: i32 = converted %.loc9_54.1, %.loc9_54.4 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc9_53: init %.4 = call %Int32ToUint32.ref(%.loc9_54.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc9_53.1: %.4 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%.32] -// CHECK:STDOUT: %.loc9_53.2: %.4 = converted %int.convert_checked.loc9_53, %.loc9_53.1 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc9_39: init %.2 = call %Uint32ToUint16.ref(%.loc9_53.2) [template = constants.%.33] -// CHECK:STDOUT: %.loc9_64.1: %.2 = value_of_initializer %int.convert_checked.loc9_39 [template = constants.%.33] -// CHECK:STDOUT: %.loc9_64.2: %.2 = converted %int.convert_checked.loc9_39, %.loc9_64.1 [template = constants.%.33] -// CHECK:STDOUT: %max_plus_one: %.2 = bind_name max_plus_one, %.loc9_64.2 +// CHECK:STDOUT: %.loc9_54.1: Core.IntLiteral = int_value 65536 [template = constants.%.3] +// CHECK:STDOUT: %.loc9_54.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_54.3: = bound_method %.loc9_54.1, %.loc9_54.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc9_54.4: = specific_function %.loc9_54.3, @Convert.2(constants.%.2) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc9_54: init %i32 = call %.loc9_54.4(%.loc9_54.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc9_54.5: %i32 = value_of_initializer %int.convert_checked.loc9_54 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_54.6: %i32 = converted %.loc9_54.1, %.loc9_54.5 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc9_53: init %u32 = call %Int32ToUint32.ref(%.loc9_54.6) [template = constants.%.27] +// CHECK:STDOUT: %.loc9_53.1: %u32 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_53.2: %u32 = converted %int.convert_checked.loc9_53, %.loc9_53.1 [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc9_39: init %u16 = call %Uint32ToUint16.ref(%.loc9_53.2) [template = constants.%.28] +// CHECK:STDOUT: %.loc9_64.1: %u16 = value_of_initializer %int.convert_checked.loc9_39 [template = constants.%.28] +// CHECK:STDOUT: %.loc9_64.2: %u16 = converted %int.convert_checked.loc9_39, %.loc9_64.1 [template = constants.%.28] +// CHECK:STDOUT: %max_plus_one: %u16 = bind_name max_plus_one, %.loc9_64.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2480,47 +2569,51 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 16 [template] // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = int_type unsigned, %.1 [template] +// CHECK:STDOUT: %u16: type = int_type unsigned, %.1 [template] // CHECK:STDOUT: %Int32ToUint16.type: type = fn_type @Int32ToUint16 [template] // CHECK:STDOUT: %Int32ToUint16: %Int32ToUint16.type = struct_value () [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.2 [template] // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template] // CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template] // CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.29: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 0 [template] -// CHECK:STDOUT: %.31: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 1 [template] -// CHECK:STDOUT: %.33: i32 = int_value -1 [template] -// CHECK:STDOUT: %.34: %.2 = int_value 18446744073709551615 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.2) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.28: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: %i32 = int_value -1 [template] +// CHECK:STDOUT: %.32: %u16 = int_value 18446744073709551615 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+25, unloaded -// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, inst+49, loaded [template = constants.%SubI32] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+89, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+96, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+113, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+131, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+149, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+168, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+187, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+218, unloaded -// CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, inst+237, loaded [template = constants.%Int32ToUint16] -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+256, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+275, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+294, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+313, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+352, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+371, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+390, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+408, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+427, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+33, unloaded +// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, inst+60, loaded [template = constants.%SubI32] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+99, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+106, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+125, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+144, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+163, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+182, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+201, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+222, unloaded +// CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, inst+242, loaded [template = constants.%Int32ToUint16] +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+261, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+280, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+299, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+318, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+339, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+359, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+378, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+397, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+416, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+435, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -2558,14 +2651,14 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc9_23.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc9_23.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc9_23.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%.2] -// CHECK:STDOUT: %.loc9_23.3: type = converted %int.make_type_unsigned, %.loc9_23.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc9_23.1) [template = constants.%u16] +// CHECK:STDOUT: %.loc9_23.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%u16] +// CHECK:STDOUT: %.loc9_23.3: type = converted %int.make_type_unsigned, %.loc9_23.2 [template = constants.%u16] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: i32) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubI32(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.ssub"; +// CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -2573,23 +2666,25 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] // CHECK:STDOUT: %.loc9_50.1: Core.IntLiteral = int_value 0 [template = constants.%.3] // CHECK:STDOUT: %.loc9_53.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc9_50.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_50.3: = bound_method %.loc9_50.1, %.loc9_50.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc9_50: init i32 = call %.loc9_50.3(%.loc9_50.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc9_50.4: i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%.30] -// CHECK:STDOUT: %.loc9_50.5: i32 = converted %.loc9_50.1, %.loc9_50.4 [template = constants.%.30] -// CHECK:STDOUT: %.loc9_53.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_53.3: = bound_method %.loc9_53.1, %.loc9_53.2 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc9_53: init i32 = call %.loc9_53.3(%.loc9_53.1) [template = constants.%.32] -// CHECK:STDOUT: %.loc9_53.4: i32 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%.32] -// CHECK:STDOUT: %.loc9_53.5: i32 = converted %.loc9_53.1, %.loc9_53.4 [template = constants.%.32] -// CHECK:STDOUT: %int.ssub: init i32 = call %SubI32.ref(%.loc9_50.5, %.loc9_53.5) [template = constants.%.33] -// CHECK:STDOUT: %.loc9_49.1: i32 = value_of_initializer %int.ssub [template = constants.%.33] -// CHECK:STDOUT: %.loc9_49.2: i32 = converted %int.ssub, %.loc9_49.1 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc9_42: init %.2 = call %Int32ToUint16.ref(%.loc9_49.2) [template = constants.%.34] -// CHECK:STDOUT: %.loc9_56.1: %.2 = value_of_initializer %int.convert_checked.loc9_42 [template = constants.%.34] -// CHECK:STDOUT: %.loc9_56.2: %.2 = converted %int.convert_checked.loc9_42, %.loc9_56.1 [template = constants.%.34] -// CHECK:STDOUT: %minus_one_to_u16: %.2 = bind_name minus_one_to_u16, %.loc9_56.2 +// CHECK:STDOUT: %.loc9_50.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_50.3: = bound_method %.loc9_50.1, %.loc9_50.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc9_50.4: = specific_function %.loc9_50.3, @Convert.2(constants.%.2) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc9_50: init %i32 = call %.loc9_50.4(%.loc9_50.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc9_50.5: %i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_50.6: %i32 = converted %.loc9_50.1, %.loc9_50.5 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_53.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_53.3: = bound_method %.loc9_53.1, %.loc9_53.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc9_53.4: = specific_function %.loc9_53.3, @Convert.2(constants.%.2) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %.loc9_53.4(%.loc9_53.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc9_53.5: %i32 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%.30] +// CHECK:STDOUT: %.loc9_53.6: %i32 = converted %.loc9_53.1, %.loc9_53.5 [template = constants.%.30] +// CHECK:STDOUT: %int.ssub: init %i32 = call %SubI32.ref(%.loc9_50.6, %.loc9_53.6) [template = constants.%.31] +// CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.ssub [template = constants.%.31] +// CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int.ssub, %.loc9_49.1 [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc9_42: init %u16 = call %Int32ToUint16.ref(%.loc9_49.2) [template = constants.%.32] +// CHECK:STDOUT: %.loc9_56.1: %u16 = value_of_initializer %int.convert_checked.loc9_42 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_56.2: %u16 = converted %int.convert_checked.loc9_42, %.loc9_56.1 [template = constants.%.32] +// CHECK:STDOUT: %minus_one_to_u16: %u16 = bind_name minus_one_to_u16, %.loc9_56.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2599,47 +2694,50 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = int_type unsigned, %.1 [template] +// CHECK:STDOUT: %u32: type = int_type unsigned, %.1 [template] // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template] // CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.29: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 0 [template] -// CHECK:STDOUT: %.31: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 1 [template] -// CHECK:STDOUT: %.33: i32 = int_value -1 [template] -// CHECK:STDOUT: %.34: %.2 = int_value 18446744073709551615 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.30: %i32 = int_value -1 [template] +// CHECK:STDOUT: %.31: %u32 = int_value 18446744073709551615 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+25, unloaded -// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, inst+49, loaded [template = constants.%SubI32] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+89, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+96, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+113, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+131, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+149, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+168, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+187, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+218, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+237, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+256, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+275, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+294, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+313, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+352, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+371, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+390, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+408, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+427, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+33, unloaded +// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, inst+60, loaded [template = constants.%SubI32] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+99, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+106, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+125, unloaded +// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+144, loaded [template = constants.%Int32ToUint32] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+163, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+182, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+201, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+222, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+242, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+261, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+280, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+299, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+318, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+339, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+359, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+378, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+397, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+416, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+435, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -2677,38 +2775,40 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc9_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc9_23.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc9_23.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%.2] -// CHECK:STDOUT: %.loc9_23.3: type = converted %int.make_type_unsigned, %.loc9_23.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc9_23.1) [template = constants.%u32] +// CHECK:STDOUT: %.loc9_23.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%u32] +// CHECK:STDOUT: %.loc9_23.3: type = converted %int.make_type_unsigned, %.loc9_23.2 [template = constants.%u32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: i32) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubI32(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.ssub"; +// CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToUint32.ref: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] -// CHECK:STDOUT: %.loc9_50.1: Core.IntLiteral = int_value 0 [template = constants.%.3] -// CHECK:STDOUT: %.loc9_53.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc9_50.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_50.3: = bound_method %.loc9_50.1, %.loc9_50.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc9_50: init i32 = call %.loc9_50.3(%.loc9_50.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc9_50.4: i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%.30] -// CHECK:STDOUT: %.loc9_50.5: i32 = converted %.loc9_50.1, %.loc9_50.4 [template = constants.%.30] -// CHECK:STDOUT: %.loc9_53.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_53.3: = bound_method %.loc9_53.1, %.loc9_53.2 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc9_53: init i32 = call %.loc9_53.3(%.loc9_53.1) [template = constants.%.32] -// CHECK:STDOUT: %.loc9_53.4: i32 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%.32] -// CHECK:STDOUT: %.loc9_53.5: i32 = converted %.loc9_53.1, %.loc9_53.4 [template = constants.%.32] -// CHECK:STDOUT: %int.ssub: init i32 = call %SubI32.ref(%.loc9_50.5, %.loc9_53.5) [template = constants.%.33] -// CHECK:STDOUT: %.loc9_49.1: i32 = value_of_initializer %int.ssub [template = constants.%.33] -// CHECK:STDOUT: %.loc9_49.2: i32 = converted %int.ssub, %.loc9_49.1 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc9_42: init %.2 = call %Int32ToUint32.ref(%.loc9_49.2) [template = constants.%.34] -// CHECK:STDOUT: %.loc9_56.1: %.2 = value_of_initializer %int.convert_checked.loc9_42 [template = constants.%.34] -// CHECK:STDOUT: %.loc9_56.2: %.2 = converted %int.convert_checked.loc9_42, %.loc9_56.1 [template = constants.%.34] -// CHECK:STDOUT: %minus_one_to_u32: %.2 = bind_name minus_one_to_u32, %.loc9_56.2 +// CHECK:STDOUT: %.loc9_50.1: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc9_53.1: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc9_50.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_50.3: = bound_method %.loc9_50.1, %.loc9_50.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc9_50.4: = specific_function %.loc9_50.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc9_50: init %i32 = call %.loc9_50.4(%.loc9_50.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc9_50.5: %i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_50.6: %i32 = converted %.loc9_50.1, %.loc9_50.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_53.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_53.3: = bound_method %.loc9_53.1, %.loc9_53.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_53.4: = specific_function %.loc9_53.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %.loc9_53.4(%.loc9_53.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc9_53.5: %i32 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%.29] +// CHECK:STDOUT: %.loc9_53.6: %i32 = converted %.loc9_53.1, %.loc9_53.5 [template = constants.%.29] +// CHECK:STDOUT: %int.ssub: init %i32 = call %SubI32.ref(%.loc9_50.6, %.loc9_53.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.ssub [template = constants.%.30] +// CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int.ssub, %.loc9_49.1 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc9_42: init %u32 = call %Int32ToUint32.ref(%.loc9_49.2) [template = constants.%.31] +// CHECK:STDOUT: %.loc9_56.1: %u32 = value_of_initializer %int.convert_checked.loc9_42 [template = constants.%.31] +// CHECK:STDOUT: %.loc9_56.2: %u32 = converted %int.convert_checked.loc9_42, %.loc9_56.1 [template = constants.%.31] +// CHECK:STDOUT: %minus_one_to_u32: %u32 = bind_name minus_one_to_u32, %.loc9_56.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2718,47 +2818,51 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = int_type unsigned, %.1 [template] +// CHECK:STDOUT: %u64: type = int_type unsigned, %.1 [template] // CHECK:STDOUT: %Int32ToUint64.type: type = fn_type @Int32ToUint64 [template] // CHECK:STDOUT: %Int32ToUint64: %Int32ToUint64.type = struct_value () [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.2 [template] // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template] // CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template] // CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.29: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 0 [template] -// CHECK:STDOUT: %.31: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 1 [template] -// CHECK:STDOUT: %.33: i32 = int_value -1 [template] -// CHECK:STDOUT: %.34: %.2 = int_value 18446744073709551615 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.2) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.28: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: %i32 = int_value -1 [template] +// CHECK:STDOUT: %.32: %u64 = int_value 18446744073709551615 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+25, unloaded -// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, inst+49, loaded [template = constants.%SubI32] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+89, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+96, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+113, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+131, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+149, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+168, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+187, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+218, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+237, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+256, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+275, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+294, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+313, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17: %Int32ToUint64.type = import_ref Main//int_ops, inst+352, loaded [template = constants.%Int32ToUint64] -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+371, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+390, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+408, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+427, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+33, unloaded +// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, inst+60, loaded [template = constants.%SubI32] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+99, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+106, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+125, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+144, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+163, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+182, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+201, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+222, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+242, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+261, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+280, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+299, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+318, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+339, unloaded +// CHECK:STDOUT: %import_ref.17: %Int32ToUint64.type = import_ref Main//int_ops, inst+359, loaded [template = constants.%Int32ToUint64] +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+378, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+397, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+416, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+435, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -2796,14 +2900,14 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc9_23.1: Core.IntLiteral = int_value 64 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc9_23.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc9_23.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%.2] -// CHECK:STDOUT: %.loc9_23.3: type = converted %int.make_type_unsigned, %.loc9_23.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc9_23.1) [template = constants.%u64] +// CHECK:STDOUT: %.loc9_23.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%u64] +// CHECK:STDOUT: %.loc9_23.3: type = converted %int.make_type_unsigned, %.loc9_23.2 [template = constants.%u64] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint64(%a.param_patt: i32) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToUint64(%a.param_patt: %i32) -> %u64 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @SubI32(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.ssub"; +// CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -2811,23 +2915,25 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] // CHECK:STDOUT: %.loc9_50.1: Core.IntLiteral = int_value 0 [template = constants.%.3] // CHECK:STDOUT: %.loc9_53.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc9_50.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_50.3: = bound_method %.loc9_50.1, %.loc9_50.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc9_50: init i32 = call %.loc9_50.3(%.loc9_50.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc9_50.4: i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%.30] -// CHECK:STDOUT: %.loc9_50.5: i32 = converted %.loc9_50.1, %.loc9_50.4 [template = constants.%.30] -// CHECK:STDOUT: %.loc9_53.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_53.3: = bound_method %.loc9_53.1, %.loc9_53.2 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc9_53: init i32 = call %.loc9_53.3(%.loc9_53.1) [template = constants.%.32] -// CHECK:STDOUT: %.loc9_53.4: i32 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%.32] -// CHECK:STDOUT: %.loc9_53.5: i32 = converted %.loc9_53.1, %.loc9_53.4 [template = constants.%.32] -// CHECK:STDOUT: %int.ssub: init i32 = call %SubI32.ref(%.loc9_50.5, %.loc9_53.5) [template = constants.%.33] -// CHECK:STDOUT: %.loc9_49.1: i32 = value_of_initializer %int.ssub [template = constants.%.33] -// CHECK:STDOUT: %.loc9_49.2: i32 = converted %int.ssub, %.loc9_49.1 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc9_42: init %.2 = call %Int32ToUint64.ref(%.loc9_49.2) [template = constants.%.34] -// CHECK:STDOUT: %.loc9_56.1: %.2 = value_of_initializer %int.convert_checked.loc9_42 [template = constants.%.34] -// CHECK:STDOUT: %.loc9_56.2: %.2 = converted %int.convert_checked.loc9_42, %.loc9_56.1 [template = constants.%.34] -// CHECK:STDOUT: %minus_one_to_u64: %.2 = bind_name minus_one_to_u64, %.loc9_56.2 +// CHECK:STDOUT: %.loc9_50.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_50.3: = bound_method %.loc9_50.1, %.loc9_50.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc9_50.4: = specific_function %.loc9_50.3, @Convert.2(constants.%.2) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc9_50: init %i32 = call %.loc9_50.4(%.loc9_50.1) [template = constants.%.27] +// CHECK:STDOUT: %.loc9_50.5: %i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_50.6: %i32 = converted %.loc9_50.1, %.loc9_50.5 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_53.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_53.3: = bound_method %.loc9_53.1, %.loc9_53.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc9_53.4: = specific_function %.loc9_53.3, @Convert.2(constants.%.2) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %.loc9_53.4(%.loc9_53.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc9_53.5: %i32 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%.30] +// CHECK:STDOUT: %.loc9_53.6: %i32 = converted %.loc9_53.1, %.loc9_53.5 [template = constants.%.30] +// CHECK:STDOUT: %int.ssub: init %i32 = call %SubI32.ref(%.loc9_50.6, %.loc9_53.6) [template = constants.%.31] +// CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.ssub [template = constants.%.31] +// CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int.ssub, %.loc9_49.1 [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc9_42: init %u64 = call %Int32ToUint64.ref(%.loc9_49.2) [template = constants.%.32] +// CHECK:STDOUT: %.loc9_56.1: %u64 = value_of_initializer %int.convert_checked.loc9_42 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_56.2: %u64 = converted %int.convert_checked.loc9_42, %.loc9_56.1 [template = constants.%.32] +// CHECK:STDOUT: %minus_one_to_u64: %u64 = bind_name minus_one_to_u64, %.loc9_56.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2837,44 +2943,47 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 16 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %i16: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template] // CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.2 [template] // CHECK:STDOUT: %NegateI32.type: type = fn_type @NegateI32 [template] // CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template] // CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32769 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 32769 [template] -// CHECK:STDOUT: %.30: i32 = int_value -32769 [template] -// CHECK:STDOUT: %.31: %.2 = int_value -32769 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.2) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 32769 [template] +// CHECK:STDOUT: %.27: %i32 = int_value -32769 [template] +// CHECK:STDOUT: %.28: %i16 = int_value -32769 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, inst+25, loaded [template = constants.%NegateI32] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+49, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+89, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+96, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+113, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+131, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+149, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+168, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+187, unloaded -// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, inst+218, loaded [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+237, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+256, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+275, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+294, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+313, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+352, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+371, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+390, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+408, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+427, unloaded +// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, inst+33, loaded [template = constants.%NegateI32] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+60, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+99, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+106, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+125, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+144, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+163, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+182, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+201, unloaded +// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, inst+222, loaded [template = constants.%Int32ToInt16] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+242, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+261, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+280, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+299, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+318, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+339, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+359, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+378, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+397, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+416, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+435, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -2912,87 +3021,88 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc9_20.1: Core.IntLiteral = int_value 16 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc9_20.1) [template = constants.%.2] -// CHECK:STDOUT: %.loc9_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%.2] -// CHECK:STDOUT: %.loc9_20.3: type = converted %int.make_type_signed, %.loc9_20.2 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc9_20.1) [template = constants.%i16] +// CHECK:STDOUT: %.loc9_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%i16] +// CHECK:STDOUT: %.loc9_20.3: type = converted %int.make_type_signed, %.loc9_20.2 [template = constants.%i16] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: i32) -> %.2 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @NegateI32(%a.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @NegateI32(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToInt16.ref: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] // CHECK:STDOUT: %NegateI32.ref: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] // CHECK:STDOUT: %.loc9_49.1: Core.IntLiteral = int_value 32769 [template = constants.%.3] -// CHECK:STDOUT: %.loc9_49.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_49.3: = bound_method %.loc9_49.1, %.loc9_49.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc9_49: init i32 = call %.loc9_49.3(%.loc9_49.1) [template = constants.%.29] -// CHECK:STDOUT: %.loc9_49.4: i32 = value_of_initializer %int.convert_checked.loc9_49 [template = constants.%.29] -// CHECK:STDOUT: %.loc9_49.5: i32 = converted %.loc9_49.1, %.loc9_49.4 [template = constants.%.29] -// CHECK:STDOUT: %int.snegate: init i32 = call %NegateI32.ref(%.loc9_49.5) [template = constants.%.30] -// CHECK:STDOUT: %.loc9_48.1: i32 = value_of_initializer %int.snegate [template = constants.%.30] -// CHECK:STDOUT: %.loc9_48.2: i32 = converted %int.snegate, %.loc9_48.1 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc9_38: init %.2 = call %Int32ToInt16.ref(%.loc9_48.2) [template = constants.%.31] -// CHECK:STDOUT: %.loc9_57.1: %.2 = value_of_initializer %int.convert_checked.loc9_38 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_57.2: %.2 = converted %int.convert_checked.loc9_38, %.loc9_57.1 [template = constants.%.31] -// CHECK:STDOUT: %min_minus_one: %.2 = bind_name min_minus_one, %.loc9_57.2 +// CHECK:STDOUT: %.loc9_49.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_49.3: = bound_method %.loc9_49.1, %.loc9_49.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc9_49.4: = specific_function %.loc9_49.3, @Convert.2(constants.%.2) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc9_49: init %i32 = call %.loc9_49.4(%.loc9_49.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc9_49.5: %i32 = value_of_initializer %int.convert_checked.loc9_49 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_49.6: %i32 = converted %.loc9_49.1, %.loc9_49.5 [template = constants.%.26] +// CHECK:STDOUT: %int.snegate: init %i32 = call %NegateI32.ref(%.loc9_49.6) [template = constants.%.27] +// CHECK:STDOUT: %.loc9_48.1: %i32 = value_of_initializer %int.snegate [template = constants.%.27] +// CHECK:STDOUT: %.loc9_48.2: %i32 = converted %int.snegate, %.loc9_48.1 [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc9_38: init %i16 = call %Int32ToInt16.ref(%.loc9_48.2) [template = constants.%.28] +// CHECK:STDOUT: %.loc9_57.1: %i16 = value_of_initializer %int.convert_checked.loc9_38 [template = constants.%.28] +// CHECK:STDOUT: %.loc9_57.2: %i16 = converted %int.convert_checked.loc9_38, %.loc9_57.1 [template = constants.%.28] +// CHECK:STDOUT: %min_minus_one: %i16 = bind_name min_minus_one, %.loc9_57.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_not_constant.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 16 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %.29: type = int_type signed, %.28 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 16 [template] +// CHECK:STDOUT: %i16: type = int_type signed, %.26 [template] // CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template] // CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template] // CHECK:STDOUT: %Int32ToInt32.type: type = fn_type @Int32ToInt32 [template] // CHECK:STDOUT: %Int32ToInt32: %Int32ToInt32.type = struct_value () [template] -// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %.31: type = int_type signed, %.30 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %i64: type = int_type signed, %.27 [template] // CHECK:STDOUT: %Int32ToInt64.type: type = fn_type @Int32ToInt64 [template] // CHECK:STDOUT: %Int32ToInt64: %Int32ToInt64.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+25, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+49, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+89, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+96, unloaded -// CHECK:STDOUT: %import_ref.5: %Int32ToInt32.type = import_ref Main//int_ops, inst+113, loaded [template = constants.%Int32ToInt32] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+131, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+149, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+168, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+187, unloaded -// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, inst+218, loaded [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+237, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+256, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+275, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+294, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+313, unloaded -// CHECK:STDOUT: %import_ref.16: %Int32ToInt64.type = import_ref Main//int_ops, inst+333, loaded [template = constants.%Int32ToInt64] -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+352, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+371, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+390, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+408, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+427, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+33, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+60, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+99, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+106, unloaded +// CHECK:STDOUT: %import_ref.5: %Int32ToInt32.type = import_ref Main//int_ops, inst+125, loaded [template = constants.%Int32ToInt32] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+144, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+163, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+182, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+201, unloaded +// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, inst+222, loaded [template = constants.%Int32ToInt16] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+242, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+261, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+280, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+299, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+318, unloaded +// CHECK:STDOUT: %import_ref.16: %Int32ToInt64.type = import_ref Main//int_ops, inst+339, loaded [template = constants.%Int32ToInt64] +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+359, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+378, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+397, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+416, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+435, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.22 +// CHECK:STDOUT: .Int = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 -// CHECK:STDOUT: .Int = %import_ref.72 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -3029,55 +3139,58 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_32.loc5, %.loc5_19.1 [template = i32] -// CHECK:STDOUT: %.loc15_34.1: Core.IntLiteral = int_value 16 [template = constants.%.28] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_34.1) [template = constants.%.29] -// CHECK:STDOUT: %.loc15_34.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%.29] -// CHECK:STDOUT: %.loc15_34.3: type = converted %int.make_type_signed.loc15, %.loc15_34.2 [template = constants.%.29] -// CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc25_32.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] -// CHECK:STDOUT: %.loc25_32.2: type = converted %int.make_type_32.loc25, %.loc25_32.1 [template = i32] -// CHECK:STDOUT: %.loc34_33.1: Core.IntLiteral = int_value 64 [template = constants.%.30] -// CHECK:STDOUT: %int.make_type_signed.loc34: init type = call constants.%Int(%.loc34_33.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc34_33.2: type = value_of_initializer %int.make_type_signed.loc34 [template = constants.%.31] -// CHECK:STDOUT: %.loc34_33.3: type = converted %int.make_type_signed.loc34, %.loc34_33.2 [template = constants.%.31] +// CHECK:STDOUT: %.loc5_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.3: type = converted %int.make_type_signed.loc5, %.loc5_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_34.1: Core.IntLiteral = int_value 16 [template = constants.%.26] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_34.1) [template = constants.%i16] +// CHECK:STDOUT: %.loc15_34.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i16] +// CHECK:STDOUT: %.loc15_34.3: type = converted %int.make_type_signed.loc15, %.loc15_34.2 [template = constants.%i16] +// CHECK:STDOUT: %.loc25_32.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc25: init type = call constants.%Int(%.loc25_32.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc25_32.2: type = value_of_initializer %int.make_type_signed.loc25 [template = constants.%i32] +// CHECK:STDOUT: %.loc25_32.3: type = converted %int.make_type_signed.loc25, %.loc25_32.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc34_33.1: Core.IntLiteral = int_value 64 [template = constants.%.27] +// CHECK:STDOUT: %int.make_type_signed.loc34: init type = call constants.%Int(%.loc34_33.1) [template = constants.%i64] +// CHECK:STDOUT: %.loc34_33.2: type = value_of_initializer %int.make_type_signed.loc34 [template = constants.%i64] +// CHECK:STDOUT: %.loc34_33.3: type = converted %int.make_type_signed.loc34, %.loc34_33.2 [template = constants.%i64] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: i32) -> %.29 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt32(%a.param_patt: i32) -> i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToInt32(%a.param_patt: %i32) -> %i32 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt64(%a.param_patt: i32) -> %.31 = "int.convert_checked"; +// CHECK:STDOUT: fn @Int32ToInt64(%a.param_patt: %i32) -> %i64 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc5_25: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc5_26.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc5_26.2: = bound_method %.loc5_25, %.loc5_26.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc5: init i32 = call %.loc5_26.2(%.loc5_25) [template = constants.%.27] -// CHECK:STDOUT: %.loc5_26.3: i32 = value_of_initializer %int.convert_checked.loc5 [template = constants.%.27] -// CHECK:STDOUT: %.loc5_26.4: i32 = converted %.loc5_25, %.loc5_26.3 [template = constants.%.27] -// CHECK:STDOUT: %not_constant: i32 = bind_name not_constant, %.loc5_26.4 +// CHECK:STDOUT: %.loc5_25: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc5_26.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc5_26.2: = bound_method %.loc5_25, %.loc5_26.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc5_26.3: = specific_function %.loc5_26.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %.loc5_26.3(%.loc5_25) [template = constants.%.25] +// CHECK:STDOUT: %.loc5_26.4: %i32 = value_of_initializer %int.convert_checked.loc5 [template = constants.%.25] +// CHECK:STDOUT: %.loc5_26.5: %i32 = converted %.loc5_25, %.loc5_26.4 [template = constants.%.25] +// CHECK:STDOUT: %not_constant: %i32 = bind_name not_constant, %.loc5_26.5 // CHECK:STDOUT: %Int32ToInt16.ref: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %not_constant.ref.loc15: i32 = name_ref not_constant, %not_constant -// CHECK:STDOUT: %int.convert_checked.loc15: init %.29 = call %Int32ToInt16.ref(%not_constant.ref.loc15) -// CHECK:STDOUT: %.loc15_66.1: %.29 = value_of_initializer %int.convert_checked.loc15 -// CHECK:STDOUT: %.loc15_66.2: %.29 = converted %int.convert_checked.loc15, %.loc15_66.1 -// CHECK:STDOUT: %convert_not_constant_narrow: %.29 = bind_name convert_not_constant_narrow, %.loc15_66.2 +// CHECK:STDOUT: %not_constant.ref.loc15: %i32 = name_ref not_constant, %not_constant +// CHECK:STDOUT: %int.convert_checked.loc15: init %i16 = call %Int32ToInt16.ref(%not_constant.ref.loc15) +// CHECK:STDOUT: %.loc15_66.1: %i16 = value_of_initializer %int.convert_checked.loc15 +// CHECK:STDOUT: %.loc15_66.2: %i16 = converted %int.convert_checked.loc15, %.loc15_66.1 +// CHECK:STDOUT: %convert_not_constant_narrow: %i16 = bind_name convert_not_constant_narrow, %.loc15_66.2 // CHECK:STDOUT: %Int32ToInt32.ref: %Int32ToInt32.type = name_ref Int32ToInt32, imports.%import_ref.5 [template = constants.%Int32ToInt32] -// CHECK:STDOUT: %not_constant.ref.loc25: i32 = name_ref not_constant, %not_constant -// CHECK:STDOUT: %int.convert_checked.loc25: init i32 = call %Int32ToInt32.ref(%not_constant.ref.loc25) -// CHECK:STDOUT: %.loc25_64.1: i32 = value_of_initializer %int.convert_checked.loc25 -// CHECK:STDOUT: %.loc25_64.2: i32 = converted %int.convert_checked.loc25, %.loc25_64.1 -// CHECK:STDOUT: %convert_not_constant_same: i32 = bind_name convert_not_constant_same, %.loc25_64.2 +// CHECK:STDOUT: %not_constant.ref.loc25: %i32 = name_ref not_constant, %not_constant +// CHECK:STDOUT: %int.convert_checked.loc25: init %i32 = call %Int32ToInt32.ref(%not_constant.ref.loc25) +// CHECK:STDOUT: %.loc25_64.1: %i32 = value_of_initializer %int.convert_checked.loc25 +// CHECK:STDOUT: %.loc25_64.2: %i32 = converted %int.convert_checked.loc25, %.loc25_64.1 +// CHECK:STDOUT: %convert_not_constant_same: %i32 = bind_name convert_not_constant_same, %.loc25_64.2 // CHECK:STDOUT: %Int32ToInt64.ref: %Int32ToInt64.type = name_ref Int32ToInt64, imports.%import_ref.16 [template = constants.%Int32ToInt64] -// CHECK:STDOUT: %not_constant.ref.loc34: i32 = name_ref not_constant, %not_constant -// CHECK:STDOUT: %int.convert_checked.loc34: init %.31 = call %Int32ToInt64.ref(%not_constant.ref.loc34) -// CHECK:STDOUT: %.loc34_65.1: %.31 = value_of_initializer %int.convert_checked.loc34 -// CHECK:STDOUT: %.loc34_65.2: %.31 = converted %int.convert_checked.loc34, %.loc34_65.1 -// CHECK:STDOUT: %convert_not_constant_widen: %.31 = bind_name convert_not_constant_widen, %.loc34_65.2 +// CHECK:STDOUT: %not_constant.ref.loc34: %i32 = name_ref not_constant, %not_constant +// CHECK:STDOUT: %int.convert_checked.loc34: init %i64 = call %Int32ToInt64.ref(%not_constant.ref.loc34) +// CHECK:STDOUT: %.loc34_65.1: %i64 = value_of_initializer %int.convert_checked.loc34 +// CHECK:STDOUT: %.loc34_65.2: %i64 = converted %int.convert_checked.loc34, %.loc34_65.1 +// CHECK:STDOUT: %convert_not_constant_widen: %i64 = bind_name convert_not_constant_widen, %.loc34_65.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/eq.carbon b/toolchain/check/testdata/builtins/int/eq.carbon index d6ce3c09bd9c..5e2771361995 100644 --- a/toolchain/check/testdata/builtins/int/eq.carbon +++ b/toolchain/check/testdata/builtins/int/eq.carbon @@ -36,37 +36,41 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: --- int_eq.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %Eq.type: type = fn_type @Eq [template] // CHECK:STDOUT: %Eq: %Eq.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.29: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 1 [template] -// CHECK:STDOUT: %.31: bool = bool_literal true [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 2 [template] -// CHECK:STDOUT: %.35: bool = bool_literal false [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.26: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.27: = specific_function %.26, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.28: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.29: bool = bool_literal true [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.31: = bound_method %.30, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.34: bool = bool_literal false [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude @@ -85,26 +89,28 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Eq.decl: %Eq.type = fn_decl @Eq [template = constants.%Eq] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_10.1: type = value_of_initializer %int.make_type_32.loc2_10 [template = i32] -// CHECK:STDOUT: %.loc2_10.2: type = converted %int.make_type_32.loc2_10, %.loc2_10.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %int.make_type_32.loc2_18 [template = i32] -// CHECK:STDOUT: %.loc2_18.2: type = converted %int.make_type_32.loc2_18, %.loc2_18.1 [template = i32] +// CHECK:STDOUT: %.loc2_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_10: init type = call constants.%Int(%.loc2_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_10.2: type = value_of_initializer %int.make_type_signed.loc2_10 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_10.3: type = converted %int.make_type_signed.loc2_10, %.loc2_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_18: init type = call constants.%Int(%.loc2_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_18.2: type = value_of_initializer %int.make_type_signed.loc2_18 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_18.3: type = converted %int.make_type_signed.loc2_18, %.loc2_18.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_26.2: type = converted %bool.make_type, %.loc2_26.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } @@ -124,66 +130,70 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc12_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %int.make_type_32.loc12_19 [template = i32] -// CHECK:STDOUT: %.loc12_19.2: type = converted %int.make_type_32.loc12_19, %.loc12_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc12_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_27.1: type = value_of_initializer %int.make_type_32.loc12_27 [template = i32] -// CHECK:STDOUT: %.loc12_27.2: type = converted %int.make_type_32.loc12_27, %.loc12_27.1 [template = i32] +// CHECK:STDOUT: %.loc12_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_19: init type = call constants.%Int(%.loc12_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_19.2: type = value_of_initializer %int.make_type_signed.loc12_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_19.3: type = converted %int.make_type_signed.loc12_19, %.loc12_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_27: init type = call constants.%Int(%.loc12_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_27.2: type = value_of_initializer %int.make_type_signed.loc12_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_27.3: type = converted %int.make_type_signed.loc12_27, %.loc12_27.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type, %.loc12_35.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc4: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %.loc5: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc5: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Eq(%a.param_patt: i32, %b.param_patt: i32) -> bool = "int.eq"; +// CHECK:STDOUT: fn @Eq(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.eq"; // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref: %True = name_ref true_, %true_ // CHECK:STDOUT: %Eq.ref.loc8: %Eq.type = name_ref Eq, file.%Eq.decl [template = constants.%Eq] -// CHECK:STDOUT: %.loc8_19.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc8_22.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc8_19.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_19.3: = bound_method %.loc8_19.1, %.loc8_19.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc8_19: init i32 = call %.loc8_19.3(%.loc8_19.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc8_19.4: i32 = value_of_initializer %int.convert_checked.loc8_19 [template = constants.%.30] -// CHECK:STDOUT: %.loc8_19.5: i32 = converted %.loc8_19.1, %.loc8_19.4 [template = constants.%.30] -// CHECK:STDOUT: %.loc8_22.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_22.3: = bound_method %.loc8_22.1, %.loc8_22.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc8_22: init i32 = call %.loc8_22.3(%.loc8_22.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc8_22.4: i32 = value_of_initializer %int.convert_checked.loc8_22 [template = constants.%.30] -// CHECK:STDOUT: %.loc8_22.5: i32 = converted %.loc8_22.1, %.loc8_22.4 [template = constants.%.30] -// CHECK:STDOUT: %int.eq.loc8: init bool = call %Eq.ref.loc8(%.loc8_19.5, %.loc8_22.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc8_13.1: bool = value_of_initializer %int.eq.loc8 [template = constants.%.31] -// CHECK:STDOUT: %.loc8_13.2: bool = converted %int.eq.loc8, %.loc8_13.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc8_19.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc8_22.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc8_19.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_19.3: = bound_method %.loc8_19.1, %.loc8_19.2 [template = constants.%.26] +// CHECK:STDOUT: %.loc8_19.4: = specific_function %.loc8_19.3, @Convert.2(constants.%.1) [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc8_19: init %i32 = call %.loc8_19.4(%.loc8_19.1) [template = constants.%.28] +// CHECK:STDOUT: %.loc8_19.5: %i32 = value_of_initializer %int.convert_checked.loc8_19 [template = constants.%.28] +// CHECK:STDOUT: %.loc8_19.6: %i32 = converted %.loc8_19.1, %.loc8_19.5 [template = constants.%.28] +// CHECK:STDOUT: %.loc8_22.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_22.3: = bound_method %.loc8_22.1, %.loc8_22.2 [template = constants.%.26] +// CHECK:STDOUT: %.loc8_22.4: = specific_function %.loc8_22.3, @Convert.2(constants.%.1) [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc8_22: init %i32 = call %.loc8_22.4(%.loc8_22.1) [template = constants.%.28] +// CHECK:STDOUT: %.loc8_22.5: %i32 = value_of_initializer %int.convert_checked.loc8_22 [template = constants.%.28] +// CHECK:STDOUT: %.loc8_22.6: %i32 = converted %.loc8_22.1, %.loc8_22.5 [template = constants.%.28] +// CHECK:STDOUT: %int.eq.loc8: init bool = call %Eq.ref.loc8(%.loc8_19.6, %.loc8_22.6) [template = constants.%.29] +// CHECK:STDOUT: %.loc8_13.1: bool = value_of_initializer %int.eq.loc8 [template = constants.%.29] +// CHECK:STDOUT: %.loc8_13.2: bool = converted %int.eq.loc8, %.loc8_13.1 [template = constants.%.29] // CHECK:STDOUT: if %.loc8_13.2 br !if.expr.then.loc8 else br !if.expr.else.loc8 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc8: @@ -198,21 +208,23 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %.loc8_13.3: type = block_arg !if.expr.result.loc8 [template = constants.%True] // CHECK:STDOUT: %false_.ref: %False = name_ref false_, %false_ // CHECK:STDOUT: %Eq.ref.loc9: %Eq.type = name_ref Eq, file.%Eq.decl [template = constants.%Eq] -// CHECK:STDOUT: %.loc9_20.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc9_23.1: Core.IntLiteral = int_value 2 [template = constants.%.32] -// CHECK:STDOUT: %.loc9_20.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_20.3: = bound_method %.loc9_20.1, %.loc9_20.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc9_20: init i32 = call %.loc9_20.3(%.loc9_20.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc9_20.4: i32 = value_of_initializer %int.convert_checked.loc9_20 [template = constants.%.30] -// CHECK:STDOUT: %.loc9_20.5: i32 = converted %.loc9_20.1, %.loc9_20.4 [template = constants.%.30] -// CHECK:STDOUT: %.loc9_23.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_23.3: = bound_method %.loc9_23.1, %.loc9_23.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc9_23: init i32 = call %.loc9_23.3(%.loc9_23.1) [template = constants.%.34] -// CHECK:STDOUT: %.loc9_23.4: i32 = value_of_initializer %int.convert_checked.loc9_23 [template = constants.%.34] -// CHECK:STDOUT: %.loc9_23.5: i32 = converted %.loc9_23.1, %.loc9_23.4 [template = constants.%.34] -// CHECK:STDOUT: %int.eq.loc9: init bool = call %Eq.ref.loc9(%.loc9_20.5, %.loc9_23.5) [template = constants.%.35] -// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %int.eq.loc9 [template = constants.%.35] -// CHECK:STDOUT: %.loc9_14.2: bool = converted %int.eq.loc9, %.loc9_14.1 [template = constants.%.35] +// CHECK:STDOUT: %.loc9_20.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_23.1: Core.IntLiteral = int_value 2 [template = constants.%.30] +// CHECK:STDOUT: %.loc9_20.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_20.3: = bound_method %.loc9_20.1, %.loc9_20.2 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_20.4: = specific_function %.loc9_20.3, @Convert.2(constants.%.1) [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc9_20: init %i32 = call %.loc9_20.4(%.loc9_20.1) [template = constants.%.28] +// CHECK:STDOUT: %.loc9_20.5: %i32 = value_of_initializer %int.convert_checked.loc9_20 [template = constants.%.28] +// CHECK:STDOUT: %.loc9_20.6: %i32 = converted %.loc9_20.1, %.loc9_20.5 [template = constants.%.28] +// CHECK:STDOUT: %.loc9_23.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_23.3: = bound_method %.loc9_23.1, %.loc9_23.2 [template = constants.%.31] +// CHECK:STDOUT: %.loc9_23.4: = specific_function %.loc9_23.3, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc9_23: init %i32 = call %.loc9_23.4(%.loc9_23.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc9_23.5: %i32 = value_of_initializer %int.convert_checked.loc9_23 [template = constants.%.33] +// CHECK:STDOUT: %.loc9_23.6: %i32 = converted %.loc9_23.1, %.loc9_23.5 [template = constants.%.33] +// CHECK:STDOUT: %int.eq.loc9: init bool = call %Eq.ref.loc9(%.loc9_20.6, %.loc9_23.6) [template = constants.%.34] +// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %int.eq.loc9 [template = constants.%.34] +// CHECK:STDOUT: %.loc9_14.2: bool = converted %int.eq.loc9, %.loc9_14.1 [template = constants.%.34] // CHECK:STDOUT: if %.loc9_14.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: @@ -228,11 +240,11 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Eq.ref: %Eq.type = name_ref Eq, file.%Eq.decl [template = constants.%Eq] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.eq: init bool = call %Eq.ref(%a.ref, %b.ref) // CHECK:STDOUT: %.loc13_18.1: bool = value_of_initializer %int.eq // CHECK:STDOUT: %.loc13_18.2: bool = converted %int.eq, %.loc13_18.1 @@ -242,15 +254,17 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: --- fail_bad_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %WrongResult.type: type = fn_type @WrongResult [template] // CHECK:STDOUT: %WrongResult: %WrongResult.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -263,30 +277,33 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %WrongResult.decl: %WrongResult.type = fn_decl @WrongResult [template = constants.%WrongResult] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.3: type = converted %int.make_type_signed.loc7_19, %.loc7_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%.loc7_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.3: type = converted %int.make_type_signed.loc7_27, %.loc7_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%.loc7_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.3: type = converted %int.make_type_signed.loc7_35, %.loc7_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @WrongResult(%a.param_patt: i32, %b.param_patt: i32) -> i32; +// CHECK:STDOUT: fn @WrongResult(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/greater.carbon b/toolchain/check/testdata/builtins/int/greater.carbon index 8be06864df8c..873f9dca30e9 100644 --- a/toolchain/check/testdata/builtins/int/greater.carbon +++ b/toolchain/check/testdata/builtins/int/greater.carbon @@ -31,8 +31,10 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: --- int_greater.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %Greater.type: type = fn_type @Greater [template] @@ -40,34 +42,37 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 2 [template] -// CHECK:STDOUT: %.34: bool = bool_literal false [template] -// CHECK:STDOUT: %.35: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.36: = bound_method %.35, %Convert.15 [template] -// CHECK:STDOUT: %.37: i32 = int_value 0 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.30: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.33: bool = bool_literal false [template] +// CHECK:STDOUT: %.34: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.35: = bound_method %.34, %Convert.14 [template] +// CHECK:STDOUT: %.36: = specific_function %.35, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.37: %i32 = int_value 0 [template] // CHECK:STDOUT: %.38: bool = bool_literal true [template] -// CHECK:STDOUT: %.39: i32 = int_value -1 [template] +// CHECK:STDOUT: %.39: %i32 = int_value -1 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude @@ -87,45 +92,49 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Greater.decl: %Greater.type = fn_decl @Greater [template = constants.%Greater] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_15.1: type = value_of_initializer %int.make_type_32.loc2_15 [template = i32] -// CHECK:STDOUT: %.loc2_15.2: type = converted %int.make_type_32.loc2_15, %.loc2_15.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_23.1: type = value_of_initializer %int.make_type_32.loc2_23 [template = i32] -// CHECK:STDOUT: %.loc2_23.2: type = converted %int.make_type_32.loc2_23, %.loc2_23.1 [template = i32] +// CHECK:STDOUT: %.loc2_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_15: init type = call constants.%Int(%.loc2_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_15.2: type = value_of_initializer %int.make_type_signed.loc2_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_15.3: type = converted %int.make_type_signed.loc2_15, %.loc2_15.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_23: init type = call constants.%Int(%.loc2_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_23.2: type = value_of_initializer %int.make_type_signed.loc2_23 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_23.3: type = converted %int.make_type_signed.loc2_23, %.loc2_23.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_31.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_31.2: type = converted %bool.make_type, %.loc2_31.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc3_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_32.loc3_14 [template = i32] -// CHECK:STDOUT: %.loc3_14.2: type = converted %int.make_type_32.loc3_14, %.loc3_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc3_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc3_22.1: type = value_of_initializer %int.make_type_32.loc3_22 [template = i32] -// CHECK:STDOUT: %.loc3_22.2: type = converted %int.make_type_32.loc3_22, %.loc3_22.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc3_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc3_14: init type = call constants.%Int(%.loc3_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc3_14.2: type = value_of_initializer %int.make_type_signed.loc3_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_14.3: type = converted %int.make_type_signed.loc3_14, %.loc3_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc3_22: init type = call constants.%Int(%.loc3_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc3_22.2: type = value_of_initializer %int.make_type_signed.loc3_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_22.3: type = converted %int.make_type_signed.loc3_22, %.loc3_22.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} // CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} @@ -143,68 +152,72 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc16_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32.loc16_19 [template = i32] -// CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_32.loc16_19, %.loc16_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc16_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %int.make_type_32.loc16_27 [template = i32] -// CHECK:STDOUT: %.loc16_27.2: type = converted %int.make_type_32.loc16_27, %.loc16_27.1 [template = i32] +// CHECK:STDOUT: %.loc16_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16_19: init type = call constants.%Int(%.loc16_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_19.2: type = value_of_initializer %int.make_type_signed.loc16_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_19.3: type = converted %int.make_type_signed.loc16_19, %.loc16_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16_27: init type = call constants.%Int(%.loc16_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_27.2: type = value_of_initializer %int.make_type_signed.loc16_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_27.3: type = converted %int.make_type_signed.loc16_27, %.loc16_27.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %.loc5: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc5: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %.loc6: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Greater(%a.param_patt: i32, %b.param_patt: i32) -> bool = "int.greater"; +// CHECK:STDOUT: fn @Greater(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.greater"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %false_.ref.loc9: %False = name_ref false_, %false_ // CHECK:STDOUT: %Greater.ref.loc9: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] -// CHECK:STDOUT: %.loc9_25.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc9_28.1: Core.IntLiteral = int_value 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_25.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_25.3: = bound_method %.loc9_25.1, %.loc9_25.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc9_25: init i32 = call %.loc9_25.3(%.loc9_25.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc9_25.4: i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_25.5: i32 = converted %.loc9_25.1, %.loc9_25.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_28.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_28.3: = bound_method %.loc9_28.1, %.loc9_28.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc9_28: init i32 = call %.loc9_28.3(%.loc9_28.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc9_28.4: i32 = value_of_initializer %int.convert_checked.loc9_28 [template = constants.%.33] -// CHECK:STDOUT: %.loc9_28.5: i32 = converted %.loc9_28.1, %.loc9_28.4 [template = constants.%.33] -// CHECK:STDOUT: %int.greater.loc9: init bool = call %Greater.ref.loc9(%.loc9_25.5, %.loc9_28.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %int.greater.loc9 [template = constants.%.34] -// CHECK:STDOUT: %.loc9_14.2: bool = converted %int.greater.loc9, %.loc9_14.1 [template = constants.%.34] +// CHECK:STDOUT: %.loc9_25.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_28.1: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_25.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_25.3: = bound_method %.loc9_25.1, %.loc9_25.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_25.4: = specific_function %.loc9_25.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %.loc9_25.4(%.loc9_25.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc9_25.5: %i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%.29] +// CHECK:STDOUT: %.loc9_25.6: %i32 = converted %.loc9_25.1, %.loc9_25.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc9_28.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_28.3: = bound_method %.loc9_28.1, %.loc9_28.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc9_28.4: = specific_function %.loc9_28.3, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc9_28: init %i32 = call %.loc9_28.4(%.loc9_28.1) [template = constants.%.32] +// CHECK:STDOUT: %.loc9_28.5: %i32 = value_of_initializer %int.convert_checked.loc9_28 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_28.6: %i32 = converted %.loc9_28.1, %.loc9_28.5 [template = constants.%.32] +// CHECK:STDOUT: %int.greater.loc9: init bool = call %Greater.ref.loc9(%.loc9_25.6, %.loc9_28.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %int.greater.loc9 [template = constants.%.33] +// CHECK:STDOUT: %.loc9_14.2: bool = converted %int.greater.loc9, %.loc9_14.1 [template = constants.%.33] // CHECK:STDOUT: if %.loc9_14.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: @@ -219,21 +232,23 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc9_14.3: type = block_arg !if.expr.result.loc9 [template = constants.%False] // CHECK:STDOUT: %false_.ref.loc10: %False = name_ref false_, %false_ // CHECK:STDOUT: %Greater.ref.loc10: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] -// CHECK:STDOUT: %.loc10_25.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc10_28.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc10_25.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_25.3: = bound_method %.loc10_25.1, %.loc10_25.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc10_25: init i32 = call %.loc10_25.3(%.loc10_25.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc10_25.4: i32 = value_of_initializer %int.convert_checked.loc10_25 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_25.5: i32 = converted %.loc10_25.1, %.loc10_25.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_28.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_28.3: = bound_method %.loc10_28.1, %.loc10_28.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc10_28: init i32 = call %.loc10_28.3(%.loc10_28.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc10_28.4: i32 = value_of_initializer %int.convert_checked.loc10_28 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_28.5: i32 = converted %.loc10_28.1, %.loc10_28.4 [template = constants.%.31] -// CHECK:STDOUT: %int.greater.loc10: init bool = call %Greater.ref.loc10(%.loc10_25.5, %.loc10_28.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc10_14.1: bool = value_of_initializer %int.greater.loc10 [template = constants.%.34] -// CHECK:STDOUT: %.loc10_14.2: bool = converted %int.greater.loc10, %.loc10_14.1 [template = constants.%.34] +// CHECK:STDOUT: %.loc10_25.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc10_28.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc10_25.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_25.3: = bound_method %.loc10_25.1, %.loc10_25.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc10_25.4: = specific_function %.loc10_25.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc10_25: init %i32 = call %.loc10_25.4(%.loc10_25.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc10_25.5: %i32 = value_of_initializer %int.convert_checked.loc10_25 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_25.6: %i32 = converted %.loc10_25.1, %.loc10_25.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_28.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_28.3: = bound_method %.loc10_28.1, %.loc10_28.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc10_28.4: = specific_function %.loc10_28.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc10_28: init %i32 = call %.loc10_28.4(%.loc10_28.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc10_28.5: %i32 = value_of_initializer %int.convert_checked.loc10_28 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_28.6: %i32 = converted %.loc10_28.1, %.loc10_28.5 [template = constants.%.29] +// CHECK:STDOUT: %int.greater.loc10: init bool = call %Greater.ref.loc10(%.loc10_25.6, %.loc10_28.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc10_14.1: bool = value_of_initializer %int.greater.loc10 [template = constants.%.33] +// CHECK:STDOUT: %.loc10_14.2: bool = converted %int.greater.loc10, %.loc10_14.1 [template = constants.%.33] // CHECK:STDOUT: if %.loc10_14.2 br !if.expr.then.loc10 else br !if.expr.else.loc10 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc10: @@ -248,19 +263,21 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc10_14.3: type = block_arg !if.expr.result.loc10 [template = constants.%False] // CHECK:STDOUT: %true_.ref.loc11: %True = name_ref true_, %true_ // CHECK:STDOUT: %Greater.ref.loc11: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] -// CHECK:STDOUT: %.loc11_24.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_27.1: Core.IntLiteral = int_value 0 [template = constants.%.35] -// CHECK:STDOUT: %.loc11_24.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_24.3: = bound_method %.loc11_24.1, %.loc11_24.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_24: init i32 = call %.loc11_24.3(%.loc11_24.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_24.4: i32 = value_of_initializer %int.convert_checked.loc11_24 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_24.5: i32 = converted %.loc11_24.1, %.loc11_24.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_27.1, %.loc11_27.2 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc11_27: init i32 = call %.loc11_27.3(%.loc11_27.1) [template = constants.%.37] -// CHECK:STDOUT: %.loc11_27.4: i32 = value_of_initializer %int.convert_checked.loc11_27 [template = constants.%.37] -// CHECK:STDOUT: %.loc11_27.5: i32 = converted %.loc11_27.1, %.loc11_27.4 [template = constants.%.37] -// CHECK:STDOUT: %int.greater.loc11: init bool = call %Greater.ref.loc11(%.loc11_24.5, %.loc11_27.5) [template = constants.%.38] +// CHECK:STDOUT: %.loc11_24.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_27.1: Core.IntLiteral = int_value 0 [template = constants.%.34] +// CHECK:STDOUT: %.loc11_24.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_24.3: = bound_method %.loc11_24.1, %.loc11_24.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_24.4: = specific_function %.loc11_24.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc11_24: init %i32 = call %.loc11_24.4(%.loc11_24.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc11_24.5: %i32 = value_of_initializer %int.convert_checked.loc11_24 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_24.6: %i32 = converted %.loc11_24.1, %.loc11_24.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_27.1, %.loc11_27.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc11_27.4: = specific_function %.loc11_27.3, @Convert.2(constants.%.1) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc11_27: init %i32 = call %.loc11_27.4(%.loc11_27.1) [template = constants.%.37] +// CHECK:STDOUT: %.loc11_27.5: %i32 = value_of_initializer %int.convert_checked.loc11_27 [template = constants.%.37] +// CHECK:STDOUT: %.loc11_27.6: %i32 = converted %.loc11_27.1, %.loc11_27.5 [template = constants.%.37] +// CHECK:STDOUT: %int.greater.loc11: init bool = call %Greater.ref.loc11(%.loc11_24.6, %.loc11_27.6) [template = constants.%.38] // CHECK:STDOUT: %.loc11_13.1: bool = value_of_initializer %int.greater.loc11 [template = constants.%.38] // CHECK:STDOUT: %.loc11_13.2: bool = converted %int.greater.loc11, %.loc11_13.1 [template = constants.%.38] // CHECK:STDOUT: if %.loc11_13.2 br !if.expr.then.loc11 else br !if.expr.else.loc11 @@ -278,24 +295,26 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_.ref.loc12: %False = name_ref false_, %false_ // CHECK:STDOUT: %Greater.ref.loc12: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_32.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_32.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_32.3: = bound_method %.loc12_32.1, %.loc12_32.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc12_32: init i32 = call %.loc12_32.3(%.loc12_32.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc12_32.4: i32 = value_of_initializer %int.convert_checked.loc12_32 [template = constants.%.31] -// CHECK:STDOUT: %.loc12_32.5: i32 = converted %.loc12_32.1, %.loc12_32.4 [template = constants.%.31] -// CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_32.5) [template = constants.%.39] -// CHECK:STDOUT: %.loc12_36.1: Core.IntLiteral = int_value 0 [template = constants.%.35] -// CHECK:STDOUT: %.loc12_31.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.39] -// CHECK:STDOUT: %.loc12_31.2: i32 = converted %int.snegate.loc12, %.loc12_31.1 [template = constants.%.39] -// CHECK:STDOUT: %.loc12_36.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_36.3: = bound_method %.loc12_36.1, %.loc12_36.2 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc12_36: init i32 = call %.loc12_36.3(%.loc12_36.1) [template = constants.%.37] -// CHECK:STDOUT: %.loc12_36.4: i32 = value_of_initializer %int.convert_checked.loc12_36 [template = constants.%.37] -// CHECK:STDOUT: %.loc12_36.5: i32 = converted %.loc12_36.1, %.loc12_36.4 [template = constants.%.37] -// CHECK:STDOUT: %int.greater.loc12: init bool = call %Greater.ref.loc12(%.loc12_31.2, %.loc12_36.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %int.greater.loc12 [template = constants.%.34] -// CHECK:STDOUT: %.loc12_14.2: bool = converted %int.greater.loc12, %.loc12_14.1 [template = constants.%.34] +// CHECK:STDOUT: %.loc12_32.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc12_32.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_32.3: = bound_method %.loc12_32.1, %.loc12_32.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_32.4: = specific_function %.loc12_32.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc12_32: init %i32 = call %.loc12_32.4(%.loc12_32.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc12_32.5: %i32 = value_of_initializer %int.convert_checked.loc12_32 [template = constants.%.29] +// CHECK:STDOUT: %.loc12_32.6: %i32 = converted %.loc12_32.1, %.loc12_32.5 [template = constants.%.29] +// CHECK:STDOUT: %int.snegate.loc12: init %i32 = call %Negate.ref.loc12(%.loc12_32.6) [template = constants.%.39] +// CHECK:STDOUT: %.loc12_36.1: Core.IntLiteral = int_value 0 [template = constants.%.34] +// CHECK:STDOUT: %.loc12_31.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.39] +// CHECK:STDOUT: %.loc12_31.2: %i32 = converted %int.snegate.loc12, %.loc12_31.1 [template = constants.%.39] +// CHECK:STDOUT: %.loc12_36.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_36.3: = bound_method %.loc12_36.1, %.loc12_36.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc12_36.4: = specific_function %.loc12_36.3, @Convert.2(constants.%.1) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc12_36: init %i32 = call %.loc12_36.4(%.loc12_36.1) [template = constants.%.37] +// CHECK:STDOUT: %.loc12_36.5: %i32 = value_of_initializer %int.convert_checked.loc12_36 [template = constants.%.37] +// CHECK:STDOUT: %.loc12_36.6: %i32 = converted %.loc12_36.1, %.loc12_36.5 [template = constants.%.37] +// CHECK:STDOUT: %int.greater.loc12: init bool = call %Greater.ref.loc12(%.loc12_31.2, %.loc12_36.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %int.greater.loc12 [template = constants.%.33] +// CHECK:STDOUT: %.loc12_14.2: bool = converted %int.greater.loc12, %.loc12_14.1 [template = constants.%.33] // CHECK:STDOUT: if %.loc12_14.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc12: @@ -310,23 +329,25 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc12_14.3: type = block_arg !if.expr.result.loc12 [template = constants.%False] // CHECK:STDOUT: %true_.ref.loc13: %True = name_ref true_, %true_ // CHECK:STDOUT: %Greater.ref.loc13: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] -// CHECK:STDOUT: %.loc13_24.1: Core.IntLiteral = int_value 0 [template = constants.%.35] +// CHECK:STDOUT: %.loc13_24.1: Core.IntLiteral = int_value 0 [template = constants.%.34] // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc13_34.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc13_34.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_34.3: = bound_method %.loc13_34.1, %.loc13_34.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc13_34: init i32 = call %.loc13_34.3(%.loc13_34.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc13_34.4: i32 = value_of_initializer %int.convert_checked.loc13_34 [template = constants.%.31] -// CHECK:STDOUT: %.loc13_34.5: i32 = converted %.loc13_34.1, %.loc13_34.4 [template = constants.%.31] -// CHECK:STDOUT: %int.snegate.loc13: init i32 = call %Negate.ref.loc13(%.loc13_34.5) [template = constants.%.39] -// CHECK:STDOUT: %.loc13_24.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_24.3: = bound_method %.loc13_24.1, %.loc13_24.2 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc13_24: init i32 = call %.loc13_24.3(%.loc13_24.1) [template = constants.%.37] -// CHECK:STDOUT: %.loc13_24.4: i32 = value_of_initializer %int.convert_checked.loc13_24 [template = constants.%.37] -// CHECK:STDOUT: %.loc13_24.5: i32 = converted %.loc13_24.1, %.loc13_24.4 [template = constants.%.37] -// CHECK:STDOUT: %.loc13_33.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.39] -// CHECK:STDOUT: %.loc13_33.2: i32 = converted %int.snegate.loc13, %.loc13_33.1 [template = constants.%.39] -// CHECK:STDOUT: %int.greater.loc13: init bool = call %Greater.ref.loc13(%.loc13_24.5, %.loc13_33.2) [template = constants.%.38] +// CHECK:STDOUT: %.loc13_34.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc13_34.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_34.3: = bound_method %.loc13_34.1, %.loc13_34.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc13_34.4: = specific_function %.loc13_34.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc13_34: init %i32 = call %.loc13_34.4(%.loc13_34.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc13_34.5: %i32 = value_of_initializer %int.convert_checked.loc13_34 [template = constants.%.29] +// CHECK:STDOUT: %.loc13_34.6: %i32 = converted %.loc13_34.1, %.loc13_34.5 [template = constants.%.29] +// CHECK:STDOUT: %int.snegate.loc13: init %i32 = call %Negate.ref.loc13(%.loc13_34.6) [template = constants.%.39] +// CHECK:STDOUT: %.loc13_24.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_24.3: = bound_method %.loc13_24.1, %.loc13_24.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc13_24.4: = specific_function %.loc13_24.3, @Convert.2(constants.%.1) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc13_24: init %i32 = call %.loc13_24.4(%.loc13_24.1) [template = constants.%.37] +// CHECK:STDOUT: %.loc13_24.5: %i32 = value_of_initializer %int.convert_checked.loc13_24 [template = constants.%.37] +// CHECK:STDOUT: %.loc13_24.6: %i32 = converted %.loc13_24.1, %.loc13_24.5 [template = constants.%.37] +// CHECK:STDOUT: %.loc13_33.1: %i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.39] +// CHECK:STDOUT: %.loc13_33.2: %i32 = converted %int.snegate.loc13, %.loc13_33.1 [template = constants.%.39] +// CHECK:STDOUT: %int.greater.loc13: init bool = call %Greater.ref.loc13(%.loc13_24.6, %.loc13_33.2) [template = constants.%.38] // CHECK:STDOUT: %.loc13_13.1: bool = value_of_initializer %int.greater.loc13 [template = constants.%.38] // CHECK:STDOUT: %.loc13_13.2: bool = converted %int.greater.loc13, %.loc13_13.1 [template = constants.%.38] // CHECK:STDOUT: if %.loc13_13.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 @@ -344,11 +365,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Greater.ref: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.greater: init bool = call %Greater.ref(%a.ref, %b.ref) // CHECK:STDOUT: %.loc17_23.1: bool = value_of_initializer %int.greater // CHECK:STDOUT: %.loc17_23.2: bool = converted %int.greater, %.loc17_23.1 diff --git a/toolchain/check/testdata/builtins/int/greater_eq.carbon b/toolchain/check/testdata/builtins/int/greater_eq.carbon index c223ac745224..decf54bf22d5 100644 --- a/toolchain/check/testdata/builtins/int/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/int/greater_eq.carbon @@ -31,8 +31,10 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: --- int_greater_eq.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %GreaterEq.type: type = fn_type @GreaterEq [template] @@ -40,34 +42,37 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 2 [template] -// CHECK:STDOUT: %.34: bool = bool_literal false [template] -// CHECK:STDOUT: %.35: bool = bool_literal true [template] -// CHECK:STDOUT: %.36: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.37: = bound_method %.36, %Convert.15 [template] -// CHECK:STDOUT: %.38: i32 = int_value 0 [template] -// CHECK:STDOUT: %.39: i32 = int_value -1 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.30: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.33: bool = bool_literal false [template] +// CHECK:STDOUT: %.34: bool = bool_literal true [template] +// CHECK:STDOUT: %.35: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.36: = bound_method %.35, %Convert.14 [template] +// CHECK:STDOUT: %.37: = specific_function %.36, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.38: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.39: %i32 = int_value -1 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude @@ -87,45 +92,49 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %GreaterEq.decl: %GreaterEq.type = fn_decl @GreaterEq [template = constants.%GreaterEq] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_17.1: type = value_of_initializer %int.make_type_32.loc2_17 [template = i32] -// CHECK:STDOUT: %.loc2_17.2: type = converted %int.make_type_32.loc2_17, %.loc2_17.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_25.1: type = value_of_initializer %int.make_type_32.loc2_25 [template = i32] -// CHECK:STDOUT: %.loc2_25.2: type = converted %int.make_type_32.loc2_25, %.loc2_25.1 [template = i32] +// CHECK:STDOUT: %.loc2_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_17: init type = call constants.%Int(%.loc2_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_17.2: type = value_of_initializer %int.make_type_signed.loc2_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_17.3: type = converted %int.make_type_signed.loc2_17, %.loc2_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_25: init type = call constants.%Int(%.loc2_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_25.2: type = value_of_initializer %int.make_type_signed.loc2_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_25.3: type = converted %int.make_type_signed.loc2_25, %.loc2_25.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_33.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_33.2: type = converted %bool.make_type, %.loc2_33.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc3_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_32.loc3_14 [template = i32] -// CHECK:STDOUT: %.loc3_14.2: type = converted %int.make_type_32.loc3_14, %.loc3_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc3_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc3_22.1: type = value_of_initializer %int.make_type_32.loc3_22 [template = i32] -// CHECK:STDOUT: %.loc3_22.2: type = converted %int.make_type_32.loc3_22, %.loc3_22.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc3_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc3_14: init type = call constants.%Int(%.loc3_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc3_14.2: type = value_of_initializer %int.make_type_signed.loc3_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_14.3: type = converted %int.make_type_signed.loc3_14, %.loc3_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc3_22: init type = call constants.%Int(%.loc3_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc3_22.2: type = value_of_initializer %int.make_type_signed.loc3_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_22.3: type = converted %int.make_type_signed.loc3_22, %.loc3_22.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} // CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} @@ -143,68 +152,72 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc16_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32.loc16_19 [template = i32] -// CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_32.loc16_19, %.loc16_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc16_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %int.make_type_32.loc16_27 [template = i32] -// CHECK:STDOUT: %.loc16_27.2: type = converted %int.make_type_32.loc16_27, %.loc16_27.1 [template = i32] +// CHECK:STDOUT: %.loc16_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16_19: init type = call constants.%Int(%.loc16_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_19.2: type = value_of_initializer %int.make_type_signed.loc16_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_19.3: type = converted %int.make_type_signed.loc16_19, %.loc16_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16_27: init type = call constants.%Int(%.loc16_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_27.2: type = value_of_initializer %int.make_type_signed.loc16_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_27.3: type = converted %int.make_type_signed.loc16_27, %.loc16_27.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %.loc5: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc5: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %.loc6: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @GreaterEq(%a.param_patt: i32, %b.param_patt: i32) -> bool = "int.greater_eq"; +// CHECK:STDOUT: fn @GreaterEq(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.greater_eq"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %false_.ref.loc9: %False = name_ref false_, %false_ // CHECK:STDOUT: %GreaterEq.ref.loc9: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %.loc9_27.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc9_30.1: Core.IntLiteral = int_value 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_27.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_27.3: = bound_method %.loc9_27.1, %.loc9_27.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc9_27: init i32 = call %.loc9_27.3(%.loc9_27.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc9_27.4: i32 = value_of_initializer %int.convert_checked.loc9_27 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_27.5: i32 = converted %.loc9_27.1, %.loc9_27.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_30.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_30.3: = bound_method %.loc9_30.1, %.loc9_30.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc9_30: init i32 = call %.loc9_30.3(%.loc9_30.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc9_30.4: i32 = value_of_initializer %int.convert_checked.loc9_30 [template = constants.%.33] -// CHECK:STDOUT: %.loc9_30.5: i32 = converted %.loc9_30.1, %.loc9_30.4 [template = constants.%.33] -// CHECK:STDOUT: %int.greater_eq.loc9: init bool = call %GreaterEq.ref.loc9(%.loc9_27.5, %.loc9_30.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %int.greater_eq.loc9 [template = constants.%.34] -// CHECK:STDOUT: %.loc9_14.2: bool = converted %int.greater_eq.loc9, %.loc9_14.1 [template = constants.%.34] +// CHECK:STDOUT: %.loc9_27.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_30.1: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_27.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_27.3: = bound_method %.loc9_27.1, %.loc9_27.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_27.4: = specific_function %.loc9_27.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc9_27: init %i32 = call %.loc9_27.4(%.loc9_27.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc9_27.5: %i32 = value_of_initializer %int.convert_checked.loc9_27 [template = constants.%.29] +// CHECK:STDOUT: %.loc9_27.6: %i32 = converted %.loc9_27.1, %.loc9_27.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc9_30.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_30.3: = bound_method %.loc9_30.1, %.loc9_30.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc9_30.4: = specific_function %.loc9_30.3, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc9_30: init %i32 = call %.loc9_30.4(%.loc9_30.1) [template = constants.%.32] +// CHECK:STDOUT: %.loc9_30.5: %i32 = value_of_initializer %int.convert_checked.loc9_30 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_30.6: %i32 = converted %.loc9_30.1, %.loc9_30.5 [template = constants.%.32] +// CHECK:STDOUT: %int.greater_eq.loc9: init bool = call %GreaterEq.ref.loc9(%.loc9_27.6, %.loc9_30.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %int.greater_eq.loc9 [template = constants.%.33] +// CHECK:STDOUT: %.loc9_14.2: bool = converted %int.greater_eq.loc9, %.loc9_14.1 [template = constants.%.33] // CHECK:STDOUT: if %.loc9_14.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: @@ -219,21 +232,23 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc9_14.3: type = block_arg !if.expr.result.loc9 [template = constants.%False] // CHECK:STDOUT: %true_.ref.loc10: %True = name_ref true_, %true_ // CHECK:STDOUT: %GreaterEq.ref.loc10: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %.loc10_26.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc10_29.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc10_26.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_26.3: = bound_method %.loc10_26.1, %.loc10_26.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc10_26: init i32 = call %.loc10_26.3(%.loc10_26.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc10_26.4: i32 = value_of_initializer %int.convert_checked.loc10_26 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_26.5: i32 = converted %.loc10_26.1, %.loc10_26.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_29.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_29.3: = bound_method %.loc10_29.1, %.loc10_29.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc10_29: init i32 = call %.loc10_29.3(%.loc10_29.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc10_29.4: i32 = value_of_initializer %int.convert_checked.loc10_29 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_29.5: i32 = converted %.loc10_29.1, %.loc10_29.4 [template = constants.%.31] -// CHECK:STDOUT: %int.greater_eq.loc10: init bool = call %GreaterEq.ref.loc10(%.loc10_26.5, %.loc10_29.5) [template = constants.%.35] -// CHECK:STDOUT: %.loc10_13.1: bool = value_of_initializer %int.greater_eq.loc10 [template = constants.%.35] -// CHECK:STDOUT: %.loc10_13.2: bool = converted %int.greater_eq.loc10, %.loc10_13.1 [template = constants.%.35] +// CHECK:STDOUT: %.loc10_26.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc10_29.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc10_26.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_26.3: = bound_method %.loc10_26.1, %.loc10_26.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc10_26.4: = specific_function %.loc10_26.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc10_26: init %i32 = call %.loc10_26.4(%.loc10_26.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc10_26.5: %i32 = value_of_initializer %int.convert_checked.loc10_26 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_26.6: %i32 = converted %.loc10_26.1, %.loc10_26.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_29.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_29.3: = bound_method %.loc10_29.1, %.loc10_29.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc10_29.4: = specific_function %.loc10_29.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc10_29: init %i32 = call %.loc10_29.4(%.loc10_29.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc10_29.5: %i32 = value_of_initializer %int.convert_checked.loc10_29 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_29.6: %i32 = converted %.loc10_29.1, %.loc10_29.5 [template = constants.%.29] +// CHECK:STDOUT: %int.greater_eq.loc10: init bool = call %GreaterEq.ref.loc10(%.loc10_26.6, %.loc10_29.6) [template = constants.%.34] +// CHECK:STDOUT: %.loc10_13.1: bool = value_of_initializer %int.greater_eq.loc10 [template = constants.%.34] +// CHECK:STDOUT: %.loc10_13.2: bool = converted %int.greater_eq.loc10, %.loc10_13.1 [template = constants.%.34] // CHECK:STDOUT: if %.loc10_13.2 br !if.expr.then.loc10 else br !if.expr.else.loc10 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc10: @@ -248,21 +263,23 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc10_13.3: type = block_arg !if.expr.result.loc10 [template = constants.%True] // CHECK:STDOUT: %true_.ref.loc11: %True = name_ref true_, %true_ // CHECK:STDOUT: %GreaterEq.ref.loc11: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %.loc11_26.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_29.1: Core.IntLiteral = int_value 0 [template = constants.%.36] -// CHECK:STDOUT: %.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_26.3: = bound_method %.loc11_26.1, %.loc11_26.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_26: init i32 = call %.loc11_26.3(%.loc11_26.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_26.4: i32 = value_of_initializer %int.convert_checked.loc11_26 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_26.5: i32 = converted %.loc11_26.1, %.loc11_26.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_29.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_29.3: = bound_method %.loc11_29.1, %.loc11_29.2 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc11_29: init i32 = call %.loc11_29.3(%.loc11_29.1) [template = constants.%.38] -// CHECK:STDOUT: %.loc11_29.4: i32 = value_of_initializer %int.convert_checked.loc11_29 [template = constants.%.38] -// CHECK:STDOUT: %.loc11_29.5: i32 = converted %.loc11_29.1, %.loc11_29.4 [template = constants.%.38] -// CHECK:STDOUT: %int.greater_eq.loc11: init bool = call %GreaterEq.ref.loc11(%.loc11_26.5, %.loc11_29.5) [template = constants.%.35] -// CHECK:STDOUT: %.loc11_13.1: bool = value_of_initializer %int.greater_eq.loc11 [template = constants.%.35] -// CHECK:STDOUT: %.loc11_13.2: bool = converted %int.greater_eq.loc11, %.loc11_13.1 [template = constants.%.35] +// CHECK:STDOUT: %.loc11_26.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_29.1: Core.IntLiteral = int_value 0 [template = constants.%.35] +// CHECK:STDOUT: %.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_26.3: = bound_method %.loc11_26.1, %.loc11_26.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_26.4: = specific_function %.loc11_26.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc11_26: init %i32 = call %.loc11_26.4(%.loc11_26.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc11_26.5: %i32 = value_of_initializer %int.convert_checked.loc11_26 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_26.6: %i32 = converted %.loc11_26.1, %.loc11_26.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_29.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_29.3: = bound_method %.loc11_29.1, %.loc11_29.2 [template = constants.%.36] +// CHECK:STDOUT: %.loc11_29.4: = specific_function %.loc11_29.3, @Convert.2(constants.%.1) [template = constants.%.37] +// CHECK:STDOUT: %int.convert_checked.loc11_29: init %i32 = call %.loc11_29.4(%.loc11_29.1) [template = constants.%.38] +// CHECK:STDOUT: %.loc11_29.5: %i32 = value_of_initializer %int.convert_checked.loc11_29 [template = constants.%.38] +// CHECK:STDOUT: %.loc11_29.6: %i32 = converted %.loc11_29.1, %.loc11_29.5 [template = constants.%.38] +// CHECK:STDOUT: %int.greater_eq.loc11: init bool = call %GreaterEq.ref.loc11(%.loc11_26.6, %.loc11_29.6) [template = constants.%.34] +// CHECK:STDOUT: %.loc11_13.1: bool = value_of_initializer %int.greater_eq.loc11 [template = constants.%.34] +// CHECK:STDOUT: %.loc11_13.2: bool = converted %int.greater_eq.loc11, %.loc11_13.1 [template = constants.%.34] // CHECK:STDOUT: if %.loc11_13.2 br !if.expr.then.loc11 else br !if.expr.else.loc11 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc11: @@ -278,24 +295,26 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_.ref.loc12: %False = name_ref false_, %false_ // CHECK:STDOUT: %GreaterEq.ref.loc12: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_34.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_34.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_34.3: = bound_method %.loc12_34.1, %.loc12_34.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc12_34: init i32 = call %.loc12_34.3(%.loc12_34.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc12_34.4: i32 = value_of_initializer %int.convert_checked.loc12_34 [template = constants.%.31] -// CHECK:STDOUT: %.loc12_34.5: i32 = converted %.loc12_34.1, %.loc12_34.4 [template = constants.%.31] -// CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_34.5) [template = constants.%.39] -// CHECK:STDOUT: %.loc12_38.1: Core.IntLiteral = int_value 0 [template = constants.%.36] -// CHECK:STDOUT: %.loc12_33.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.39] -// CHECK:STDOUT: %.loc12_33.2: i32 = converted %int.snegate.loc12, %.loc12_33.1 [template = constants.%.39] -// CHECK:STDOUT: %.loc12_38.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_38.3: = bound_method %.loc12_38.1, %.loc12_38.2 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc12_38: init i32 = call %.loc12_38.3(%.loc12_38.1) [template = constants.%.38] -// CHECK:STDOUT: %.loc12_38.4: i32 = value_of_initializer %int.convert_checked.loc12_38 [template = constants.%.38] -// CHECK:STDOUT: %.loc12_38.5: i32 = converted %.loc12_38.1, %.loc12_38.4 [template = constants.%.38] -// CHECK:STDOUT: %int.greater_eq.loc12: init bool = call %GreaterEq.ref.loc12(%.loc12_33.2, %.loc12_38.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %int.greater_eq.loc12 [template = constants.%.34] -// CHECK:STDOUT: %.loc12_14.2: bool = converted %int.greater_eq.loc12, %.loc12_14.1 [template = constants.%.34] +// CHECK:STDOUT: %.loc12_34.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc12_34.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_34.3: = bound_method %.loc12_34.1, %.loc12_34.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_34.4: = specific_function %.loc12_34.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc12_34: init %i32 = call %.loc12_34.4(%.loc12_34.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc12_34.5: %i32 = value_of_initializer %int.convert_checked.loc12_34 [template = constants.%.29] +// CHECK:STDOUT: %.loc12_34.6: %i32 = converted %.loc12_34.1, %.loc12_34.5 [template = constants.%.29] +// CHECK:STDOUT: %int.snegate.loc12: init %i32 = call %Negate.ref.loc12(%.loc12_34.6) [template = constants.%.39] +// CHECK:STDOUT: %.loc12_38.1: Core.IntLiteral = int_value 0 [template = constants.%.35] +// CHECK:STDOUT: %.loc12_33.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.39] +// CHECK:STDOUT: %.loc12_33.2: %i32 = converted %int.snegate.loc12, %.loc12_33.1 [template = constants.%.39] +// CHECK:STDOUT: %.loc12_38.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_38.3: = bound_method %.loc12_38.1, %.loc12_38.2 [template = constants.%.36] +// CHECK:STDOUT: %.loc12_38.4: = specific_function %.loc12_38.3, @Convert.2(constants.%.1) [template = constants.%.37] +// CHECK:STDOUT: %int.convert_checked.loc12_38: init %i32 = call %.loc12_38.4(%.loc12_38.1) [template = constants.%.38] +// CHECK:STDOUT: %.loc12_38.5: %i32 = value_of_initializer %int.convert_checked.loc12_38 [template = constants.%.38] +// CHECK:STDOUT: %.loc12_38.6: %i32 = converted %.loc12_38.1, %.loc12_38.5 [template = constants.%.38] +// CHECK:STDOUT: %int.greater_eq.loc12: init bool = call %GreaterEq.ref.loc12(%.loc12_33.2, %.loc12_38.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %int.greater_eq.loc12 [template = constants.%.33] +// CHECK:STDOUT: %.loc12_14.2: bool = converted %int.greater_eq.loc12, %.loc12_14.1 [template = constants.%.33] // CHECK:STDOUT: if %.loc12_14.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc12: @@ -310,25 +329,27 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc12_14.3: type = block_arg !if.expr.result.loc12 [template = constants.%False] // CHECK:STDOUT: %true_.ref.loc13: %True = name_ref true_, %true_ // CHECK:STDOUT: %GreaterEq.ref.loc13: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %.loc13_26.1: Core.IntLiteral = int_value 0 [template = constants.%.36] +// CHECK:STDOUT: %.loc13_26.1: Core.IntLiteral = int_value 0 [template = constants.%.35] // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc13_36.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc13_36.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_36.3: = bound_method %.loc13_36.1, %.loc13_36.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc13_36: init i32 = call %.loc13_36.3(%.loc13_36.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc13_36.4: i32 = value_of_initializer %int.convert_checked.loc13_36 [template = constants.%.31] -// CHECK:STDOUT: %.loc13_36.5: i32 = converted %.loc13_36.1, %.loc13_36.4 [template = constants.%.31] -// CHECK:STDOUT: %int.snegate.loc13: init i32 = call %Negate.ref.loc13(%.loc13_36.5) [template = constants.%.39] -// CHECK:STDOUT: %.loc13_26.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_26.3: = bound_method %.loc13_26.1, %.loc13_26.2 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc13_26: init i32 = call %.loc13_26.3(%.loc13_26.1) [template = constants.%.38] -// CHECK:STDOUT: %.loc13_26.4: i32 = value_of_initializer %int.convert_checked.loc13_26 [template = constants.%.38] -// CHECK:STDOUT: %.loc13_26.5: i32 = converted %.loc13_26.1, %.loc13_26.4 [template = constants.%.38] -// CHECK:STDOUT: %.loc13_35.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.39] -// CHECK:STDOUT: %.loc13_35.2: i32 = converted %int.snegate.loc13, %.loc13_35.1 [template = constants.%.39] -// CHECK:STDOUT: %int.greater_eq.loc13: init bool = call %GreaterEq.ref.loc13(%.loc13_26.5, %.loc13_35.2) [template = constants.%.35] -// CHECK:STDOUT: %.loc13_13.1: bool = value_of_initializer %int.greater_eq.loc13 [template = constants.%.35] -// CHECK:STDOUT: %.loc13_13.2: bool = converted %int.greater_eq.loc13, %.loc13_13.1 [template = constants.%.35] +// CHECK:STDOUT: %.loc13_36.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc13_36.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_36.3: = bound_method %.loc13_36.1, %.loc13_36.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc13_36.4: = specific_function %.loc13_36.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc13_36: init %i32 = call %.loc13_36.4(%.loc13_36.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc13_36.5: %i32 = value_of_initializer %int.convert_checked.loc13_36 [template = constants.%.29] +// CHECK:STDOUT: %.loc13_36.6: %i32 = converted %.loc13_36.1, %.loc13_36.5 [template = constants.%.29] +// CHECK:STDOUT: %int.snegate.loc13: init %i32 = call %Negate.ref.loc13(%.loc13_36.6) [template = constants.%.39] +// CHECK:STDOUT: %.loc13_26.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_26.3: = bound_method %.loc13_26.1, %.loc13_26.2 [template = constants.%.36] +// CHECK:STDOUT: %.loc13_26.4: = specific_function %.loc13_26.3, @Convert.2(constants.%.1) [template = constants.%.37] +// CHECK:STDOUT: %int.convert_checked.loc13_26: init %i32 = call %.loc13_26.4(%.loc13_26.1) [template = constants.%.38] +// CHECK:STDOUT: %.loc13_26.5: %i32 = value_of_initializer %int.convert_checked.loc13_26 [template = constants.%.38] +// CHECK:STDOUT: %.loc13_26.6: %i32 = converted %.loc13_26.1, %.loc13_26.5 [template = constants.%.38] +// CHECK:STDOUT: %.loc13_35.1: %i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.39] +// CHECK:STDOUT: %.loc13_35.2: %i32 = converted %int.snegate.loc13, %.loc13_35.1 [template = constants.%.39] +// CHECK:STDOUT: %int.greater_eq.loc13: init bool = call %GreaterEq.ref.loc13(%.loc13_26.6, %.loc13_35.2) [template = constants.%.34] +// CHECK:STDOUT: %.loc13_13.1: bool = value_of_initializer %int.greater_eq.loc13 [template = constants.%.34] +// CHECK:STDOUT: %.loc13_13.2: bool = converted %int.greater_eq.loc13, %.loc13_13.1 [template = constants.%.34] // CHECK:STDOUT: if %.loc13_13.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc13: @@ -344,11 +365,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %GreaterEq.ref: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.greater_eq: init bool = call %GreaterEq.ref(%a.ref, %b.ref) // CHECK:STDOUT: %.loc17_25.1: bool = value_of_initializer %int.greater_eq // CHECK:STDOUT: %.loc17_25.2: bool = converted %int.greater_eq, %.loc17_25.1 diff --git a/toolchain/check/testdata/builtins/int/left_shift.carbon b/toolchain/check/testdata/builtins/int/left_shift.carbon index a513ac826262..2b2e70aa073d 100644 --- a/toolchain/check/testdata/builtins/int/left_shift.carbon +++ b/toolchain/check/testdata/builtins/int/left_shift.carbon @@ -66,28 +66,33 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: --- int_left_shift.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %LeftShift.type: type = fn_type @LeftShift [template] // CHECK:STDOUT: %LeftShift: %LeftShift.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 5 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 20 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 5 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] -// CHECK:STDOUT: %.31: i32 = int_value 20 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.16 [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.15 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.4(%.1) [template] // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 20 [template] -// CHECK:STDOUT: %.35: type = array_type %.34, i32 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, %i32 [template] // CHECK:STDOUT: %.36: type = ptr_type %.35 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] @@ -95,7 +100,7 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -112,98 +117,109 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %LeftShift.decl: %LeftShift.type = fn_decl @LeftShift [template = constants.%LeftShift] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_17.1: type = value_of_initializer %int.make_type_32.loc2_17 [template = i32] -// CHECK:STDOUT: %.loc2_17.2: type = converted %int.make_type_32.loc2_17, %.loc2_17.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_25.1: type = value_of_initializer %int.make_type_32.loc2_25 [template = i32] -// CHECK:STDOUT: %.loc2_25.2: type = converted %int.make_type_32.loc2_25, %.loc2_25.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_33: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_33.1: type = value_of_initializer %int.make_type_32.loc2_33 [template = i32] -// CHECK:STDOUT: %.loc2_33.2: type = converted %int.make_type_32.loc2_33, %.loc2_33.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_17: init type = call constants.%Int(%.loc2_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_17.2: type = value_of_initializer %int.make_type_signed.loc2_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_17.3: type = converted %int.make_type_signed.loc2_17, %.loc2_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_25: init type = call constants.%Int(%.loc2_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_25.2: type = value_of_initializer %int.make_type_signed.loc2_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_25.3: type = converted %int.make_type_signed.loc2_25, %.loc2_25.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_33.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_33: init type = call constants.%Int(%.loc2_33.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_33.2: type = value_of_initializer %int.make_type_signed.loc2_33 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_33.3: type = converted %int.make_type_signed.loc2_33, %.loc2_33.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %LeftShift.ref: %LeftShift.type = name_ref LeftShift, %LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %.loc4_26.1: Core.IntLiteral = int_value 5 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_29.1: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_26.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_26.3: = bound_method %.loc4_26.1, %.loc4_26.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc4_26: init i32 = call %.loc4_26.3(%.loc4_26.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc4_26.4: i32 = value_of_initializer %int.convert_checked.loc4_26 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_26.5: i32 = converted %.loc4_26.1, %.loc4_26.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_29.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_29.3: = bound_method %.loc4_29.1, %.loc4_29.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc4_29: init i32 = call %.loc4_29.3(%.loc4_29.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc4_29.4: i32 = value_of_initializer %int.convert_checked.loc4_29 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_29.5: i32 = converted %.loc4_29.1, %.loc4_29.4 [template = constants.%.30] -// CHECK:STDOUT: %int.left_shift: init i32 = call %LeftShift.ref(%.loc4_26.5, %.loc4_29.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_25.1: %Convert.type.5 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc4_25.2: = bound_method %int.left_shift, %.loc4_25.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_25.3: i32 = value_of_initializer %int.left_shift [template = constants.%.31] -// CHECK:STDOUT: %.loc4_25.4: i32 = converted %int.left_shift, %.loc4_25.3 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc4_25: init Core.IntLiteral = call %.loc4_25.2(%.loc4_25.4) [template = constants.%.34] -// CHECK:STDOUT: %.loc4_25.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_25 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_25.6: Core.IntLiteral = converted %int.left_shift, %.loc4_25.5 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_31: type = array_type %.loc4_25.6, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc4_26.1: Core.IntLiteral = int_value 5 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_29.1: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_26.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_26.3: = bound_method %.loc4_26.1, %.loc4_26.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_26.4: = specific_function %.loc4_26.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc4_26: init %i32 = call %.loc4_26.4(%.loc4_26.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc4_26.5: %i32 = value_of_initializer %int.convert_checked.loc4_26 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_26.6: %i32 = converted %.loc4_26.1, %.loc4_26.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_29.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_29.3: = bound_method %.loc4_29.1, %.loc4_29.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_29.4: = specific_function %.loc4_29.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc4_29: init %i32 = call %.loc4_29.4(%.loc4_29.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_29.5: %i32 = value_of_initializer %int.convert_checked.loc4_29 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_29.6: %i32 = converted %.loc4_29.1, %.loc4_29.5 [template = constants.%.29] +// CHECK:STDOUT: %int.left_shift: init %i32 = call %LeftShift.ref(%.loc4_26.6, %.loc4_29.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_25.1: %Convert.type.6 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_25.2: = bound_method %int.left_shift, %.loc4_25.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc4_25.3: = specific_function %.loc4_25.2, @Convert.4(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc4_25.4: %i32 = value_of_initializer %int.left_shift [template = constants.%.30] +// CHECK:STDOUT: %.loc4_25.5: %i32 = converted %int.left_shift, %.loc4_25.4 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc4_25: init Core.IntLiteral = call %.loc4_25.3(%.loc4_25.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc4_25.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_25 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_25.7: Core.IntLiteral = converted %int.left_shift, %.loc4_25.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_31: type = array_type %.loc4_25.7, %i32 [template = constants.%.35] // CHECK:STDOUT: %arr.var: ref %.35 = var arr // CHECK:STDOUT: %arr: ref %.35 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_13.1) [template = constants.%i32] // CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 20 [template = constants.%.34] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_20: type = array_type %.loc5_18, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_13.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_13.3: type = converted %int.make_type_signed.loc5, %.loc5_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_20: type = array_type %.loc5_18, %i32 [template = constants.%.35] // CHECK:STDOUT: %.loc5_21: type = ptr_type %.35 [template = constants.%.36] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.3: type = converted %int.make_type_signed.loc7_19, %.loc7_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%.loc7_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.3: type = converted %int.make_type_signed.loc7_27, %.loc7_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%.loc7_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.3: type = converted %int.make_type_signed.loc7_35, %.loc7_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @LeftShift(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.left_shift"; +// CHECK:STDOUT: fn @LeftShift(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.left_shift"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %LeftShift.ref: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %int.left_shift: init i32 = call %LeftShift.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_25.1: i32 = value_of_initializer %int.left_shift -// CHECK:STDOUT: %.loc8_25.2: i32 = converted %int.left_shift, %.loc8_25.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %int.left_shift: init %i32 = call %LeftShift.ref(%a.ref, %b.ref) +// CHECK:STDOUT: %.loc8_25.1: %i32 = value_of_initializer %int.left_shift +// CHECK:STDOUT: %.loc8_25.2: %i32 = converted %int.left_shift, %.loc8_25.1 // CHECK:STDOUT: return %.loc8_25.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -218,41 +234,48 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: --- fail_bad_shift.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %LeftShift.type: type = fn_type @LeftShift [template] // CHECK:STDOUT: %LeftShift: %LeftShift.type = struct_value () [template] // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 31 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 31 [template] -// CHECK:STDOUT: %.31: i32 = int_value -2147483648 [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 32 [template] -// CHECK:STDOUT: %.35: Core.IntLiteral = int_value 33 [template] -// CHECK:STDOUT: %.36: = bound_method %.35, %Convert.15 [template] -// CHECK:STDOUT: %.37: i32 = int_value 33 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 31 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 31 [template] +// CHECK:STDOUT: %.30: %i32 = int_value -2147483648 [template] +// CHECK:STDOUT: %.31: = bound_method %.1, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 32 [template] +// CHECK:STDOUT: %.34: Core.IntLiteral = int_value 33 [template] +// CHECK:STDOUT: %.35: = bound_method %.34, %Convert.14 [template] +// CHECK:STDOUT: %.36: = specific_function %.35, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.37: %i32 = int_value 33 [template] // CHECK:STDOUT: %.38: Core.IntLiteral = int_value 1000 [template] -// CHECK:STDOUT: %.39: = bound_method %.38, %Convert.15 [template] -// CHECK:STDOUT: %.40: i32 = int_value 1000 [template] -// CHECK:STDOUT: %.41: i32 = int_value 0 [template] -// CHECK:STDOUT: %.42: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.43: = bound_method %.42, %Convert.15 [template] -// CHECK:STDOUT: %.44: i32 = int_value -1 [template] +// CHECK:STDOUT: %.39: = bound_method %.38, %Convert.14 [template] +// CHECK:STDOUT: %.40: = specific_function %.39, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.41: %i32 = int_value 1000 [template] +// CHECK:STDOUT: %.42: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.43: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.44: = bound_method %.43, %Convert.14 [template] +// CHECK:STDOUT: %.45: = specific_function %.44, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.46: %i32 = int_value -1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -275,218 +298,247 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %LeftShift.decl: %LeftShift.type = fn_decl @LeftShift [template = constants.%LeftShift] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_17.1: type = value_of_initializer %int.make_type_32.loc4_17 [template = i32] -// CHECK:STDOUT: %.loc4_17.2: type = converted %int.make_type_32.loc4_17, %.loc4_17.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_25.1: type = value_of_initializer %int.make_type_32.loc4_25 [template = i32] -// CHECK:STDOUT: %.loc4_25.2: type = converted %int.make_type_32.loc4_25, %.loc4_25.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_33: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_33.1: type = value_of_initializer %int.make_type_32.loc4_33 [template = i32] -// CHECK:STDOUT: %.loc4_33.2: type = converted %int.make_type_32.loc4_33, %.loc4_33.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_17: init type = call constants.%Int(%.loc4_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_17.2: type = value_of_initializer %int.make_type_signed.loc4_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_17.3: type = converted %int.make_type_signed.loc4_17, %.loc4_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_25: init type = call constants.%Int(%.loc4_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_25.2: type = value_of_initializer %int.make_type_signed.loc4_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_25.3: type = converted %int.make_type_signed.loc4_25, %.loc4_25.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_33.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_33: init type = call constants.%Int(%.loc4_33.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_33.2: type = value_of_initializer %int.make_type_signed.loc4_33 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_33.3: type = converted %int.make_type_signed.loc4_33, %.loc4_33.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc5_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_14.1: type = value_of_initializer %int.make_type_32.loc5_14 [template = i32] -// CHECK:STDOUT: %.loc5_14.2: type = converted %int.make_type_32.loc5_14, %.loc5_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int.make_type_32.loc5_22 [template = i32] -// CHECK:STDOUT: %.loc5_22.2: type = converted %int.make_type_32.loc5_22, %.loc5_22.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc5_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_14: init type = call constants.%Int(%.loc5_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_14.2: type = value_of_initializer %int.make_type_signed.loc5_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_14.3: type = converted %int.make_type_signed.loc5_14, %.loc5_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_22: init type = call constants.%Int(%.loc5_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_22.2: type = value_of_initializer %int.make_type_signed.loc5_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_22.3: type = converted %int.make_type_signed.loc5_22, %.loc5_22.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] -// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_32.loc8, %.loc8_13.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32.loc13, %.loc13_13.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_13.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] -// CHECK:STDOUT: %.loc18_13.2: type = converted %int.make_type_32.loc18, %.loc18_13.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_17.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] -// CHECK:STDOUT: %.loc21_17.2: type = converted %int.make_type_32.loc21, %.loc21_17.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc26: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc26_17.1: type = value_of_initializer %int.make_type_32.loc26 [template = i32] -// CHECK:STDOUT: %.loc26_17.2: type = converted %int.make_type_32.loc26, %.loc26_17.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc29_20.1: type = value_of_initializer %int.make_type_32.loc29 [template = i32] -// CHECK:STDOUT: %.loc29_20.2: type = converted %int.make_type_32.loc29, %.loc29_20.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc34_20.1: type = value_of_initializer %int.make_type_32.loc34 [template = i32] -// CHECK:STDOUT: %.loc34_20.2: type = converted %int.make_type_32.loc34, %.loc34_20.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc40: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc40_15.1: type = value_of_initializer %int.make_type_32.loc40 [template = i32] -// CHECK:STDOUT: %.loc40_15.2: type = converted %int.make_type_32.loc40, %.loc40_15.1 [template = i32] +// CHECK:STDOUT: %.loc8_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_13.2: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_13.3: type = converted %int.make_type_signed.loc8, %.loc8_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_13.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_13.3: type = converted %int.make_type_signed.loc13, %.loc13_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%.loc18_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_13.2: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_13.3: type = converted %int.make_type_signed.loc18, %.loc18_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%.loc21_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_17.2: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_17.3: type = converted %int.make_type_signed.loc21, %.loc21_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc26_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc26: init type = call constants.%Int(%.loc26_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc26_17.2: type = value_of_initializer %int.make_type_signed.loc26 [template = constants.%i32] +// CHECK:STDOUT: %.loc26_17.3: type = converted %int.make_type_signed.loc26, %.loc26_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc29_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc29: init type = call constants.%Int(%.loc29_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc29_20.2: type = value_of_initializer %int.make_type_signed.loc29 [template = constants.%i32] +// CHECK:STDOUT: %.loc29_20.3: type = converted %int.make_type_signed.loc29, %.loc29_20.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc34_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc34: init type = call constants.%Int(%.loc34_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc34_20.2: type = value_of_initializer %int.make_type_signed.loc34 [template = constants.%i32] +// CHECK:STDOUT: %.loc34_20.3: type = converted %int.make_type_signed.loc34, %.loc34_20.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc40_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc40: init type = call constants.%Int(%.loc40_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc40_15.2: type = value_of_initializer %int.make_type_signed.loc40 [template = constants.%i32] +// CHECK:STDOUT: %.loc40_15.3: type = converted %int.make_type_signed.loc40, %.loc40_15.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @LeftShift(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.left_shift"; +// CHECK:STDOUT: fn @LeftShift(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.left_shift"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %LeftShift.ref.loc8: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %.loc8_29.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc8_32.1: Core.IntLiteral = int_value 31 [template = constants.%.2] -// CHECK:STDOUT: %.loc8_29.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_29.3: = bound_method %.loc8_29.1, %.loc8_29.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc8_29: init i32 = call %.loc8_29.3(%.loc8_29.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc8_29.4: i32 = value_of_initializer %int.convert_checked.loc8_29 [template = constants.%.28] -// CHECK:STDOUT: %.loc8_29.5: i32 = converted %.loc8_29.1, %.loc8_29.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc8_32.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_32.3: = bound_method %.loc8_32.1, %.loc8_32.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc8_32: init i32 = call %.loc8_32.3(%.loc8_32.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc8_32.4: i32 = value_of_initializer %int.convert_checked.loc8_32 [template = constants.%.30] -// CHECK:STDOUT: %.loc8_32.5: i32 = converted %.loc8_32.1, %.loc8_32.4 [template = constants.%.30] -// CHECK:STDOUT: %int.left_shift.loc8: init i32 = call %LeftShift.ref.loc8(%.loc8_29.5, %.loc8_32.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc8_35.1: i32 = value_of_initializer %int.left_shift.loc8 [template = constants.%.31] -// CHECK:STDOUT: %.loc8_35.2: i32 = converted %int.left_shift.loc8, %.loc8_35.1 [template = constants.%.31] -// CHECK:STDOUT: %size_1: i32 = bind_name size_1, %.loc8_35.2 +// CHECK:STDOUT: %.loc8_29.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc8_32.1: Core.IntLiteral = int_value 31 [template = constants.%.3] +// CHECK:STDOUT: %.loc8_29.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_29.3: = bound_method %.loc8_29.1, %.loc8_29.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc8_29.4: = specific_function %.loc8_29.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc8_29: init %i32 = call %.loc8_29.4(%.loc8_29.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc8_29.5: %i32 = value_of_initializer %int.convert_checked.loc8_29 [template = constants.%.26] +// CHECK:STDOUT: %.loc8_29.6: %i32 = converted %.loc8_29.1, %.loc8_29.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc8_32.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_32.3: = bound_method %.loc8_32.1, %.loc8_32.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc8_32.4: = specific_function %.loc8_32.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc8_32: init %i32 = call %.loc8_32.4(%.loc8_32.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc8_32.5: %i32 = value_of_initializer %int.convert_checked.loc8_32 [template = constants.%.29] +// CHECK:STDOUT: %.loc8_32.6: %i32 = converted %.loc8_32.1, %.loc8_32.5 [template = constants.%.29] +// CHECK:STDOUT: %int.left_shift.loc8: init %i32 = call %LeftShift.ref.loc8(%.loc8_29.6, %.loc8_32.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc8_35.1: %i32 = value_of_initializer %int.left_shift.loc8 [template = constants.%.30] +// CHECK:STDOUT: %.loc8_35.2: %i32 = converted %int.left_shift.loc8, %.loc8_35.1 [template = constants.%.30] +// CHECK:STDOUT: %size_1: %i32 = bind_name size_1, %.loc8_35.2 // CHECK:STDOUT: %LeftShift.ref.loc13: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %.loc13_29.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc13_32.1: Core.IntLiteral = int_value 32 [template = constants.%.32] -// CHECK:STDOUT: %.loc13_29.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_29.3: = bound_method %.loc13_29.1, %.loc13_29.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc13_29: init i32 = call %.loc13_29.3(%.loc13_29.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc13_29.4: i32 = value_of_initializer %int.convert_checked.loc13_29 [template = constants.%.28] -// CHECK:STDOUT: %.loc13_29.5: i32 = converted %.loc13_29.1, %.loc13_29.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc13_32.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_32.3: = bound_method %.loc13_32.1, %.loc13_32.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc13_32: init i32 = call %.loc13_32.3(%.loc13_32.1) [template = constants.%.34] -// CHECK:STDOUT: %.loc13_32.4: i32 = value_of_initializer %int.convert_checked.loc13_32 [template = constants.%.34] -// CHECK:STDOUT: %.loc13_32.5: i32 = converted %.loc13_32.1, %.loc13_32.4 [template = constants.%.34] -// CHECK:STDOUT: %int.left_shift.loc13: init i32 = call %LeftShift.ref.loc13(%.loc13_29.5, %.loc13_32.5) [template = ] -// CHECK:STDOUT: %.loc13_35.1: i32 = value_of_initializer %int.left_shift.loc13 [template = ] -// CHECK:STDOUT: %.loc13_35.2: i32 = converted %int.left_shift.loc13, %.loc13_35.1 [template = ] -// CHECK:STDOUT: %size_2: i32 = bind_name size_2, %.loc13_35.2 +// CHECK:STDOUT: %.loc13_29.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc13_32.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %.loc13_29.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_29.3: = bound_method %.loc13_29.1, %.loc13_29.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc13_29.4: = specific_function %.loc13_29.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc13_29: init %i32 = call %.loc13_29.4(%.loc13_29.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc13_29.5: %i32 = value_of_initializer %int.convert_checked.loc13_29 [template = constants.%.26] +// CHECK:STDOUT: %.loc13_29.6: %i32 = converted %.loc13_29.1, %.loc13_29.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc13_32.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_32.3: = bound_method %.loc13_32.1, %.loc13_32.2 [template = constants.%.31] +// CHECK:STDOUT: %.loc13_32.4: = specific_function %.loc13_32.3, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc13_32: init %i32 = call %.loc13_32.4(%.loc13_32.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc13_32.5: %i32 = value_of_initializer %int.convert_checked.loc13_32 [template = constants.%.33] +// CHECK:STDOUT: %.loc13_32.6: %i32 = converted %.loc13_32.1, %.loc13_32.5 [template = constants.%.33] +// CHECK:STDOUT: %int.left_shift.loc13: init %i32 = call %LeftShift.ref.loc13(%.loc13_29.6, %.loc13_32.6) [template = ] +// CHECK:STDOUT: %.loc13_35.1: %i32 = value_of_initializer %int.left_shift.loc13 [template = ] +// CHECK:STDOUT: %.loc13_35.2: %i32 = converted %int.left_shift.loc13, %.loc13_35.1 [template = ] +// CHECK:STDOUT: %size_2: %i32 = bind_name size_2, %.loc13_35.2 // CHECK:STDOUT: %LeftShift.ref.loc18: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %.loc18_29.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc18_32.1: Core.IntLiteral = int_value 33 [template = constants.%.35] -// CHECK:STDOUT: %.loc18_29.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_29.3: = bound_method %.loc18_29.1, %.loc18_29.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc18_29: init i32 = call %.loc18_29.3(%.loc18_29.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc18_29.4: i32 = value_of_initializer %int.convert_checked.loc18_29 [template = constants.%.28] -// CHECK:STDOUT: %.loc18_29.5: i32 = converted %.loc18_29.1, %.loc18_29.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc18_32.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_32.3: = bound_method %.loc18_32.1, %.loc18_32.2 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc18_32: init i32 = call %.loc18_32.3(%.loc18_32.1) [template = constants.%.37] -// CHECK:STDOUT: %.loc18_32.4: i32 = value_of_initializer %int.convert_checked.loc18_32 [template = constants.%.37] -// CHECK:STDOUT: %.loc18_32.5: i32 = converted %.loc18_32.1, %.loc18_32.4 [template = constants.%.37] -// CHECK:STDOUT: %int.left_shift.loc18: init i32 = call %LeftShift.ref.loc18(%.loc18_29.5, %.loc18_32.5) [template = ] -// CHECK:STDOUT: %.loc18_35.1: i32 = value_of_initializer %int.left_shift.loc18 [template = ] -// CHECK:STDOUT: %.loc18_35.2: i32 = converted %int.left_shift.loc18, %.loc18_35.1 [template = ] -// CHECK:STDOUT: %size_3: i32 = bind_name size_3, %.loc18_35.2 +// CHECK:STDOUT: %.loc18_29.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc18_32.1: Core.IntLiteral = int_value 33 [template = constants.%.34] +// CHECK:STDOUT: %.loc18_29.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_29.3: = bound_method %.loc18_29.1, %.loc18_29.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc18_29.4: = specific_function %.loc18_29.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc18_29: init %i32 = call %.loc18_29.4(%.loc18_29.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc18_29.5: %i32 = value_of_initializer %int.convert_checked.loc18_29 [template = constants.%.26] +// CHECK:STDOUT: %.loc18_29.6: %i32 = converted %.loc18_29.1, %.loc18_29.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc18_32.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_32.3: = bound_method %.loc18_32.1, %.loc18_32.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc18_32.4: = specific_function %.loc18_32.3, @Convert.2(constants.%.1) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc18_32: init %i32 = call %.loc18_32.4(%.loc18_32.1) [template = constants.%.37] +// CHECK:STDOUT: %.loc18_32.5: %i32 = value_of_initializer %int.convert_checked.loc18_32 [template = constants.%.37] +// CHECK:STDOUT: %.loc18_32.6: %i32 = converted %.loc18_32.1, %.loc18_32.5 [template = constants.%.37] +// CHECK:STDOUT: %int.left_shift.loc18: init %i32 = call %LeftShift.ref.loc18(%.loc18_29.6, %.loc18_32.6) [template = ] +// CHECK:STDOUT: %.loc18_35.1: %i32 = value_of_initializer %int.left_shift.loc18 [template = ] +// CHECK:STDOUT: %.loc18_35.2: %i32 = converted %int.left_shift.loc18, %.loc18_35.1 [template = ] +// CHECK:STDOUT: %size_3: %i32 = bind_name size_3, %.loc18_35.2 // CHECK:STDOUT: %LeftShift.ref.loc21: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %.loc21_33.1: Core.IntLiteral = int_value 1000 [template = constants.%.38] -// CHECK:STDOUT: %.loc21_39.1: Core.IntLiteral = int_value 31 [template = constants.%.2] -// CHECK:STDOUT: %.loc21_33.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc21_39.1: Core.IntLiteral = int_value 31 [template = constants.%.3] +// CHECK:STDOUT: %.loc21_33.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] // CHECK:STDOUT: %.loc21_33.3: = bound_method %.loc21_33.1, %.loc21_33.2 [template = constants.%.39] -// CHECK:STDOUT: %int.convert_checked.loc21_33: init i32 = call %.loc21_33.3(%.loc21_33.1) [template = constants.%.40] -// CHECK:STDOUT: %.loc21_33.4: i32 = value_of_initializer %int.convert_checked.loc21_33 [template = constants.%.40] -// CHECK:STDOUT: %.loc21_33.5: i32 = converted %.loc21_33.1, %.loc21_33.4 [template = constants.%.40] -// CHECK:STDOUT: %.loc21_39.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc21_39.3: = bound_method %.loc21_39.1, %.loc21_39.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc21_39: init i32 = call %.loc21_39.3(%.loc21_39.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc21_39.4: i32 = value_of_initializer %int.convert_checked.loc21_39 [template = constants.%.30] -// CHECK:STDOUT: %.loc21_39.5: i32 = converted %.loc21_39.1, %.loc21_39.4 [template = constants.%.30] -// CHECK:STDOUT: %int.left_shift.loc21: init i32 = call %LeftShift.ref.loc21(%.loc21_33.5, %.loc21_39.5) [template = constants.%.41] -// CHECK:STDOUT: %.loc21_42.1: i32 = value_of_initializer %int.left_shift.loc21 [template = constants.%.41] -// CHECK:STDOUT: %.loc21_42.2: i32 = converted %int.left_shift.loc21, %.loc21_42.1 [template = constants.%.41] -// CHECK:STDOUT: %overflow_1: i32 = bind_name overflow_1, %.loc21_42.2 +// CHECK:STDOUT: %.loc21_33.4: = specific_function %.loc21_33.3, @Convert.2(constants.%.1) [template = constants.%.40] +// CHECK:STDOUT: %int.convert_checked.loc21_33: init %i32 = call %.loc21_33.4(%.loc21_33.1) [template = constants.%.41] +// CHECK:STDOUT: %.loc21_33.5: %i32 = value_of_initializer %int.convert_checked.loc21_33 [template = constants.%.41] +// CHECK:STDOUT: %.loc21_33.6: %i32 = converted %.loc21_33.1, %.loc21_33.5 [template = constants.%.41] +// CHECK:STDOUT: %.loc21_39.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc21_39.3: = bound_method %.loc21_39.1, %.loc21_39.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc21_39.4: = specific_function %.loc21_39.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc21_39: init %i32 = call %.loc21_39.4(%.loc21_39.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc21_39.5: %i32 = value_of_initializer %int.convert_checked.loc21_39 [template = constants.%.29] +// CHECK:STDOUT: %.loc21_39.6: %i32 = converted %.loc21_39.1, %.loc21_39.5 [template = constants.%.29] +// CHECK:STDOUT: %int.left_shift.loc21: init %i32 = call %LeftShift.ref.loc21(%.loc21_33.6, %.loc21_39.6) [template = constants.%.42] +// CHECK:STDOUT: %.loc21_42.1: %i32 = value_of_initializer %int.left_shift.loc21 [template = constants.%.42] +// CHECK:STDOUT: %.loc21_42.2: %i32 = converted %int.left_shift.loc21, %.loc21_42.1 [template = constants.%.42] +// CHECK:STDOUT: %overflow_1: %i32 = bind_name overflow_1, %.loc21_42.2 // CHECK:STDOUT: %LeftShift.ref.loc26: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %.loc26_33.1: Core.IntLiteral = int_value 1000 [template = constants.%.38] -// CHECK:STDOUT: %.loc26_39.1: Core.IntLiteral = int_value 32 [template = constants.%.32] -// CHECK:STDOUT: %.loc26_33.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc26_39.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %.loc26_33.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] // CHECK:STDOUT: %.loc26_33.3: = bound_method %.loc26_33.1, %.loc26_33.2 [template = constants.%.39] -// CHECK:STDOUT: %int.convert_checked.loc26_33: init i32 = call %.loc26_33.3(%.loc26_33.1) [template = constants.%.40] -// CHECK:STDOUT: %.loc26_33.4: i32 = value_of_initializer %int.convert_checked.loc26_33 [template = constants.%.40] -// CHECK:STDOUT: %.loc26_33.5: i32 = converted %.loc26_33.1, %.loc26_33.4 [template = constants.%.40] -// CHECK:STDOUT: %.loc26_39.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc26_39.3: = bound_method %.loc26_39.1, %.loc26_39.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc26_39: init i32 = call %.loc26_39.3(%.loc26_39.1) [template = constants.%.34] -// CHECK:STDOUT: %.loc26_39.4: i32 = value_of_initializer %int.convert_checked.loc26_39 [template = constants.%.34] -// CHECK:STDOUT: %.loc26_39.5: i32 = converted %.loc26_39.1, %.loc26_39.4 [template = constants.%.34] -// CHECK:STDOUT: %int.left_shift.loc26: init i32 = call %LeftShift.ref.loc26(%.loc26_33.5, %.loc26_39.5) [template = ] -// CHECK:STDOUT: %.loc26_42.1: i32 = value_of_initializer %int.left_shift.loc26 [template = ] -// CHECK:STDOUT: %.loc26_42.2: i32 = converted %int.left_shift.loc26, %.loc26_42.1 [template = ] -// CHECK:STDOUT: %overflow_2: i32 = bind_name overflow_2, %.loc26_42.2 +// CHECK:STDOUT: %.loc26_33.4: = specific_function %.loc26_33.3, @Convert.2(constants.%.1) [template = constants.%.40] +// CHECK:STDOUT: %int.convert_checked.loc26_33: init %i32 = call %.loc26_33.4(%.loc26_33.1) [template = constants.%.41] +// CHECK:STDOUT: %.loc26_33.5: %i32 = value_of_initializer %int.convert_checked.loc26_33 [template = constants.%.41] +// CHECK:STDOUT: %.loc26_33.6: %i32 = converted %.loc26_33.1, %.loc26_33.5 [template = constants.%.41] +// CHECK:STDOUT: %.loc26_39.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc26_39.3: = bound_method %.loc26_39.1, %.loc26_39.2 [template = constants.%.31] +// CHECK:STDOUT: %.loc26_39.4: = specific_function %.loc26_39.3, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc26_39: init %i32 = call %.loc26_39.4(%.loc26_39.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc26_39.5: %i32 = value_of_initializer %int.convert_checked.loc26_39 [template = constants.%.33] +// CHECK:STDOUT: %.loc26_39.6: %i32 = converted %.loc26_39.1, %.loc26_39.5 [template = constants.%.33] +// CHECK:STDOUT: %int.left_shift.loc26: init %i32 = call %LeftShift.ref.loc26(%.loc26_33.6, %.loc26_39.6) [template = ] +// CHECK:STDOUT: %.loc26_42.1: %i32 = value_of_initializer %int.left_shift.loc26 [template = ] +// CHECK:STDOUT: %.loc26_42.2: %i32 = converted %int.left_shift.loc26, %.loc26_42.1 [template = ] +// CHECK:STDOUT: %overflow_2: %i32 = bind_name overflow_2, %.loc26_42.2 // CHECK:STDOUT: %LeftShift.ref.loc29: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %.loc29_36.1: Core.IntLiteral = int_value 0 [template = constants.%.42] -// CHECK:STDOUT: %.loc29_39.1: Core.IntLiteral = int_value 31 [template = constants.%.2] -// CHECK:STDOUT: %.loc29_36.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc29_36.3: = bound_method %.loc29_36.1, %.loc29_36.2 [template = constants.%.43] -// CHECK:STDOUT: %int.convert_checked.loc29_36: init i32 = call %.loc29_36.3(%.loc29_36.1) [template = constants.%.41] -// CHECK:STDOUT: %.loc29_36.4: i32 = value_of_initializer %int.convert_checked.loc29_36 [template = constants.%.41] -// CHECK:STDOUT: %.loc29_36.5: i32 = converted %.loc29_36.1, %.loc29_36.4 [template = constants.%.41] -// CHECK:STDOUT: %.loc29_39.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc29_39.3: = bound_method %.loc29_39.1, %.loc29_39.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc29_39: init i32 = call %.loc29_39.3(%.loc29_39.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc29_39.4: i32 = value_of_initializer %int.convert_checked.loc29_39 [template = constants.%.30] -// CHECK:STDOUT: %.loc29_39.5: i32 = converted %.loc29_39.1, %.loc29_39.4 [template = constants.%.30] -// CHECK:STDOUT: %int.left_shift.loc29: init i32 = call %LeftShift.ref.loc29(%.loc29_36.5, %.loc29_39.5) [template = constants.%.41] -// CHECK:STDOUT: %.loc29_42.1: i32 = value_of_initializer %int.left_shift.loc29 [template = constants.%.41] -// CHECK:STDOUT: %.loc29_42.2: i32 = converted %int.left_shift.loc29, %.loc29_42.1 [template = constants.%.41] -// CHECK:STDOUT: %no_overflow_1: i32 = bind_name no_overflow_1, %.loc29_42.2 +// CHECK:STDOUT: %.loc29_36.1: Core.IntLiteral = int_value 0 [template = constants.%.43] +// CHECK:STDOUT: %.loc29_39.1: Core.IntLiteral = int_value 31 [template = constants.%.3] +// CHECK:STDOUT: %.loc29_36.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc29_36.3: = bound_method %.loc29_36.1, %.loc29_36.2 [template = constants.%.44] +// CHECK:STDOUT: %.loc29_36.4: = specific_function %.loc29_36.3, @Convert.2(constants.%.1) [template = constants.%.45] +// CHECK:STDOUT: %int.convert_checked.loc29_36: init %i32 = call %.loc29_36.4(%.loc29_36.1) [template = constants.%.42] +// CHECK:STDOUT: %.loc29_36.5: %i32 = value_of_initializer %int.convert_checked.loc29_36 [template = constants.%.42] +// CHECK:STDOUT: %.loc29_36.6: %i32 = converted %.loc29_36.1, %.loc29_36.5 [template = constants.%.42] +// CHECK:STDOUT: %.loc29_39.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc29_39.3: = bound_method %.loc29_39.1, %.loc29_39.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc29_39.4: = specific_function %.loc29_39.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc29_39: init %i32 = call %.loc29_39.4(%.loc29_39.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc29_39.5: %i32 = value_of_initializer %int.convert_checked.loc29_39 [template = constants.%.29] +// CHECK:STDOUT: %.loc29_39.6: %i32 = converted %.loc29_39.1, %.loc29_39.5 [template = constants.%.29] +// CHECK:STDOUT: %int.left_shift.loc29: init %i32 = call %LeftShift.ref.loc29(%.loc29_36.6, %.loc29_39.6) [template = constants.%.42] +// CHECK:STDOUT: %.loc29_42.1: %i32 = value_of_initializer %int.left_shift.loc29 [template = constants.%.42] +// CHECK:STDOUT: %.loc29_42.2: %i32 = converted %int.left_shift.loc29, %.loc29_42.1 [template = constants.%.42] +// CHECK:STDOUT: %no_overflow_1: %i32 = bind_name no_overflow_1, %.loc29_42.2 // CHECK:STDOUT: %LeftShift.ref.loc34: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %.loc34_36.1: Core.IntLiteral = int_value 0 [template = constants.%.42] -// CHECK:STDOUT: %.loc34_39.1: Core.IntLiteral = int_value 32 [template = constants.%.32] -// CHECK:STDOUT: %.loc34_36.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc34_36.3: = bound_method %.loc34_36.1, %.loc34_36.2 [template = constants.%.43] -// CHECK:STDOUT: %int.convert_checked.loc34_36: init i32 = call %.loc34_36.3(%.loc34_36.1) [template = constants.%.41] -// CHECK:STDOUT: %.loc34_36.4: i32 = value_of_initializer %int.convert_checked.loc34_36 [template = constants.%.41] -// CHECK:STDOUT: %.loc34_36.5: i32 = converted %.loc34_36.1, %.loc34_36.4 [template = constants.%.41] -// CHECK:STDOUT: %.loc34_39.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc34_39.3: = bound_method %.loc34_39.1, %.loc34_39.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc34_39: init i32 = call %.loc34_39.3(%.loc34_39.1) [template = constants.%.34] -// CHECK:STDOUT: %.loc34_39.4: i32 = value_of_initializer %int.convert_checked.loc34_39 [template = constants.%.34] -// CHECK:STDOUT: %.loc34_39.5: i32 = converted %.loc34_39.1, %.loc34_39.4 [template = constants.%.34] -// CHECK:STDOUT: %int.left_shift.loc34: init i32 = call %LeftShift.ref.loc34(%.loc34_36.5, %.loc34_39.5) [template = ] -// CHECK:STDOUT: %.loc34_42.1: i32 = value_of_initializer %int.left_shift.loc34 [template = ] -// CHECK:STDOUT: %.loc34_42.2: i32 = converted %int.left_shift.loc34, %.loc34_42.1 [template = ] -// CHECK:STDOUT: %no_overflow_2: i32 = bind_name no_overflow_2, %.loc34_42.2 +// CHECK:STDOUT: %.loc34_36.1: Core.IntLiteral = int_value 0 [template = constants.%.43] +// CHECK:STDOUT: %.loc34_39.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %.loc34_36.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc34_36.3: = bound_method %.loc34_36.1, %.loc34_36.2 [template = constants.%.44] +// CHECK:STDOUT: %.loc34_36.4: = specific_function %.loc34_36.3, @Convert.2(constants.%.1) [template = constants.%.45] +// CHECK:STDOUT: %int.convert_checked.loc34_36: init %i32 = call %.loc34_36.4(%.loc34_36.1) [template = constants.%.42] +// CHECK:STDOUT: %.loc34_36.5: %i32 = value_of_initializer %int.convert_checked.loc34_36 [template = constants.%.42] +// CHECK:STDOUT: %.loc34_36.6: %i32 = converted %.loc34_36.1, %.loc34_36.5 [template = constants.%.42] +// CHECK:STDOUT: %.loc34_39.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc34_39.3: = bound_method %.loc34_39.1, %.loc34_39.2 [template = constants.%.31] +// CHECK:STDOUT: %.loc34_39.4: = specific_function %.loc34_39.3, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc34_39: init %i32 = call %.loc34_39.4(%.loc34_39.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc34_39.5: %i32 = value_of_initializer %int.convert_checked.loc34_39 [template = constants.%.33] +// CHECK:STDOUT: %.loc34_39.6: %i32 = converted %.loc34_39.1, %.loc34_39.5 [template = constants.%.33] +// CHECK:STDOUT: %int.left_shift.loc34: init %i32 = call %LeftShift.ref.loc34(%.loc34_36.6, %.loc34_39.6) [template = ] +// CHECK:STDOUT: %.loc34_42.1: %i32 = value_of_initializer %int.left_shift.loc34 [template = ] +// CHECK:STDOUT: %.loc34_42.2: %i32 = converted %int.left_shift.loc34, %.loc34_42.1 [template = ] +// CHECK:STDOUT: %no_overflow_2: %i32 = bind_name no_overflow_2, %.loc34_42.2 // CHECK:STDOUT: %LeftShift.ref.loc40: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %.loc40_31.1: Core.IntLiteral = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc40_31.1: Core.IntLiteral = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc40_41.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc40_41.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc40_41.3: = bound_method %.loc40_41.1, %.loc40_41.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc40_41: init i32 = call %.loc40_41.3(%.loc40_41.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc40_41.4: i32 = value_of_initializer %int.convert_checked.loc40_41 [template = constants.%.28] -// CHECK:STDOUT: %.loc40_41.5: i32 = converted %.loc40_41.1, %.loc40_41.4 [template = constants.%.28] -// CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc40_41.5) [template = constants.%.44] -// CHECK:STDOUT: %.loc40_31.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc40_31.3: = bound_method %.loc40_31.1, %.loc40_31.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc40_31: init i32 = call %.loc40_31.3(%.loc40_31.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc40_31.4: i32 = value_of_initializer %int.convert_checked.loc40_31 [template = constants.%.28] -// CHECK:STDOUT: %.loc40_31.5: i32 = converted %.loc40_31.1, %.loc40_31.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc40_40.1: i32 = value_of_initializer %int.snegate [template = constants.%.44] -// CHECK:STDOUT: %.loc40_40.2: i32 = converted %int.snegate, %.loc40_40.1 [template = constants.%.44] -// CHECK:STDOUT: %int.left_shift.loc40: init i32 = call %LeftShift.ref.loc40(%.loc40_31.5, %.loc40_40.2) [template = ] -// CHECK:STDOUT: %.loc40_44.1: i32 = value_of_initializer %int.left_shift.loc40 [template = ] -// CHECK:STDOUT: %.loc40_44.2: i32 = converted %int.left_shift.loc40, %.loc40_44.1 [template = ] -// CHECK:STDOUT: %negative: i32 = bind_name negative, %.loc40_44.2 +// CHECK:STDOUT: %.loc40_41.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc40_41.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc40_41.3: = bound_method %.loc40_41.1, %.loc40_41.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc40_41.4: = specific_function %.loc40_41.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc40_41: init %i32 = call %.loc40_41.4(%.loc40_41.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc40_41.5: %i32 = value_of_initializer %int.convert_checked.loc40_41 [template = constants.%.26] +// CHECK:STDOUT: %.loc40_41.6: %i32 = converted %.loc40_41.1, %.loc40_41.5 [template = constants.%.26] +// CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc40_41.6) [template = constants.%.46] +// CHECK:STDOUT: %.loc40_31.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc40_31.3: = bound_method %.loc40_31.1, %.loc40_31.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc40_31.4: = specific_function %.loc40_31.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc40_31: init %i32 = call %.loc40_31.4(%.loc40_31.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc40_31.5: %i32 = value_of_initializer %int.convert_checked.loc40_31 [template = constants.%.26] +// CHECK:STDOUT: %.loc40_31.6: %i32 = converted %.loc40_31.1, %.loc40_31.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc40_40.1: %i32 = value_of_initializer %int.snegate [template = constants.%.46] +// CHECK:STDOUT: %.loc40_40.2: %i32 = converted %int.snegate, %.loc40_40.1 [template = constants.%.46] +// CHECK:STDOUT: %int.left_shift.loc40: init %i32 = call %LeftShift.ref.loc40(%.loc40_31.6, %.loc40_40.2) [template = ] +// CHECK:STDOUT: %.loc40_44.1: %i32 = value_of_initializer %int.left_shift.loc40 [template = ] +// CHECK:STDOUT: %.loc40_44.2: %i32 = converted %int.left_shift.loc40, %.loc40_44.1 [template = ] +// CHECK:STDOUT: %negative: %i32 = bind_name negative, %.loc40_44.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/less.carbon b/toolchain/check/testdata/builtins/int/less.carbon index 636f1ee2c798..76a38c962864 100644 --- a/toolchain/check/testdata/builtins/int/less.carbon +++ b/toolchain/check/testdata/builtins/int/less.carbon @@ -31,8 +31,10 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: --- int_less.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %Less.type: type = fn_type @Less [template] @@ -40,34 +42,37 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 2 [template] -// CHECK:STDOUT: %.34: bool = bool_literal true [template] -// CHECK:STDOUT: %.35: bool = bool_literal false [template] -// CHECK:STDOUT: %.36: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.37: = bound_method %.36, %Convert.15 [template] -// CHECK:STDOUT: %.38: i32 = int_value 0 [template] -// CHECK:STDOUT: %.39: i32 = int_value -1 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.30: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.33: bool = bool_literal true [template] +// CHECK:STDOUT: %.34: bool = bool_literal false [template] +// CHECK:STDOUT: %.35: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.36: = bound_method %.35, %Convert.14 [template] +// CHECK:STDOUT: %.37: = specific_function %.36, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.38: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.39: %i32 = int_value -1 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude @@ -87,45 +92,49 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Less.decl: %Less.type = fn_decl @Less [template = constants.%Less] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_12.1: type = value_of_initializer %int.make_type_32.loc2_12 [template = i32] -// CHECK:STDOUT: %.loc2_12.2: type = converted %int.make_type_32.loc2_12, %.loc2_12.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_20.1: type = value_of_initializer %int.make_type_32.loc2_20 [template = i32] -// CHECK:STDOUT: %.loc2_20.2: type = converted %int.make_type_32.loc2_20, %.loc2_20.1 [template = i32] +// CHECK:STDOUT: %.loc2_12.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_12: init type = call constants.%Int(%.loc2_12.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_12.2: type = value_of_initializer %int.make_type_signed.loc2_12 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_12.3: type = converted %int.make_type_signed.loc2_12, %.loc2_12.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_20: init type = call constants.%Int(%.loc2_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_20.2: type = value_of_initializer %int.make_type_signed.loc2_20 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_20.3: type = converted %int.make_type_signed.loc2_20, %.loc2_20.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_28.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_28.2: type = converted %bool.make_type, %.loc2_28.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc3_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_32.loc3_14 [template = i32] -// CHECK:STDOUT: %.loc3_14.2: type = converted %int.make_type_32.loc3_14, %.loc3_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc3_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc3_22.1: type = value_of_initializer %int.make_type_32.loc3_22 [template = i32] -// CHECK:STDOUT: %.loc3_22.2: type = converted %int.make_type_32.loc3_22, %.loc3_22.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc3_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc3_14: init type = call constants.%Int(%.loc3_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc3_14.2: type = value_of_initializer %int.make_type_signed.loc3_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_14.3: type = converted %int.make_type_signed.loc3_14, %.loc3_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc3_22: init type = call constants.%Int(%.loc3_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc3_22.2: type = value_of_initializer %int.make_type_signed.loc3_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_22.3: type = converted %int.make_type_signed.loc3_22, %.loc3_22.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} // CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} @@ -143,68 +152,72 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc16_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32.loc16_19 [template = i32] -// CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_32.loc16_19, %.loc16_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc16_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %int.make_type_32.loc16_27 [template = i32] -// CHECK:STDOUT: %.loc16_27.2: type = converted %int.make_type_32.loc16_27, %.loc16_27.1 [template = i32] +// CHECK:STDOUT: %.loc16_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16_19: init type = call constants.%Int(%.loc16_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_19.2: type = value_of_initializer %int.make_type_signed.loc16_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_19.3: type = converted %int.make_type_signed.loc16_19, %.loc16_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16_27: init type = call constants.%Int(%.loc16_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_27.2: type = value_of_initializer %int.make_type_signed.loc16_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_27.3: type = converted %int.make_type_signed.loc16_27, %.loc16_27.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %.loc5: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc5: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %.loc6: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Less(%a.param_patt: i32, %b.param_patt: i32) -> bool = "int.less"; +// CHECK:STDOUT: fn @Less(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.less"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref.loc9: %True = name_ref true_, %true_ // CHECK:STDOUT: %Less.ref.loc9: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] -// CHECK:STDOUT: %.loc9_21.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc9_24.1: Core.IntLiteral = int_value 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_21.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_21.3: = bound_method %.loc9_21.1, %.loc9_21.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc9_21: init i32 = call %.loc9_21.3(%.loc9_21.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc9_21.4: i32 = value_of_initializer %int.convert_checked.loc9_21 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_21.5: i32 = converted %.loc9_21.1, %.loc9_21.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_24.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_24.3: = bound_method %.loc9_24.1, %.loc9_24.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc9_24: init i32 = call %.loc9_24.3(%.loc9_24.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc9_24.4: i32 = value_of_initializer %int.convert_checked.loc9_24 [template = constants.%.33] -// CHECK:STDOUT: %.loc9_24.5: i32 = converted %.loc9_24.1, %.loc9_24.4 [template = constants.%.33] -// CHECK:STDOUT: %int.less.loc9: init bool = call %Less.ref.loc9(%.loc9_21.5, %.loc9_24.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %int.less.loc9 [template = constants.%.34] -// CHECK:STDOUT: %.loc9_13.2: bool = converted %int.less.loc9, %.loc9_13.1 [template = constants.%.34] +// CHECK:STDOUT: %.loc9_21.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_24.1: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_21.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_21.3: = bound_method %.loc9_21.1, %.loc9_21.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_21.4: = specific_function %.loc9_21.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc9_21: init %i32 = call %.loc9_21.4(%.loc9_21.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc9_21.5: %i32 = value_of_initializer %int.convert_checked.loc9_21 [template = constants.%.29] +// CHECK:STDOUT: %.loc9_21.6: %i32 = converted %.loc9_21.1, %.loc9_21.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc9_24.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_24.3: = bound_method %.loc9_24.1, %.loc9_24.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc9_24.4: = specific_function %.loc9_24.3, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc9_24: init %i32 = call %.loc9_24.4(%.loc9_24.1) [template = constants.%.32] +// CHECK:STDOUT: %.loc9_24.5: %i32 = value_of_initializer %int.convert_checked.loc9_24 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_24.6: %i32 = converted %.loc9_24.1, %.loc9_24.5 [template = constants.%.32] +// CHECK:STDOUT: %int.less.loc9: init bool = call %Less.ref.loc9(%.loc9_21.6, %.loc9_24.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %int.less.loc9 [template = constants.%.33] +// CHECK:STDOUT: %.loc9_13.2: bool = converted %int.less.loc9, %.loc9_13.1 [template = constants.%.33] // CHECK:STDOUT: if %.loc9_13.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: @@ -219,21 +232,23 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc9_13.3: type = block_arg !if.expr.result.loc9 [template = constants.%True] // CHECK:STDOUT: %false_.ref.loc10: %False = name_ref false_, %false_ // CHECK:STDOUT: %Less.ref.loc10: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] -// CHECK:STDOUT: %.loc10_22.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc10_25.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc10_22.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_22.3: = bound_method %.loc10_22.1, %.loc10_22.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc10_22: init i32 = call %.loc10_22.3(%.loc10_22.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc10_22.4: i32 = value_of_initializer %int.convert_checked.loc10_22 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_22.5: i32 = converted %.loc10_22.1, %.loc10_22.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_25.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_25.3: = bound_method %.loc10_25.1, %.loc10_25.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc10_25: init i32 = call %.loc10_25.3(%.loc10_25.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc10_25.4: i32 = value_of_initializer %int.convert_checked.loc10_25 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_25.5: i32 = converted %.loc10_25.1, %.loc10_25.4 [template = constants.%.31] -// CHECK:STDOUT: %int.less.loc10: init bool = call %Less.ref.loc10(%.loc10_22.5, %.loc10_25.5) [template = constants.%.35] -// CHECK:STDOUT: %.loc10_14.1: bool = value_of_initializer %int.less.loc10 [template = constants.%.35] -// CHECK:STDOUT: %.loc10_14.2: bool = converted %int.less.loc10, %.loc10_14.1 [template = constants.%.35] +// CHECK:STDOUT: %.loc10_22.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc10_25.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc10_22.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_22.3: = bound_method %.loc10_22.1, %.loc10_22.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc10_22.4: = specific_function %.loc10_22.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc10_22: init %i32 = call %.loc10_22.4(%.loc10_22.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc10_22.5: %i32 = value_of_initializer %int.convert_checked.loc10_22 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_22.6: %i32 = converted %.loc10_22.1, %.loc10_22.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_25.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_25.3: = bound_method %.loc10_25.1, %.loc10_25.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc10_25.4: = specific_function %.loc10_25.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc10_25: init %i32 = call %.loc10_25.4(%.loc10_25.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc10_25.5: %i32 = value_of_initializer %int.convert_checked.loc10_25 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_25.6: %i32 = converted %.loc10_25.1, %.loc10_25.5 [template = constants.%.29] +// CHECK:STDOUT: %int.less.loc10: init bool = call %Less.ref.loc10(%.loc10_22.6, %.loc10_25.6) [template = constants.%.34] +// CHECK:STDOUT: %.loc10_14.1: bool = value_of_initializer %int.less.loc10 [template = constants.%.34] +// CHECK:STDOUT: %.loc10_14.2: bool = converted %int.less.loc10, %.loc10_14.1 [template = constants.%.34] // CHECK:STDOUT: if %.loc10_14.2 br !if.expr.then.loc10 else br !if.expr.else.loc10 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc10: @@ -248,21 +263,23 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc10_14.3: type = block_arg !if.expr.result.loc10 [template = constants.%False] // CHECK:STDOUT: %false_.ref.loc11: %False = name_ref false_, %false_ // CHECK:STDOUT: %Less.ref.loc11: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] -// CHECK:STDOUT: %.loc11_22.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_25.1: Core.IntLiteral = int_value 0 [template = constants.%.36] -// CHECK:STDOUT: %.loc11_22.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_22.3: = bound_method %.loc11_22.1, %.loc11_22.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_22: init i32 = call %.loc11_22.3(%.loc11_22.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_22.4: i32 = value_of_initializer %int.convert_checked.loc11_22 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_22.5: i32 = converted %.loc11_22.1, %.loc11_22.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_25.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_25.3: = bound_method %.loc11_25.1, %.loc11_25.2 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc11_25: init i32 = call %.loc11_25.3(%.loc11_25.1) [template = constants.%.38] -// CHECK:STDOUT: %.loc11_25.4: i32 = value_of_initializer %int.convert_checked.loc11_25 [template = constants.%.38] -// CHECK:STDOUT: %.loc11_25.5: i32 = converted %.loc11_25.1, %.loc11_25.4 [template = constants.%.38] -// CHECK:STDOUT: %int.less.loc11: init bool = call %Less.ref.loc11(%.loc11_22.5, %.loc11_25.5) [template = constants.%.35] -// CHECK:STDOUT: %.loc11_14.1: bool = value_of_initializer %int.less.loc11 [template = constants.%.35] -// CHECK:STDOUT: %.loc11_14.2: bool = converted %int.less.loc11, %.loc11_14.1 [template = constants.%.35] +// CHECK:STDOUT: %.loc11_22.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_25.1: Core.IntLiteral = int_value 0 [template = constants.%.35] +// CHECK:STDOUT: %.loc11_22.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_22.3: = bound_method %.loc11_22.1, %.loc11_22.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_22.4: = specific_function %.loc11_22.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc11_22: init %i32 = call %.loc11_22.4(%.loc11_22.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc11_22.5: %i32 = value_of_initializer %int.convert_checked.loc11_22 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_22.6: %i32 = converted %.loc11_22.1, %.loc11_22.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_25.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_25.3: = bound_method %.loc11_25.1, %.loc11_25.2 [template = constants.%.36] +// CHECK:STDOUT: %.loc11_25.4: = specific_function %.loc11_25.3, @Convert.2(constants.%.1) [template = constants.%.37] +// CHECK:STDOUT: %int.convert_checked.loc11_25: init %i32 = call %.loc11_25.4(%.loc11_25.1) [template = constants.%.38] +// CHECK:STDOUT: %.loc11_25.5: %i32 = value_of_initializer %int.convert_checked.loc11_25 [template = constants.%.38] +// CHECK:STDOUT: %.loc11_25.6: %i32 = converted %.loc11_25.1, %.loc11_25.5 [template = constants.%.38] +// CHECK:STDOUT: %int.less.loc11: init bool = call %Less.ref.loc11(%.loc11_22.6, %.loc11_25.6) [template = constants.%.34] +// CHECK:STDOUT: %.loc11_14.1: bool = value_of_initializer %int.less.loc11 [template = constants.%.34] +// CHECK:STDOUT: %.loc11_14.2: bool = converted %int.less.loc11, %.loc11_14.1 [template = constants.%.34] // CHECK:STDOUT: if %.loc11_14.2 br !if.expr.then.loc11 else br !if.expr.else.loc11 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc11: @@ -278,24 +295,26 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %true_.ref.loc12: %True = name_ref true_, %true_ // CHECK:STDOUT: %Less.ref.loc12: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_28.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_28.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_28.3: = bound_method %.loc12_28.1, %.loc12_28.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc12_28: init i32 = call %.loc12_28.3(%.loc12_28.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc12_28.4: i32 = value_of_initializer %int.convert_checked.loc12_28 [template = constants.%.31] -// CHECK:STDOUT: %.loc12_28.5: i32 = converted %.loc12_28.1, %.loc12_28.4 [template = constants.%.31] -// CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_28.5) [template = constants.%.39] -// CHECK:STDOUT: %.loc12_32.1: Core.IntLiteral = int_value 0 [template = constants.%.36] -// CHECK:STDOUT: %.loc12_27.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.39] -// CHECK:STDOUT: %.loc12_27.2: i32 = converted %int.snegate.loc12, %.loc12_27.1 [template = constants.%.39] -// CHECK:STDOUT: %.loc12_32.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_32.3: = bound_method %.loc12_32.1, %.loc12_32.2 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc12_32: init i32 = call %.loc12_32.3(%.loc12_32.1) [template = constants.%.38] -// CHECK:STDOUT: %.loc12_32.4: i32 = value_of_initializer %int.convert_checked.loc12_32 [template = constants.%.38] -// CHECK:STDOUT: %.loc12_32.5: i32 = converted %.loc12_32.1, %.loc12_32.4 [template = constants.%.38] -// CHECK:STDOUT: %int.less.loc12: init bool = call %Less.ref.loc12(%.loc12_27.2, %.loc12_32.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %int.less.loc12 [template = constants.%.34] -// CHECK:STDOUT: %.loc12_13.2: bool = converted %int.less.loc12, %.loc12_13.1 [template = constants.%.34] +// CHECK:STDOUT: %.loc12_28.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc12_28.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_28.3: = bound_method %.loc12_28.1, %.loc12_28.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_28.4: = specific_function %.loc12_28.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc12_28: init %i32 = call %.loc12_28.4(%.loc12_28.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc12_28.5: %i32 = value_of_initializer %int.convert_checked.loc12_28 [template = constants.%.29] +// CHECK:STDOUT: %.loc12_28.6: %i32 = converted %.loc12_28.1, %.loc12_28.5 [template = constants.%.29] +// CHECK:STDOUT: %int.snegate.loc12: init %i32 = call %Negate.ref.loc12(%.loc12_28.6) [template = constants.%.39] +// CHECK:STDOUT: %.loc12_32.1: Core.IntLiteral = int_value 0 [template = constants.%.35] +// CHECK:STDOUT: %.loc12_27.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.39] +// CHECK:STDOUT: %.loc12_27.2: %i32 = converted %int.snegate.loc12, %.loc12_27.1 [template = constants.%.39] +// CHECK:STDOUT: %.loc12_32.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_32.3: = bound_method %.loc12_32.1, %.loc12_32.2 [template = constants.%.36] +// CHECK:STDOUT: %.loc12_32.4: = specific_function %.loc12_32.3, @Convert.2(constants.%.1) [template = constants.%.37] +// CHECK:STDOUT: %int.convert_checked.loc12_32: init %i32 = call %.loc12_32.4(%.loc12_32.1) [template = constants.%.38] +// CHECK:STDOUT: %.loc12_32.5: %i32 = value_of_initializer %int.convert_checked.loc12_32 [template = constants.%.38] +// CHECK:STDOUT: %.loc12_32.6: %i32 = converted %.loc12_32.1, %.loc12_32.5 [template = constants.%.38] +// CHECK:STDOUT: %int.less.loc12: init bool = call %Less.ref.loc12(%.loc12_27.2, %.loc12_32.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %int.less.loc12 [template = constants.%.33] +// CHECK:STDOUT: %.loc12_13.2: bool = converted %int.less.loc12, %.loc12_13.1 [template = constants.%.33] // CHECK:STDOUT: if %.loc12_13.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc12: @@ -310,25 +329,27 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc12_13.3: type = block_arg !if.expr.result.loc12 [template = constants.%True] // CHECK:STDOUT: %false_.ref.loc13: %False = name_ref false_, %false_ // CHECK:STDOUT: %Less.ref.loc13: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] -// CHECK:STDOUT: %.loc13_22.1: Core.IntLiteral = int_value 0 [template = constants.%.36] +// CHECK:STDOUT: %.loc13_22.1: Core.IntLiteral = int_value 0 [template = constants.%.35] // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc13_32.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc13_32.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_32.3: = bound_method %.loc13_32.1, %.loc13_32.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc13_32: init i32 = call %.loc13_32.3(%.loc13_32.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc13_32.4: i32 = value_of_initializer %int.convert_checked.loc13_32 [template = constants.%.31] -// CHECK:STDOUT: %.loc13_32.5: i32 = converted %.loc13_32.1, %.loc13_32.4 [template = constants.%.31] -// CHECK:STDOUT: %int.snegate.loc13: init i32 = call %Negate.ref.loc13(%.loc13_32.5) [template = constants.%.39] -// CHECK:STDOUT: %.loc13_22.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_22.3: = bound_method %.loc13_22.1, %.loc13_22.2 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc13_22: init i32 = call %.loc13_22.3(%.loc13_22.1) [template = constants.%.38] -// CHECK:STDOUT: %.loc13_22.4: i32 = value_of_initializer %int.convert_checked.loc13_22 [template = constants.%.38] -// CHECK:STDOUT: %.loc13_22.5: i32 = converted %.loc13_22.1, %.loc13_22.4 [template = constants.%.38] -// CHECK:STDOUT: %.loc13_31.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.39] -// CHECK:STDOUT: %.loc13_31.2: i32 = converted %int.snegate.loc13, %.loc13_31.1 [template = constants.%.39] -// CHECK:STDOUT: %int.less.loc13: init bool = call %Less.ref.loc13(%.loc13_22.5, %.loc13_31.2) [template = constants.%.35] -// CHECK:STDOUT: %.loc13_14.1: bool = value_of_initializer %int.less.loc13 [template = constants.%.35] -// CHECK:STDOUT: %.loc13_14.2: bool = converted %int.less.loc13, %.loc13_14.1 [template = constants.%.35] +// CHECK:STDOUT: %.loc13_32.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc13_32.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_32.3: = bound_method %.loc13_32.1, %.loc13_32.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc13_32.4: = specific_function %.loc13_32.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc13_32: init %i32 = call %.loc13_32.4(%.loc13_32.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc13_32.5: %i32 = value_of_initializer %int.convert_checked.loc13_32 [template = constants.%.29] +// CHECK:STDOUT: %.loc13_32.6: %i32 = converted %.loc13_32.1, %.loc13_32.5 [template = constants.%.29] +// CHECK:STDOUT: %int.snegate.loc13: init %i32 = call %Negate.ref.loc13(%.loc13_32.6) [template = constants.%.39] +// CHECK:STDOUT: %.loc13_22.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_22.3: = bound_method %.loc13_22.1, %.loc13_22.2 [template = constants.%.36] +// CHECK:STDOUT: %.loc13_22.4: = specific_function %.loc13_22.3, @Convert.2(constants.%.1) [template = constants.%.37] +// CHECK:STDOUT: %int.convert_checked.loc13_22: init %i32 = call %.loc13_22.4(%.loc13_22.1) [template = constants.%.38] +// CHECK:STDOUT: %.loc13_22.5: %i32 = value_of_initializer %int.convert_checked.loc13_22 [template = constants.%.38] +// CHECK:STDOUT: %.loc13_22.6: %i32 = converted %.loc13_22.1, %.loc13_22.5 [template = constants.%.38] +// CHECK:STDOUT: %.loc13_31.1: %i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.39] +// CHECK:STDOUT: %.loc13_31.2: %i32 = converted %int.snegate.loc13, %.loc13_31.1 [template = constants.%.39] +// CHECK:STDOUT: %int.less.loc13: init bool = call %Less.ref.loc13(%.loc13_22.6, %.loc13_31.2) [template = constants.%.34] +// CHECK:STDOUT: %.loc13_14.1: bool = value_of_initializer %int.less.loc13 [template = constants.%.34] +// CHECK:STDOUT: %.loc13_14.2: bool = converted %int.less.loc13, %.loc13_14.1 [template = constants.%.34] // CHECK:STDOUT: if %.loc13_14.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc13: @@ -344,11 +365,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Less.ref: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.less: init bool = call %Less.ref(%a.ref, %b.ref) // CHECK:STDOUT: %.loc17_20.1: bool = value_of_initializer %int.less // CHECK:STDOUT: %.loc17_20.2: bool = converted %int.less, %.loc17_20.1 diff --git a/toolchain/check/testdata/builtins/int/less_eq.carbon b/toolchain/check/testdata/builtins/int/less_eq.carbon index 9799b6b54016..01a01fff8290 100644 --- a/toolchain/check/testdata/builtins/int/less_eq.carbon +++ b/toolchain/check/testdata/builtins/int/less_eq.carbon @@ -31,8 +31,10 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: --- int_less_eq.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %LessEq.type: type = fn_type @LessEq [template] @@ -40,34 +42,37 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 2 [template] -// CHECK:STDOUT: %.34: bool = bool_literal true [template] -// CHECK:STDOUT: %.35: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.36: = bound_method %.35, %Convert.15 [template] -// CHECK:STDOUT: %.37: i32 = int_value 0 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.30: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.33: bool = bool_literal true [template] +// CHECK:STDOUT: %.34: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.35: = bound_method %.34, %Convert.14 [template] +// CHECK:STDOUT: %.36: = specific_function %.35, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.37: %i32 = int_value 0 [template] // CHECK:STDOUT: %.38: bool = bool_literal false [template] -// CHECK:STDOUT: %.39: i32 = int_value -1 [template] +// CHECK:STDOUT: %.39: %i32 = int_value -1 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude @@ -87,45 +92,49 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %LessEq.decl: %LessEq.type = fn_decl @LessEq [template = constants.%LessEq] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %int.make_type_32.loc2_14 [template = i32] -// CHECK:STDOUT: %.loc2_14.2: type = converted %int.make_type_32.loc2_14, %.loc2_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_22.1: type = value_of_initializer %int.make_type_32.loc2_22 [template = i32] -// CHECK:STDOUT: %.loc2_22.2: type = converted %int.make_type_32.loc2_22, %.loc2_22.1 [template = i32] +// CHECK:STDOUT: %.loc2_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_14: init type = call constants.%Int(%.loc2_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_14.2: type = value_of_initializer %int.make_type_signed.loc2_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_14.3: type = converted %int.make_type_signed.loc2_14, %.loc2_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_22: init type = call constants.%Int(%.loc2_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_22.2: type = value_of_initializer %int.make_type_signed.loc2_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_22.3: type = converted %int.make_type_signed.loc2_22, %.loc2_22.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_30.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_30.2: type = converted %bool.make_type, %.loc2_30.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc3_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_32.loc3_14 [template = i32] -// CHECK:STDOUT: %.loc3_14.2: type = converted %int.make_type_32.loc3_14, %.loc3_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc3_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc3_22.1: type = value_of_initializer %int.make_type_32.loc3_22 [template = i32] -// CHECK:STDOUT: %.loc3_22.2: type = converted %int.make_type_32.loc3_22, %.loc3_22.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc3_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc3_14: init type = call constants.%Int(%.loc3_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc3_14.2: type = value_of_initializer %int.make_type_signed.loc3_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_14.3: type = converted %int.make_type_signed.loc3_14, %.loc3_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc3_22: init type = call constants.%Int(%.loc3_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc3_22.2: type = value_of_initializer %int.make_type_signed.loc3_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_22.3: type = converted %int.make_type_signed.loc3_22, %.loc3_22.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} // CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} @@ -143,68 +152,72 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc16_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32.loc16_19 [template = i32] -// CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_32.loc16_19, %.loc16_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc16_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %int.make_type_32.loc16_27 [template = i32] -// CHECK:STDOUT: %.loc16_27.2: type = converted %int.make_type_32.loc16_27, %.loc16_27.1 [template = i32] +// CHECK:STDOUT: %.loc16_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16_19: init type = call constants.%Int(%.loc16_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_19.2: type = value_of_initializer %int.make_type_signed.loc16_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_19.3: type = converted %int.make_type_signed.loc16_19, %.loc16_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16_27: init type = call constants.%Int(%.loc16_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_27.2: type = value_of_initializer %int.make_type_signed.loc16_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_27.3: type = converted %int.make_type_signed.loc16_27, %.loc16_27.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %.loc5: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc5: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %.loc6: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @LessEq(%a.param_patt: i32, %b.param_patt: i32) -> bool = "int.less_eq"; +// CHECK:STDOUT: fn @LessEq(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.less_eq"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref.loc9: %True = name_ref true_, %true_ // CHECK:STDOUT: %LessEq.ref.loc9: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %.loc9_23.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc9_26.1: Core.IntLiteral = int_value 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_23.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_23.3: = bound_method %.loc9_23.1, %.loc9_23.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc9_23: init i32 = call %.loc9_23.3(%.loc9_23.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc9_23.4: i32 = value_of_initializer %int.convert_checked.loc9_23 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_23.5: i32 = converted %.loc9_23.1, %.loc9_23.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_26.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_26.3: = bound_method %.loc9_26.1, %.loc9_26.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc9_26: init i32 = call %.loc9_26.3(%.loc9_26.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc9_26.4: i32 = value_of_initializer %int.convert_checked.loc9_26 [template = constants.%.33] -// CHECK:STDOUT: %.loc9_26.5: i32 = converted %.loc9_26.1, %.loc9_26.4 [template = constants.%.33] -// CHECK:STDOUT: %int.less_eq.loc9: init bool = call %LessEq.ref.loc9(%.loc9_23.5, %.loc9_26.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %int.less_eq.loc9 [template = constants.%.34] -// CHECK:STDOUT: %.loc9_13.2: bool = converted %int.less_eq.loc9, %.loc9_13.1 [template = constants.%.34] +// CHECK:STDOUT: %.loc9_23.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_26.1: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_23.3: = bound_method %.loc9_23.1, %.loc9_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_23.4: = specific_function %.loc9_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc9_23: init %i32 = call %.loc9_23.4(%.loc9_23.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc9_23.5: %i32 = value_of_initializer %int.convert_checked.loc9_23 [template = constants.%.29] +// CHECK:STDOUT: %.loc9_23.6: %i32 = converted %.loc9_23.1, %.loc9_23.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc9_26.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_26.3: = bound_method %.loc9_26.1, %.loc9_26.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc9_26.4: = specific_function %.loc9_26.3, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc9_26: init %i32 = call %.loc9_26.4(%.loc9_26.1) [template = constants.%.32] +// CHECK:STDOUT: %.loc9_26.5: %i32 = value_of_initializer %int.convert_checked.loc9_26 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_26.6: %i32 = converted %.loc9_26.1, %.loc9_26.5 [template = constants.%.32] +// CHECK:STDOUT: %int.less_eq.loc9: init bool = call %LessEq.ref.loc9(%.loc9_23.6, %.loc9_26.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %int.less_eq.loc9 [template = constants.%.33] +// CHECK:STDOUT: %.loc9_13.2: bool = converted %int.less_eq.loc9, %.loc9_13.1 [template = constants.%.33] // CHECK:STDOUT: if %.loc9_13.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: @@ -219,21 +232,23 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc9_13.3: type = block_arg !if.expr.result.loc9 [template = constants.%True] // CHECK:STDOUT: %true_.ref.loc10: %True = name_ref true_, %true_ // CHECK:STDOUT: %LessEq.ref.loc10: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %.loc10_23.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc10_26.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc10_23.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_23.3: = bound_method %.loc10_23.1, %.loc10_23.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc10_23: init i32 = call %.loc10_23.3(%.loc10_23.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc10_23.4: i32 = value_of_initializer %int.convert_checked.loc10_23 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_23.5: i32 = converted %.loc10_23.1, %.loc10_23.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_26.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_26.3: = bound_method %.loc10_26.1, %.loc10_26.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc10_26: init i32 = call %.loc10_26.3(%.loc10_26.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc10_26.4: i32 = value_of_initializer %int.convert_checked.loc10_26 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_26.5: i32 = converted %.loc10_26.1, %.loc10_26.4 [template = constants.%.31] -// CHECK:STDOUT: %int.less_eq.loc10: init bool = call %LessEq.ref.loc10(%.loc10_23.5, %.loc10_26.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc10_13.1: bool = value_of_initializer %int.less_eq.loc10 [template = constants.%.34] -// CHECK:STDOUT: %.loc10_13.2: bool = converted %int.less_eq.loc10, %.loc10_13.1 [template = constants.%.34] +// CHECK:STDOUT: %.loc10_23.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc10_26.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc10_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_23.3: = bound_method %.loc10_23.1, %.loc10_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc10_23.4: = specific_function %.loc10_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc10_23: init %i32 = call %.loc10_23.4(%.loc10_23.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc10_23.5: %i32 = value_of_initializer %int.convert_checked.loc10_23 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_23.6: %i32 = converted %.loc10_23.1, %.loc10_23.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_26.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_26.3: = bound_method %.loc10_26.1, %.loc10_26.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc10_26.4: = specific_function %.loc10_26.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc10_26: init %i32 = call %.loc10_26.4(%.loc10_26.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc10_26.5: %i32 = value_of_initializer %int.convert_checked.loc10_26 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_26.6: %i32 = converted %.loc10_26.1, %.loc10_26.5 [template = constants.%.29] +// CHECK:STDOUT: %int.less_eq.loc10: init bool = call %LessEq.ref.loc10(%.loc10_23.6, %.loc10_26.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc10_13.1: bool = value_of_initializer %int.less_eq.loc10 [template = constants.%.33] +// CHECK:STDOUT: %.loc10_13.2: bool = converted %int.less_eq.loc10, %.loc10_13.1 [template = constants.%.33] // CHECK:STDOUT: if %.loc10_13.2 br !if.expr.then.loc10 else br !if.expr.else.loc10 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc10: @@ -248,19 +263,21 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc10_13.3: type = block_arg !if.expr.result.loc10 [template = constants.%True] // CHECK:STDOUT: %false_.ref.loc11: %False = name_ref false_, %false_ // CHECK:STDOUT: %LessEq.ref.loc11: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %.loc11_24.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_27.1: Core.IntLiteral = int_value 0 [template = constants.%.35] -// CHECK:STDOUT: %.loc11_24.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_24.3: = bound_method %.loc11_24.1, %.loc11_24.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_24: init i32 = call %.loc11_24.3(%.loc11_24.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_24.4: i32 = value_of_initializer %int.convert_checked.loc11_24 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_24.5: i32 = converted %.loc11_24.1, %.loc11_24.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_27.1, %.loc11_27.2 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc11_27: init i32 = call %.loc11_27.3(%.loc11_27.1) [template = constants.%.37] -// CHECK:STDOUT: %.loc11_27.4: i32 = value_of_initializer %int.convert_checked.loc11_27 [template = constants.%.37] -// CHECK:STDOUT: %.loc11_27.5: i32 = converted %.loc11_27.1, %.loc11_27.4 [template = constants.%.37] -// CHECK:STDOUT: %int.less_eq.loc11: init bool = call %LessEq.ref.loc11(%.loc11_24.5, %.loc11_27.5) [template = constants.%.38] +// CHECK:STDOUT: %.loc11_24.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_27.1: Core.IntLiteral = int_value 0 [template = constants.%.34] +// CHECK:STDOUT: %.loc11_24.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_24.3: = bound_method %.loc11_24.1, %.loc11_24.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_24.4: = specific_function %.loc11_24.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc11_24: init %i32 = call %.loc11_24.4(%.loc11_24.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc11_24.5: %i32 = value_of_initializer %int.convert_checked.loc11_24 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_24.6: %i32 = converted %.loc11_24.1, %.loc11_24.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_27.1, %.loc11_27.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc11_27.4: = specific_function %.loc11_27.3, @Convert.2(constants.%.1) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc11_27: init %i32 = call %.loc11_27.4(%.loc11_27.1) [template = constants.%.37] +// CHECK:STDOUT: %.loc11_27.5: %i32 = value_of_initializer %int.convert_checked.loc11_27 [template = constants.%.37] +// CHECK:STDOUT: %.loc11_27.6: %i32 = converted %.loc11_27.1, %.loc11_27.5 [template = constants.%.37] +// CHECK:STDOUT: %int.less_eq.loc11: init bool = call %LessEq.ref.loc11(%.loc11_24.6, %.loc11_27.6) [template = constants.%.38] // CHECK:STDOUT: %.loc11_14.1: bool = value_of_initializer %int.less_eq.loc11 [template = constants.%.38] // CHECK:STDOUT: %.loc11_14.2: bool = converted %int.less_eq.loc11, %.loc11_14.1 [template = constants.%.38] // CHECK:STDOUT: if %.loc11_14.2 br !if.expr.then.loc11 else br !if.expr.else.loc11 @@ -278,24 +295,26 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %true_.ref.loc12: %True = name_ref true_, %true_ // CHECK:STDOUT: %LessEq.ref.loc12: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_30.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_30.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_30.3: = bound_method %.loc12_30.1, %.loc12_30.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc12_30: init i32 = call %.loc12_30.3(%.loc12_30.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc12_30.4: i32 = value_of_initializer %int.convert_checked.loc12_30 [template = constants.%.31] -// CHECK:STDOUT: %.loc12_30.5: i32 = converted %.loc12_30.1, %.loc12_30.4 [template = constants.%.31] -// CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_30.5) [template = constants.%.39] -// CHECK:STDOUT: %.loc12_34.1: Core.IntLiteral = int_value 0 [template = constants.%.35] -// CHECK:STDOUT: %.loc12_29.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.39] -// CHECK:STDOUT: %.loc12_29.2: i32 = converted %int.snegate.loc12, %.loc12_29.1 [template = constants.%.39] -// CHECK:STDOUT: %.loc12_34.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_34.3: = bound_method %.loc12_34.1, %.loc12_34.2 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc12_34: init i32 = call %.loc12_34.3(%.loc12_34.1) [template = constants.%.37] -// CHECK:STDOUT: %.loc12_34.4: i32 = value_of_initializer %int.convert_checked.loc12_34 [template = constants.%.37] -// CHECK:STDOUT: %.loc12_34.5: i32 = converted %.loc12_34.1, %.loc12_34.4 [template = constants.%.37] -// CHECK:STDOUT: %int.less_eq.loc12: init bool = call %LessEq.ref.loc12(%.loc12_29.2, %.loc12_34.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %int.less_eq.loc12 [template = constants.%.34] -// CHECK:STDOUT: %.loc12_13.2: bool = converted %int.less_eq.loc12, %.loc12_13.1 [template = constants.%.34] +// CHECK:STDOUT: %.loc12_30.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc12_30.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_30.3: = bound_method %.loc12_30.1, %.loc12_30.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_30.4: = specific_function %.loc12_30.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc12_30: init %i32 = call %.loc12_30.4(%.loc12_30.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc12_30.5: %i32 = value_of_initializer %int.convert_checked.loc12_30 [template = constants.%.29] +// CHECK:STDOUT: %.loc12_30.6: %i32 = converted %.loc12_30.1, %.loc12_30.5 [template = constants.%.29] +// CHECK:STDOUT: %int.snegate.loc12: init %i32 = call %Negate.ref.loc12(%.loc12_30.6) [template = constants.%.39] +// CHECK:STDOUT: %.loc12_34.1: Core.IntLiteral = int_value 0 [template = constants.%.34] +// CHECK:STDOUT: %.loc12_29.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.39] +// CHECK:STDOUT: %.loc12_29.2: %i32 = converted %int.snegate.loc12, %.loc12_29.1 [template = constants.%.39] +// CHECK:STDOUT: %.loc12_34.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_34.3: = bound_method %.loc12_34.1, %.loc12_34.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc12_34.4: = specific_function %.loc12_34.3, @Convert.2(constants.%.1) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc12_34: init %i32 = call %.loc12_34.4(%.loc12_34.1) [template = constants.%.37] +// CHECK:STDOUT: %.loc12_34.5: %i32 = value_of_initializer %int.convert_checked.loc12_34 [template = constants.%.37] +// CHECK:STDOUT: %.loc12_34.6: %i32 = converted %.loc12_34.1, %.loc12_34.5 [template = constants.%.37] +// CHECK:STDOUT: %int.less_eq.loc12: init bool = call %LessEq.ref.loc12(%.loc12_29.2, %.loc12_34.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %int.less_eq.loc12 [template = constants.%.33] +// CHECK:STDOUT: %.loc12_13.2: bool = converted %int.less_eq.loc12, %.loc12_13.1 [template = constants.%.33] // CHECK:STDOUT: if %.loc12_13.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc12: @@ -310,23 +329,25 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc12_13.3: type = block_arg !if.expr.result.loc12 [template = constants.%True] // CHECK:STDOUT: %false_.ref.loc13: %False = name_ref false_, %false_ // CHECK:STDOUT: %LessEq.ref.loc13: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %.loc13_24.1: Core.IntLiteral = int_value 0 [template = constants.%.35] +// CHECK:STDOUT: %.loc13_24.1: Core.IntLiteral = int_value 0 [template = constants.%.34] // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc13_34.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc13_34.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_34.3: = bound_method %.loc13_34.1, %.loc13_34.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc13_34: init i32 = call %.loc13_34.3(%.loc13_34.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc13_34.4: i32 = value_of_initializer %int.convert_checked.loc13_34 [template = constants.%.31] -// CHECK:STDOUT: %.loc13_34.5: i32 = converted %.loc13_34.1, %.loc13_34.4 [template = constants.%.31] -// CHECK:STDOUT: %int.snegate.loc13: init i32 = call %Negate.ref.loc13(%.loc13_34.5) [template = constants.%.39] -// CHECK:STDOUT: %.loc13_24.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_24.3: = bound_method %.loc13_24.1, %.loc13_24.2 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc13_24: init i32 = call %.loc13_24.3(%.loc13_24.1) [template = constants.%.37] -// CHECK:STDOUT: %.loc13_24.4: i32 = value_of_initializer %int.convert_checked.loc13_24 [template = constants.%.37] -// CHECK:STDOUT: %.loc13_24.5: i32 = converted %.loc13_24.1, %.loc13_24.4 [template = constants.%.37] -// CHECK:STDOUT: %.loc13_33.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.39] -// CHECK:STDOUT: %.loc13_33.2: i32 = converted %int.snegate.loc13, %.loc13_33.1 [template = constants.%.39] -// CHECK:STDOUT: %int.less_eq.loc13: init bool = call %LessEq.ref.loc13(%.loc13_24.5, %.loc13_33.2) [template = constants.%.38] +// CHECK:STDOUT: %.loc13_34.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc13_34.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_34.3: = bound_method %.loc13_34.1, %.loc13_34.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc13_34.4: = specific_function %.loc13_34.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc13_34: init %i32 = call %.loc13_34.4(%.loc13_34.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc13_34.5: %i32 = value_of_initializer %int.convert_checked.loc13_34 [template = constants.%.29] +// CHECK:STDOUT: %.loc13_34.6: %i32 = converted %.loc13_34.1, %.loc13_34.5 [template = constants.%.29] +// CHECK:STDOUT: %int.snegate.loc13: init %i32 = call %Negate.ref.loc13(%.loc13_34.6) [template = constants.%.39] +// CHECK:STDOUT: %.loc13_24.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_24.3: = bound_method %.loc13_24.1, %.loc13_24.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc13_24.4: = specific_function %.loc13_24.3, @Convert.2(constants.%.1) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc13_24: init %i32 = call %.loc13_24.4(%.loc13_24.1) [template = constants.%.37] +// CHECK:STDOUT: %.loc13_24.5: %i32 = value_of_initializer %int.convert_checked.loc13_24 [template = constants.%.37] +// CHECK:STDOUT: %.loc13_24.6: %i32 = converted %.loc13_24.1, %.loc13_24.5 [template = constants.%.37] +// CHECK:STDOUT: %.loc13_33.1: %i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.39] +// CHECK:STDOUT: %.loc13_33.2: %i32 = converted %int.snegate.loc13, %.loc13_33.1 [template = constants.%.39] +// CHECK:STDOUT: %int.less_eq.loc13: init bool = call %LessEq.ref.loc13(%.loc13_24.6, %.loc13_33.2) [template = constants.%.38] // CHECK:STDOUT: %.loc13_14.1: bool = value_of_initializer %int.less_eq.loc13 [template = constants.%.38] // CHECK:STDOUT: %.loc13_14.2: bool = converted %int.less_eq.loc13, %.loc13_14.1 [template = constants.%.38] // CHECK:STDOUT: if %.loc13_14.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 @@ -344,11 +365,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %LessEq.ref: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.less_eq: init bool = call %LessEq.ref(%a.ref, %b.ref) // CHECK:STDOUT: %.loc17_22.1: bool = value_of_initializer %int.less_eq // CHECK:STDOUT: %.loc17_22.2: bool = converted %int.less_eq, %.loc17_22.1 diff --git a/toolchain/check/testdata/builtins/int/make_type_32.carbon b/toolchain/check/testdata/builtins/int/make_type_32.carbon deleted file mode 100644 index 846a534284a7..000000000000 --- a/toolchain/check/testdata/builtins/int/make_type_32.carbon +++ /dev/null @@ -1,107 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// AUTOUPDATE -// TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/make_type_32.carbon -// TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtins/int/make_type_32.carbon - -// --- types.carbon - -library "[[@TEST_NAME]]"; - -fn Int() -> type = "int.make_type_32"; - -// --- use_types.carbon - -library "[[@TEST_NAME]]"; - -import library "types"; - -var i: Int() = 0; - -// CHECK:STDOUT: --- types.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Int = %Int.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] { -// CHECK:STDOUT: %return.patt: type = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 -// CHECK:STDOUT: %return: ref type = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int() -> type = "int.make_type_32"; -// CHECK:STDOUT: -// CHECK:STDOUT: --- use_types.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Main//types, inst+7, loaded [template = constants.%Int] -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int = imports.%import_ref.1 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .i = %i -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] -// CHECK:STDOUT: %int.make_type_32: init type = call %Int.ref() [template = i32] -// CHECK:STDOUT: %.loc6_12.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc6_12.2: type = converted %int.make_type_32, %.loc6_12.1 [template = i32] -// CHECK:STDOUT: %i.var: ref i32 = var i -// CHECK:STDOUT: %i: ref i32 = bind_name i, %i.var -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int() -> type = "int.make_type_32"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc6_16: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc6_17.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_17.2: = bound_method %.loc6_16, %.loc6_17.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc6_17.2(%.loc6_16) [template = constants.%.27] -// CHECK:STDOUT: %.loc6_17.3: init i32 = converted %.loc6_16, %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: assign file.%i.var, %.loc6_17.3 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/make_type_signed.carbon b/toolchain/check/testdata/builtins/int/make_type_signed.carbon index dfb1e01fa577..4342d927ce2c 100644 --- a/toolchain/check/testdata/builtins/int/make_type_signed.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -12,7 +12,8 @@ library "[[@TEST_NAME]]"; -fn Int(n: i32) -> type = "int.make_type_signed"; +fn IntLiteral() -> type = "int_literal.make_type"; +fn Int(n: IntLiteral()) -> type = "int.make_type_signed"; // --- use_types.carbon @@ -28,7 +29,7 @@ fn G(n: Int(13)) -> Int(13) { return n; } -fn Symbolic(N:! i32, x: Int(N)) -> Int(N) { +fn Symbolic(N:! IntLiteral(), x: Int(N)) -> Int(N) { return x; } @@ -91,15 +92,14 @@ var m: Int(1000000000); // CHECK:STDOUT: --- types.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] +// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -108,26 +108,37 @@ var m: Int(1000000000); // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .IntLiteral = %IntLiteral.decl // CHECK:STDOUT: .Int = %Int.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] { +// CHECK:STDOUT: %return.patt: type = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 +// CHECK:STDOUT: %return: ref type = return_slot %return.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %n.patt: Core.IntLiteral = binding_pattern n +// CHECK:STDOUT: %n.param_patt: Core.IntLiteral = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_22.2: type = converted %int_literal.make_type, %.loc5_22.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %n.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %n: Core.IntLiteral = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n.param_patt: i32) -> type = "int.make_type_signed"; +// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: // CHECK:STDOUT: --- use_types.carbon // CHECK:STDOUT: @@ -135,35 +146,26 @@ var m: Int(1000000000); // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 64 [template] -// CHECK:STDOUT: %.28: type = int_type signed, %.27 [template] +// CHECK:STDOUT: %i64: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 13 [template] -// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 13 [template] -// CHECK:STDOUT: %.32: type = int_type signed, %.31 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 13 [template] +// CHECK:STDOUT: %i13: type = int_type signed, %.2 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N.2: i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt.2: i32 = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %.33: type = int_type signed, %N.2 [symbolic] +// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] +// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %Symbolic.type: type = fn_type @Symbolic [template] // CHECK:STDOUT: %Symbolic: %Symbolic.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Main//types, inst+22, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Main//types, inst+7, loaded [template = constants.%IntLiteral] +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Main//types, inst+23, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Int32 = %import_ref.51 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -171,7 +173,8 @@ var m: Int(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int = imports.%import_ref.1 +// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 +// CHECK:STDOUT: .Int = imports.%import_ref.2 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .G = %G.decl @@ -180,129 +183,112 @@ var m: Int(1000000000); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %n.patt: %.28 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %.28 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.28 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.28 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i64 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i64 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i64 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc6_9: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] -// CHECK:STDOUT: %.loc6_13.1: Core.IntLiteral = int_value 64 [template = constants.%.1] -// CHECK:STDOUT: %.loc6_13.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_13.3: = bound_method %.loc6_13.1, %.loc6_13.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc6_13: init i32 = call %.loc6_13.3(%.loc6_13.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc6_13.4: i32 = value_of_initializer %int.convert_checked.loc6_13 [template = constants.%.27] -// CHECK:STDOUT: %.loc6_13.5: i32 = converted %.loc6_13.1, %.loc6_13.4 [template = constants.%.27] -// CHECK:STDOUT: %int.make_type_signed.loc6_12: init type = call %Int.ref.loc6_9(%.loc6_13.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc6_15.1: type = value_of_initializer %int.make_type_signed.loc6_12 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_15.2: type = converted %int.make_type_signed.loc6_12, %.loc6_15.1 [template = constants.%.28] -// CHECK:STDOUT: %Int.ref.loc6_21: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] -// CHECK:STDOUT: %.loc6_25.1: Core.IntLiteral = int_value 64 [template = constants.%.1] -// CHECK:STDOUT: %.loc6_25.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_25.3: = bound_method %.loc6_25.1, %.loc6_25.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc6_25: init i32 = call %.loc6_25.3(%.loc6_25.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc6_25.4: i32 = value_of_initializer %int.convert_checked.loc6_25 [template = constants.%.27] -// CHECK:STDOUT: %.loc6_25.5: i32 = converted %.loc6_25.1, %.loc6_25.4 [template = constants.%.27] -// CHECK:STDOUT: %int.make_type_signed.loc6_24: init type = call %Int.ref.loc6_21(%.loc6_25.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc6_27.1: type = value_of_initializer %int.make_type_signed.loc6_24 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_27.2: type = converted %int.make_type_signed.loc6_24, %.loc6_27.1 [template = constants.%.28] -// CHECK:STDOUT: %n.param: %.28 = value_param runtime_param0 -// CHECK:STDOUT: %n: %.28 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %.28 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.28 = return_slot %return.param +// CHECK:STDOUT: %Int.ref.loc6_9: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %.loc6_13: Core.IntLiteral = int_value 64 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_12: init type = call %Int.ref.loc6_9(%.loc6_13) [template = constants.%i64] +// CHECK:STDOUT: %.loc6_15.1: type = value_of_initializer %int.make_type_signed.loc6_12 [template = constants.%i64] +// CHECK:STDOUT: %.loc6_15.2: type = converted %int.make_type_signed.loc6_12, %.loc6_15.1 [template = constants.%i64] +// CHECK:STDOUT: %Int.ref.loc6_21: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %.loc6_25: Core.IntLiteral = int_value 64 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_24: init type = call %Int.ref.loc6_21(%.loc6_25) [template = constants.%i64] +// CHECK:STDOUT: %.loc6_27.1: type = value_of_initializer %int.make_type_signed.loc6_24 [template = constants.%i64] +// CHECK:STDOUT: %.loc6_27.2: type = converted %int.make_type_signed.loc6_24, %.loc6_27.1 [template = constants.%i64] +// CHECK:STDOUT: %n.param: %i64 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i64 = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %i64 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i64 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %n.patt: %.32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %.32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i13 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i13 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i13 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i13 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc10_9: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] -// CHECK:STDOUT: %.loc10_13.1: Core.IntLiteral = int_value 13 [template = constants.%.29] -// CHECK:STDOUT: %.loc10_13.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_13.3: = bound_method %.loc10_13.1, %.loc10_13.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc10_13: init i32 = call %.loc10_13.3(%.loc10_13.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc10_13.4: i32 = value_of_initializer %int.convert_checked.loc10_13 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_13.5: i32 = converted %.loc10_13.1, %.loc10_13.4 [template = constants.%.31] -// CHECK:STDOUT: %int.make_type_signed.loc10_12: init type = call %Int.ref.loc10_9(%.loc10_13.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc10_15.1: type = value_of_initializer %int.make_type_signed.loc10_12 [template = constants.%.32] -// CHECK:STDOUT: %.loc10_15.2: type = converted %int.make_type_signed.loc10_12, %.loc10_15.1 [template = constants.%.32] -// CHECK:STDOUT: %Int.ref.loc10_21: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] -// CHECK:STDOUT: %.loc10_25.1: Core.IntLiteral = int_value 13 [template = constants.%.29] -// CHECK:STDOUT: %.loc10_25.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_25.3: = bound_method %.loc10_25.1, %.loc10_25.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc10_25: init i32 = call %.loc10_25.3(%.loc10_25.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc10_25.4: i32 = value_of_initializer %int.convert_checked.loc10_25 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_25.5: i32 = converted %.loc10_25.1, %.loc10_25.4 [template = constants.%.31] -// CHECK:STDOUT: %int.make_type_signed.loc10_24: init type = call %Int.ref.loc10_21(%.loc10_25.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc10_27.1: type = value_of_initializer %int.make_type_signed.loc10_24 [template = constants.%.32] -// CHECK:STDOUT: %.loc10_27.2: type = converted %int.make_type_signed.loc10_24, %.loc10_27.1 [template = constants.%.32] -// CHECK:STDOUT: %n.param: %.32 = value_param runtime_param0 -// CHECK:STDOUT: %n: %.32 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %.32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.32 = return_slot %return.param +// CHECK:STDOUT: %Int.ref.loc10_9: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %.loc10_13: Core.IntLiteral = int_value 13 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc10_12: init type = call %Int.ref.loc10_9(%.loc10_13) [template = constants.%i13] +// CHECK:STDOUT: %.loc10_15.1: type = value_of_initializer %int.make_type_signed.loc10_12 [template = constants.%i13] +// CHECK:STDOUT: %.loc10_15.2: type = converted %int.make_type_signed.loc10_12, %.loc10_15.1 [template = constants.%i13] +// CHECK:STDOUT: %Int.ref.loc10_21: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %.loc10_25: Core.IntLiteral = int_value 13 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc10_24: init type = call %Int.ref.loc10_21(%.loc10_25) [template = constants.%i13] +// CHECK:STDOUT: %.loc10_27.1: type = value_of_initializer %int.make_type_signed.loc10_24 [template = constants.%i13] +// CHECK:STDOUT: %.loc10_27.2: type = converted %int.make_type_signed.loc10_24, %.loc10_27.1 [template = constants.%i13] +// CHECK:STDOUT: %n.param: %i13 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i13 = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %i13 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i13 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Symbolic.decl: %Symbolic.type = fn_decl @Symbolic [template = constants.%Symbolic] { -// CHECK:STDOUT: %N.patt.loc14_13.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt.2)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc14_13.1, runtime_param [symbolic = %N.patt.loc14_13.2 (constants.%N.patt.2)] -// CHECK:STDOUT: %x.patt: @Symbolic.%.loc14_28 (%.33) = binding_pattern x -// CHECK:STDOUT: %x.param_patt: @Symbolic.%.loc14_28 (%.33) = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: @Symbolic.%.loc14_28 (%.33) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Symbolic.%.loc14_28 (%.33) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %N.patt.loc14_13.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc14_13.1, runtime_param [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] +// CHECK:STDOUT: %x.patt: @Symbolic.%iN (%iN) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @Symbolic.%iN (%iN) = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @Symbolic.%iN (%iN) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Symbolic.%iN (%iN) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_17.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_17.2: type = converted %int.make_type_32, %.loc14_17.1 [template = i32] -// CHECK:STDOUT: %Int.ref.loc14_25: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] -// CHECK:STDOUT: %N.ref.loc14_29: i32 = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N.2)] -// CHECK:STDOUT: %int.make_type_signed.loc14_28: init type = call %Int.ref.loc14_25(%N.ref.loc14_29) [symbolic = %.loc14_28 (constants.%.33)] -// CHECK:STDOUT: %.loc14_30.1: type = value_of_initializer %int.make_type_signed.loc14_28 [symbolic = %.loc14_28 (constants.%.33)] -// CHECK:STDOUT: %.loc14_30.2: type = converted %int.make_type_signed.loc14_28, %.loc14_30.1 [symbolic = %.loc14_28 (constants.%.33)] -// CHECK:STDOUT: %Int.ref.loc14_36: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] -// CHECK:STDOUT: %N.ref.loc14_40: i32 = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N.2)] -// CHECK:STDOUT: %int.make_type_signed.loc14_39: init type = call %Int.ref.loc14_36(%N.ref.loc14_40) [symbolic = %.loc14_28 (constants.%.33)] -// CHECK:STDOUT: %.loc14_41.1: type = value_of_initializer %int.make_type_signed.loc14_39 [symbolic = %.loc14_28 (constants.%.33)] -// CHECK:STDOUT: %.loc14_41.2: type = converted %int.make_type_signed.loc14_39, %.loc14_41.1 [symbolic = %.loc14_28 (constants.%.33)] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc14_13.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_13.2 (constants.%N.2)] -// CHECK:STDOUT: %x.param: @Symbolic.%.loc14_28 (%.33) = value_param runtime_param0 -// CHECK:STDOUT: %x: @Symbolic.%.loc14_28 (%.33) = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref @Symbolic.%.loc14_28 (%.33) = out_param runtime_param1 -// CHECK:STDOUT: %return: ref @Symbolic.%.loc14_28 (%.33) = return_slot %return.param +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc14_28.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc14_28.2: type = converted %int_literal.make_type, %.loc14_28.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %Int.ref.loc14_34: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %N.ref.loc14_38: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] +// CHECK:STDOUT: %int.make_type_signed.loc14_37: init type = call %Int.ref.loc14_34(%N.ref.loc14_38) [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %.loc14_39.1: type = value_of_initializer %int.make_type_signed.loc14_37 [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %.loc14_39.2: type = converted %int.make_type_signed.loc14_37, %.loc14_39.1 [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %Int.ref.loc14_45: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %N.ref.loc14_49: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] +// CHECK:STDOUT: %int.make_type_signed.loc14_48: init type = call %Int.ref.loc14_45(%N.ref.loc14_49) [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %.loc14_50.1: type = value_of_initializer %int.make_type_signed.loc14_48 [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %.loc14_50.2: type = converted %int.make_type_signed.loc14_48, %.loc14_50.1 [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param +// CHECK:STDOUT: %N.loc14_13.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_13.2 (constants.%N)] +// CHECK:STDOUT: %x.param: @Symbolic.%iN (%iN) = value_param runtime_param0 +// CHECK:STDOUT: %x: @Symbolic.%iN (%iN) = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref @Symbolic.%iN (%iN) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @Symbolic.%iN (%iN) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n.param_patt: i32) -> type = "int.make_type_signed"; +// CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n.param_patt: %.28) -> %.28 { +// CHECK:STDOUT: fn @F(%n.param_patt: %i64) -> %i64 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: %.28 = name_ref n, %n +// CHECK:STDOUT: %n.ref: %i64 = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%n.param_patt: %.32) -> %.32 { +// CHECK:STDOUT: fn @G(%n.param_patt: %i13) -> %i13 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: %.32 = name_ref n, %n +// CHECK:STDOUT: %n.ref: %i13 = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Symbolic(%N.loc14_13.1: i32) { -// CHECK:STDOUT: %N.loc14_13.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc14_13.2 (constants.%N.2)] -// CHECK:STDOUT: %N.patt.loc14_13.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt.2)] -// CHECK:STDOUT: %.loc14_28: type = int_type signed, %N.loc14_13.2 [symbolic = %.loc14_28 (constants.%.33)] +// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Symbolic(%N.loc14_13.1: Core.IntLiteral) { +// CHECK:STDOUT: %N.loc14_13.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc14_13.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc14_13.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N.loc14_13.2 [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%N.param_patt: i32, %x.param_patt: @Symbolic.%.loc14_28 (%.33)) -> @Symbolic.%.loc14_28 (%.33) { +// CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral, %x.param_patt: @Symbolic.%iN (%iN)) -> @Symbolic.%iN (%iN) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.ref: @Symbolic.%.loc14_28 (%.33) = name_ref x, %x +// CHECK:STDOUT: %x.ref: @Symbolic.%iN (%iN) = name_ref x, %x // CHECK:STDOUT: return %x.ref // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Symbolic(constants.%N.2) { -// CHECK:STDOUT: %N.loc14_13.2 => constants.%N.2 -// CHECK:STDOUT: %N.patt.loc14_13.2 => constants.%N.2 -// CHECK:STDOUT: %.loc14_28 => constants.%.33 +// CHECK:STDOUT: specific @Symbolic(constants.%N) { +// CHECK:STDOUT: %N.loc14_13.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc14_13.2 => constants.%N +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_types.carbon @@ -311,46 +297,36 @@ var m: Int(1000000000); // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 64 [template] -// CHECK:STDOUT: %.28: type = int_type signed, %.27 [template] +// CHECK:STDOUT: %i64: type = int_type signed, %.1 [template] // CHECK:STDOUT: %UseF.type: type = fn_type @UseF [template] // CHECK:STDOUT: %UseF: %UseF.type = struct_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 13 [template] -// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 13 [template] -// CHECK:STDOUT: %.32: type = int_type signed, %.31 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 13 [template] +// CHECK:STDOUT: %i13: type = int_type signed, %.2 [template] // CHECK:STDOUT: %UseG.type: type = fn_type @UseG [template] // CHECK:STDOUT: %UseG: %UseG.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.33: Core.IntLiteral = int_value 24 [template] -// CHECK:STDOUT: %.34: = bound_method %.33, %Convert.15 [template] -// CHECK:STDOUT: %.35: i32 = int_value 24 [template] -// CHECK:STDOUT: %.36: type = int_type signed, %.35 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 24 [template] +// CHECK:STDOUT: %i24: type = int_type signed, %.3 [template] // CHECK:STDOUT: %UseSymbolic.type: type = fn_type @UseSymbolic [template] // CHECK:STDOUT: %UseSymbolic: %UseSymbolic.type = struct_value () [template] // CHECK:STDOUT: %Symbolic.type: type = fn_type @Symbolic [template] // CHECK:STDOUT: %Symbolic: %Symbolic.type = struct_value () [template] -// CHECK:STDOUT: %N.2: i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %.37: type = int_type signed, %N.2 [symbolic] -// CHECK:STDOUT: %N.patt.2: i32 = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %.38: = specific_function %Symbolic, @Symbolic(%.35) [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %.4: = specific_function %Symbolic, @Symbolic(%.3) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Main//types, inst+22, loaded [template = constants.%Int] -// CHECK:STDOUT: %import_ref.2: %F.type = import_ref Main//use_types, inst+405, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.3: %G.type = import_ref Main//use_types, inst+442, loaded [template = constants.%G] -// CHECK:STDOUT: %import_ref.4: %Symbolic.type = import_ref Main//use_types, inst+482, loaded [template = constants.%Symbolic] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Main//types, inst+23, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Main//use_types, inst+37, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.4: %G.type = import_ref Main//use_types, inst+62, loaded [template = constants.%G] +// CHECK:STDOUT: %import_ref.5: %Symbolic.type = import_ref Main//use_types, inst+102, loaded [template = constants.%Symbolic] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -358,10 +334,11 @@ var m: Int(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int = imports.%import_ref.1 -// CHECK:STDOUT: .F = imports.%import_ref.2 -// CHECK:STDOUT: .G = imports.%import_ref.3 -// CHECK:STDOUT: .Symbolic = imports.%import_ref.4 +// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 +// CHECK:STDOUT: .Int = imports.%import_ref.2 +// CHECK:STDOUT: .F = imports.%import_ref.3 +// CHECK:STDOUT: .G = imports.%import_ref.4 +// CHECK:STDOUT: .Symbolic = imports.%import_ref.5 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .UseF = %UseF.decl // CHECK:STDOUT: .UseG = %UseG.decl @@ -370,163 +347,128 @@ var m: Int(1000000000); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %UseF.decl: %UseF.type = fn_decl @UseF [template = constants.%UseF] { -// CHECK:STDOUT: %n.patt: %.28 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %.28 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.28 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.28 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i64 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i64 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i64 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc7_12: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] -// CHECK:STDOUT: %.loc7_16.1: Core.IntLiteral = int_value 64 [template = constants.%.1] -// CHECK:STDOUT: %.loc7_16.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_16.3: = bound_method %.loc7_16.1, %.loc7_16.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc7_16: init i32 = call %.loc7_16.3(%.loc7_16.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc7_16.4: i32 = value_of_initializer %int.convert_checked.loc7_16 [template = constants.%.27] -// CHECK:STDOUT: %.loc7_16.5: i32 = converted %.loc7_16.1, %.loc7_16.4 [template = constants.%.27] -// CHECK:STDOUT: %int.make_type_signed.loc7_15: init type = call %Int.ref.loc7_12(%.loc7_16.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc7_18.1: type = value_of_initializer %int.make_type_signed.loc7_15 [template = constants.%.28] -// CHECK:STDOUT: %.loc7_18.2: type = converted %int.make_type_signed.loc7_15, %.loc7_18.1 [template = constants.%.28] -// CHECK:STDOUT: %Int.ref.loc7_24: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] -// CHECK:STDOUT: %.loc7_28.1: Core.IntLiteral = int_value 64 [template = constants.%.1] -// CHECK:STDOUT: %.loc7_28.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_28.3: = bound_method %.loc7_28.1, %.loc7_28.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc7_28: init i32 = call %.loc7_28.3(%.loc7_28.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc7_28.4: i32 = value_of_initializer %int.convert_checked.loc7_28 [template = constants.%.27] -// CHECK:STDOUT: %.loc7_28.5: i32 = converted %.loc7_28.1, %.loc7_28.4 [template = constants.%.27] -// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call %Int.ref.loc7_24(%.loc7_28.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc7_30.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%.28] -// CHECK:STDOUT: %.loc7_30.2: type = converted %int.make_type_signed.loc7_27, %.loc7_30.1 [template = constants.%.28] -// CHECK:STDOUT: %n.param: %.28 = value_param runtime_param0 -// CHECK:STDOUT: %n: %.28 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %.28 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.28 = return_slot %return.param +// CHECK:STDOUT: %Int.ref.loc7_12: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %.loc7_16: Core.IntLiteral = int_value 64 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_15: init type = call %Int.ref.loc7_12(%.loc7_16) [template = constants.%i64] +// CHECK:STDOUT: %.loc7_18.1: type = value_of_initializer %int.make_type_signed.loc7_15 [template = constants.%i64] +// CHECK:STDOUT: %.loc7_18.2: type = converted %int.make_type_signed.loc7_15, %.loc7_18.1 [template = constants.%i64] +// CHECK:STDOUT: %Int.ref.loc7_24: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %.loc7_28: Core.IntLiteral = int_value 64 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call %Int.ref.loc7_24(%.loc7_28) [template = constants.%i64] +// CHECK:STDOUT: %.loc7_30.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i64] +// CHECK:STDOUT: %.loc7_30.2: type = converted %int.make_type_signed.loc7_27, %.loc7_30.1 [template = constants.%i64] +// CHECK:STDOUT: %n.param: %i64 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i64 = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %i64 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i64 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %UseG.decl: %UseG.type = fn_decl @UseG [template = constants.%UseG] { -// CHECK:STDOUT: %n.patt: %.32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %.32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i13 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i13 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i13 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i13 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc11_12: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] -// CHECK:STDOUT: %.loc11_16.1: Core.IntLiteral = int_value 13 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_16.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_16.3: = bound_method %.loc11_16.1, %.loc11_16.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_16: init i32 = call %.loc11_16.3(%.loc11_16.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_16.4: i32 = value_of_initializer %int.convert_checked.loc11_16 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_16.5: i32 = converted %.loc11_16.1, %.loc11_16.4 [template = constants.%.31] -// CHECK:STDOUT: %int.make_type_signed.loc11_15: init type = call %Int.ref.loc11_12(%.loc11_16.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %int.make_type_signed.loc11_15 [template = constants.%.32] -// CHECK:STDOUT: %.loc11_18.2: type = converted %int.make_type_signed.loc11_15, %.loc11_18.1 [template = constants.%.32] -// CHECK:STDOUT: %Int.ref.loc11_24: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] -// CHECK:STDOUT: %.loc11_28.1: Core.IntLiteral = int_value 13 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_28.3: = bound_method %.loc11_28.1, %.loc11_28.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_28: init i32 = call %.loc11_28.3(%.loc11_28.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_28.4: i32 = value_of_initializer %int.convert_checked.loc11_28 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_28.5: i32 = converted %.loc11_28.1, %.loc11_28.4 [template = constants.%.31] -// CHECK:STDOUT: %int.make_type_signed.loc11_27: init type = call %Int.ref.loc11_24(%.loc11_28.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc11_30.1: type = value_of_initializer %int.make_type_signed.loc11_27 [template = constants.%.32] -// CHECK:STDOUT: %.loc11_30.2: type = converted %int.make_type_signed.loc11_27, %.loc11_30.1 [template = constants.%.32] -// CHECK:STDOUT: %n.param: %.32 = value_param runtime_param0 -// CHECK:STDOUT: %n: %.32 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %.32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.32 = return_slot %return.param +// CHECK:STDOUT: %Int.ref.loc11_12: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %.loc11_16: Core.IntLiteral = int_value 13 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc11_15: init type = call %Int.ref.loc11_12(%.loc11_16) [template = constants.%i13] +// CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %int.make_type_signed.loc11_15 [template = constants.%i13] +// CHECK:STDOUT: %.loc11_18.2: type = converted %int.make_type_signed.loc11_15, %.loc11_18.1 [template = constants.%i13] +// CHECK:STDOUT: %Int.ref.loc11_24: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %.loc11_28: Core.IntLiteral = int_value 13 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc11_27: init type = call %Int.ref.loc11_24(%.loc11_28) [template = constants.%i13] +// CHECK:STDOUT: %.loc11_30.1: type = value_of_initializer %int.make_type_signed.loc11_27 [template = constants.%i13] +// CHECK:STDOUT: %.loc11_30.2: type = converted %int.make_type_signed.loc11_27, %.loc11_30.1 [template = constants.%i13] +// CHECK:STDOUT: %n.param: %i13 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i13 = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %i13 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i13 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %UseSymbolic.decl: %UseSymbolic.type = fn_decl @UseSymbolic [template = constants.%UseSymbolic] { -// CHECK:STDOUT: %n.patt: %.36 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %.36 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.36 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.36 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i24 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i24 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i24 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i24 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc15_19: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] -// CHECK:STDOUT: %.loc15_23.1: Core.IntLiteral = int_value 24 [template = constants.%.33] -// CHECK:STDOUT: %.loc15_23.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_23.3: = bound_method %.loc15_23.1, %.loc15_23.2 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc15_23: init i32 = call %.loc15_23.3(%.loc15_23.1) [template = constants.%.35] -// CHECK:STDOUT: %.loc15_23.4: i32 = value_of_initializer %int.convert_checked.loc15_23 [template = constants.%.35] -// CHECK:STDOUT: %.loc15_23.5: i32 = converted %.loc15_23.1, %.loc15_23.4 [template = constants.%.35] -// CHECK:STDOUT: %int.make_type_signed.loc15_22: init type = call %Int.ref.loc15_19(%.loc15_23.5) [template = constants.%.36] -// CHECK:STDOUT: %.loc15_25.1: type = value_of_initializer %int.make_type_signed.loc15_22 [template = constants.%.36] -// CHECK:STDOUT: %.loc15_25.2: type = converted %int.make_type_signed.loc15_22, %.loc15_25.1 [template = constants.%.36] -// CHECK:STDOUT: %Int.ref.loc15_31: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] -// CHECK:STDOUT: %.loc15_35.1: Core.IntLiteral = int_value 24 [template = constants.%.33] -// CHECK:STDOUT: %.loc15_35.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_35.3: = bound_method %.loc15_35.1, %.loc15_35.2 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc15_35: init i32 = call %.loc15_35.3(%.loc15_35.1) [template = constants.%.35] -// CHECK:STDOUT: %.loc15_35.4: i32 = value_of_initializer %int.convert_checked.loc15_35 [template = constants.%.35] -// CHECK:STDOUT: %.loc15_35.5: i32 = converted %.loc15_35.1, %.loc15_35.4 [template = constants.%.35] -// CHECK:STDOUT: %int.make_type_signed.loc15_34: init type = call %Int.ref.loc15_31(%.loc15_35.5) [template = constants.%.36] -// CHECK:STDOUT: %.loc15_37.1: type = value_of_initializer %int.make_type_signed.loc15_34 [template = constants.%.36] -// CHECK:STDOUT: %.loc15_37.2: type = converted %int.make_type_signed.loc15_34, %.loc15_37.1 [template = constants.%.36] -// CHECK:STDOUT: %n.param: %.36 = value_param runtime_param0 -// CHECK:STDOUT: %n: %.36 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %.36 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.36 = return_slot %return.param +// CHECK:STDOUT: %Int.ref.loc15_19: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %.loc15_23: Core.IntLiteral = int_value 24 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc15_22: init type = call %Int.ref.loc15_19(%.loc15_23) [template = constants.%i24] +// CHECK:STDOUT: %.loc15_25.1: type = value_of_initializer %int.make_type_signed.loc15_22 [template = constants.%i24] +// CHECK:STDOUT: %.loc15_25.2: type = converted %int.make_type_signed.loc15_22, %.loc15_25.1 [template = constants.%i24] +// CHECK:STDOUT: %Int.ref.loc15_31: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %.loc15_35: Core.IntLiteral = int_value 24 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc15_34: init type = call %Int.ref.loc15_31(%.loc15_35) [template = constants.%i24] +// CHECK:STDOUT: %.loc15_37.1: type = value_of_initializer %int.make_type_signed.loc15_34 [template = constants.%i24] +// CHECK:STDOUT: %.loc15_37.2: type = converted %int.make_type_signed.loc15_34, %.loc15_37.1 [template = constants.%i24] +// CHECK:STDOUT: %n.param: %i24 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i24 = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %i24 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i24 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n.param_patt: i32) -> type = "int.make_type_signed"; +// CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @UseF(%n.param_patt: %.28) -> %.28 { +// CHECK:STDOUT: fn @UseF(%n.param_patt: %i64) -> %i64 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.2 [template = constants.%F] -// CHECK:STDOUT: %n.ref: %.28 = name_ref n, %n -// CHECK:STDOUT: %F.call: init %.28 = call %F.ref(%n.ref) -// CHECK:STDOUT: %.loc8_14.1: %.28 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc8_14.2: %.28 = converted %F.call, %.loc8_14.1 +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.3 [template = constants.%F] +// CHECK:STDOUT: %n.ref: %i64 = name_ref n, %n +// CHECK:STDOUT: %F.call: init %i64 = call %F.ref(%n.ref) +// CHECK:STDOUT: %.loc8_14.1: %i64 = value_of_initializer %F.call +// CHECK:STDOUT: %.loc8_14.2: %i64 = converted %F.call, %.loc8_14.1 // CHECK:STDOUT: return %.loc8_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n.param_patt: %.28) -> %.28; +// CHECK:STDOUT: fn @F(%n.param_patt: %i64) -> %i64; // CHECK:STDOUT: -// CHECK:STDOUT: fn @UseG(%n.param_patt: %.32) -> %.32 { +// CHECK:STDOUT: fn @UseG(%n.param_patt: %i13) -> %i13 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %G.ref: %G.type = name_ref G, imports.%import_ref.3 [template = constants.%G] -// CHECK:STDOUT: %n.ref: %.32 = name_ref n, %n -// CHECK:STDOUT: %G.call: init %.32 = call %G.ref(%n.ref) -// CHECK:STDOUT: %.loc12_14.1: %.32 = value_of_initializer %G.call -// CHECK:STDOUT: %.loc12_14.2: %.32 = converted %G.call, %.loc12_14.1 +// CHECK:STDOUT: %G.ref: %G.type = name_ref G, imports.%import_ref.4 [template = constants.%G] +// CHECK:STDOUT: %n.ref: %i13 = name_ref n, %n +// CHECK:STDOUT: %G.call: init %i13 = call %G.ref(%n.ref) +// CHECK:STDOUT: %.loc12_14.1: %i13 = value_of_initializer %G.call +// CHECK:STDOUT: %.loc12_14.2: %i13 = converted %G.call, %.loc12_14.1 // CHECK:STDOUT: return %.loc12_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%n.param_patt: %.32) -> %.32; +// CHECK:STDOUT: fn @G(%n.param_patt: %i13) -> %i13; // CHECK:STDOUT: -// CHECK:STDOUT: fn @UseSymbolic(%n.param_patt: %.36) -> %.36 { +// CHECK:STDOUT: fn @UseSymbolic(%n.param_patt: %i24) -> %i24 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Symbolic.ref: %Symbolic.type = name_ref Symbolic, imports.%import_ref.4 [template = constants.%Symbolic] -// CHECK:STDOUT: %.loc16_19: Core.IntLiteral = int_value 24 [template = constants.%.33] -// CHECK:STDOUT: %n.ref: %.36 = name_ref n, %n -// CHECK:STDOUT: %.loc16_18.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_18.2: = bound_method %.loc16_19, %.loc16_18.1 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc16: init i32 = call %.loc16_18.2(%.loc16_19) [template = constants.%.35] -// CHECK:STDOUT: %.loc16_18.3: i32 = value_of_initializer %int.convert_checked.loc16 [template = constants.%.35] -// CHECK:STDOUT: %.loc16_18.4: i32 = converted %.loc16_19, %.loc16_18.3 [template = constants.%.35] -// CHECK:STDOUT: %.loc16_10: = specific_function %Symbolic.ref, @Symbolic(constants.%.35) [template = constants.%.38] -// CHECK:STDOUT: %Symbolic.call: init %.36 = call %.loc16_10(%n.ref) -// CHECK:STDOUT: %.loc16_25.1: %.36 = value_of_initializer %Symbolic.call -// CHECK:STDOUT: %.loc16_25.2: %.36 = converted %Symbolic.call, %.loc16_25.1 +// CHECK:STDOUT: %Symbolic.ref: %Symbolic.type = name_ref Symbolic, imports.%import_ref.5 [template = constants.%Symbolic] +// CHECK:STDOUT: %.loc16_19: Core.IntLiteral = int_value 24 [template = constants.%.3] +// CHECK:STDOUT: %n.ref: %i24 = name_ref n, %n +// CHECK:STDOUT: %.loc16_10: = specific_function %Symbolic.ref, @Symbolic(constants.%.3) [template = constants.%.4] +// CHECK:STDOUT: %Symbolic.call: init %i24 = call %.loc16_10(%n.ref) +// CHECK:STDOUT: %.loc16_25.1: %i24 = value_of_initializer %Symbolic.call +// CHECK:STDOUT: %.loc16_25.2: %i24 = converted %Symbolic.call, %.loc16_25.1 // CHECK:STDOUT: return %.loc16_25.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Symbolic(constants.%N.2: i32) { -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.37)] +// CHECK:STDOUT: generic fn @Symbolic(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%N.param_patt: i32, %x.param_patt: @Symbolic.%.1 (%.37)) -> @Symbolic.%.1 (%.37); +// CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral, %x.param_patt: @Symbolic.%iN (%iN)) -> @Symbolic.%iN (%iN); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Symbolic(constants.%N.2) { -// CHECK:STDOUT: %N => constants.%N.2 -// CHECK:STDOUT: %N.patt => constants.%N.2 -// CHECK:STDOUT: %.1 => constants.%.37 +// CHECK:STDOUT: specific @Symbolic(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Symbolic(constants.%.35) { -// CHECK:STDOUT: %N => constants.%.35 -// CHECK:STDOUT: %N.patt => constants.%.35 -// CHECK:STDOUT: %.1 => constants.%.36 +// CHECK:STDOUT: specific @Symbolic(constants.%.3) { +// CHECK:STDOUT: %N => constants.%.3 +// CHECK:STDOUT: %N.patt => constants.%.3 +// CHECK:STDOUT: %iN => constants.%i24 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -537,18 +479,12 @@ var m: Int(1000000000); // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Main//types, inst+22, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Main//types, inst+23, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -556,52 +492,59 @@ var m: Int(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int = imports.%import_ref.1 +// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 +// CHECK:STDOUT: .Int = imports.%import_ref.2 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] -// CHECK:STDOUT: %.loc10_12.1: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc10_12.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_12.3: = bound_method %.loc10_12.1, %.loc10_12.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc10_12.3(%.loc10_12.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc10_12.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc10_12.5: i32 = converted %.loc10_12.1, %.loc10_12.4 [template = constants.%.27] -// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc10_12.5) [template = ] +// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %.loc10_12: Core.IntLiteral = int_value 0 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc10_12) [template = ] // CHECK:STDOUT: %.loc10_13.1: type = value_of_initializer %int.make_type_signed [template = ] // CHECK:STDOUT: %.loc10_13.2: type = converted %int.make_type_signed, %.loc10_13.1 [template = ] // CHECK:STDOUT: %n.var: ref = var n // CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n.param_patt: i32) -> type = "int.make_type_signed"; +// CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_negative_size.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type.1: type = fn_type @Int.1 [template] +// CHECK:STDOUT: %Int.1: %Int.type.1 = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %Int.type.2: type = fn_type @Int.2 [template] +// CHECK:STDOUT: %Int.2: %Int.type.2 = struct_value () [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.26: %i32 = int_value -1 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] -// CHECK:STDOUT: %.28: i32 = int_value -1 [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.26, %Convert.15 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.4(%.1) [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value -1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Main//types, inst+22, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: %Int.type.2 = import_ref Main//types, inst+23, loaded [template = constants.%Int.2] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .Int = %import_ref.3 +// CHECK:STDOUT: .ImplicitAs = %import_ref.4 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -609,7 +552,8 @@ var m: Int(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int = imports.%import_ref.1 +// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 +// CHECK:STDOUT: .Int = imports.%import_ref.2 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Negate = %Negate.decl // CHECK:STDOUT: .n = %n @@ -617,43 +561,52 @@ var m: Int(1000000000); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] -// CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_32.loc6_14, %.loc6_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc6_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_32.loc6_22 [template = i32] -// CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc6_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_14: init type = call constants.%Int.1(%.loc6_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_signed.loc6_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_signed.loc6_14, %.loc6_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_22: init type = call constants.%Int.1(%.loc6_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.2: type = value_of_initializer %int.make_type_signed.loc6_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.3: type = converted %int.make_type_signed.loc6_22, %.loc6_22.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] +// CHECK:STDOUT: %Int.ref: %Int.type.2 = name_ref Int, imports.%import_ref.2 [template = constants.%Int.2] // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_19.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_19.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_19.3: = bound_method %.loc12_19.1, %.loc12_19.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_19.3(%.loc12_19.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_19.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc12_19.5: i32 = converted %.loc12_19.1, %.loc12_19.4 [template = constants.%.27] -// CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc12_19.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc12_18.1: i32 = value_of_initializer %int.snegate [template = constants.%.28] -// CHECK:STDOUT: %.loc12_18.2: i32 = converted %int.snegate, %.loc12_18.1 [template = constants.%.28] -// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc12_18.2) [template = ] +// CHECK:STDOUT: %.loc12_19.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_19.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_19.3: = bound_method %.loc12_19.1, %.loc12_19.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_19.4: = specific_function %.loc12_19.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc12_19: init %i32 = call %.loc12_19.4(%.loc12_19.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_19.5: %i32 = value_of_initializer %int.convert_checked.loc12_19 [template = constants.%.25] +// CHECK:STDOUT: %.loc12_19.6: %i32 = converted %.loc12_19.1, %.loc12_19.5 [template = constants.%.25] +// CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc12_19.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc12_18.1: %Convert.type.6 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc12_18.2: = bound_method %int.snegate, %.loc12_18.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc12_18.3: = specific_function %.loc12_18.2, @Convert.4(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc12_18.4: %i32 = value_of_initializer %int.snegate [template = constants.%.26] +// CHECK:STDOUT: %.loc12_18.5: %i32 = converted %int.snegate, %.loc12_18.4 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc12_18: init Core.IntLiteral = call %.loc12_18.3(%.loc12_18.5) [template = constants.%.30] +// CHECK:STDOUT: %.loc12_18.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc12_18 [template = constants.%.30] +// CHECK:STDOUT: %.loc12_18.7: Core.IntLiteral = converted %int.snegate, %.loc12_18.6 [template = constants.%.30] +// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc12_18.7) [template = ] // CHECK:STDOUT: %.loc12_21.1: type = value_of_initializer %int.make_type_signed [template = ] // CHECK:STDOUT: %.loc12_21.2: type = converted %int.make_type_signed, %.loc12_21.1 [template = ] // CHECK:STDOUT: %n.var: ref = var n // CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%n.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%n.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n.param_patt: i32) -> type = "int.make_type_signed"; +// CHECK:STDOUT: fn @Int.2(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_oversized.carbon // CHECK:STDOUT: @@ -661,18 +614,12 @@ var m: Int(1000000000); // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1000000000 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1000000000 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Main//types, inst+22, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Main//types, inst+23, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -680,25 +627,21 @@ var m: Int(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int = imports.%import_ref.1 +// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 +// CHECK:STDOUT: .Int = imports.%import_ref.2 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .m = %m // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] -// CHECK:STDOUT: %.loc9_12.1: Core.IntLiteral = int_value 1000000000 [template = constants.%.1] -// CHECK:STDOUT: %.loc9_12.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_12.3: = bound_method %.loc9_12.1, %.loc9_12.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc9_12.3(%.loc9_12.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc9_12.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc9_12.5: i32 = converted %.loc9_12.1, %.loc9_12.4 [template = constants.%.27] -// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc9_12.5) [template = ] +// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %.loc9_12: Core.IntLiteral = int_value 1000000000 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc9_12) [template = ] // CHECK:STDOUT: %.loc9_22.1: type = value_of_initializer %int.make_type_signed [template = ] // CHECK:STDOUT: %.loc9_22.2: type = converted %int.make_type_signed, %.loc9_22.1 [template = ] // CHECK:STDOUT: %m.var: ref = var m // CHECK:STDOUT: %m: ref = bind_name m, %m.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n.param_patt: i32) -> type = "int.make_type_signed"; +// CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon index 7cb91131c4ff..6064066bfac6 100644 --- a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon @@ -12,7 +12,8 @@ library "[[@TEST_NAME]]"; -fn UInt(n: i32) -> type = "int.make_type_unsigned"; +fn IntLiteral() -> type = "int_literal.make_type"; +fn UInt(n: IntLiteral()) -> type = "int.make_type_unsigned"; // --- use_types.carbon @@ -28,7 +29,7 @@ fn G(n: UInt(13)) -> UInt(13) { return n; } -fn Symbolic(N:! i32, x: UInt(N)) -> UInt(N) { +fn Symbolic(N:! IntLiteral(), x: UInt(N)) -> UInt(N) { return x; } @@ -72,15 +73,14 @@ var m: UInt(1000000000); // CHECK:STDOUT: --- types.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] +// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -89,26 +89,37 @@ var m: UInt(1000000000); // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .IntLiteral = %IntLiteral.decl // CHECK:STDOUT: .UInt = %UInt.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] { +// CHECK:STDOUT: %return.patt: type = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 +// CHECK:STDOUT: %return: ref type = return_slot %return.param +// CHECK:STDOUT: } // CHECK:STDOUT: %UInt.decl: %UInt.type = fn_decl @UInt [template = constants.%UInt] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %n.patt: Core.IntLiteral = binding_pattern n +// CHECK:STDOUT: %n.param_patt: Core.IntLiteral = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_12.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_12.2: type = converted %int.make_type_32, %.loc4_12.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_23.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_23.2: type = converted %int_literal.make_type, %.loc5_23.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %n.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %n: Core.IntLiteral = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @UInt(%n.param_patt: i32) -> type = "int.make_type_unsigned"; +// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @UInt(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_unsigned"; // CHECK:STDOUT: // CHECK:STDOUT: --- use_types.carbon // CHECK:STDOUT: @@ -116,35 +127,26 @@ var m: UInt(1000000000); // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 64 [template] -// CHECK:STDOUT: %.28: type = int_type unsigned, %.27 [template] +// CHECK:STDOUT: %u64: type = int_type unsigned, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 13 [template] -// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 13 [template] -// CHECK:STDOUT: %.32: type = int_type unsigned, %.31 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 13 [template] +// CHECK:STDOUT: %u13: type = int_type unsigned, %.2 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N.2: i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt.2: i32 = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %.33: type = int_type unsigned, %N.2 [symbolic] +// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] +// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic] // CHECK:STDOUT: %Symbolic.type: type = fn_type @Symbolic [template] // CHECK:STDOUT: %Symbolic: %Symbolic.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref Main//types, inst+22, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Main//types, inst+7, loaded [template = constants.%IntLiteral] +// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Main//types, inst+23, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Int32 = %import_ref.51 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -152,7 +154,8 @@ var m: UInt(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .UInt = imports.%import_ref.1 +// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 +// CHECK:STDOUT: .UInt = imports.%import_ref.2 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .G = %G.decl @@ -161,129 +164,112 @@ var m: UInt(1000000000); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %n.patt: %.28 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %.28 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.28 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.28 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %u64 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %u64 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %u64 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %u64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %UInt.ref.loc6_9: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] -// CHECK:STDOUT: %.loc6_14.1: Core.IntLiteral = int_value 64 [template = constants.%.1] -// CHECK:STDOUT: %.loc6_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_14.3: = bound_method %.loc6_14.1, %.loc6_14.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc6_14: init i32 = call %.loc6_14.3(%.loc6_14.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc6_14.4: i32 = value_of_initializer %int.convert_checked.loc6_14 [template = constants.%.27] -// CHECK:STDOUT: %.loc6_14.5: i32 = converted %.loc6_14.1, %.loc6_14.4 [template = constants.%.27] -// CHECK:STDOUT: %int.make_type_unsigned.loc6_13: init type = call %UInt.ref.loc6_9(%.loc6_14.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc6_16.1: type = value_of_initializer %int.make_type_unsigned.loc6_13 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_16.2: type = converted %int.make_type_unsigned.loc6_13, %.loc6_16.1 [template = constants.%.28] -// CHECK:STDOUT: %UInt.ref.loc6_22: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] -// CHECK:STDOUT: %.loc6_27.1: Core.IntLiteral = int_value 64 [template = constants.%.1] -// CHECK:STDOUT: %.loc6_27.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_27.3: = bound_method %.loc6_27.1, %.loc6_27.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc6_27: init i32 = call %.loc6_27.3(%.loc6_27.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc6_27.4: i32 = value_of_initializer %int.convert_checked.loc6_27 [template = constants.%.27] -// CHECK:STDOUT: %.loc6_27.5: i32 = converted %.loc6_27.1, %.loc6_27.4 [template = constants.%.27] -// CHECK:STDOUT: %int.make_type_unsigned.loc6_26: init type = call %UInt.ref.loc6_22(%.loc6_27.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc6_29.1: type = value_of_initializer %int.make_type_unsigned.loc6_26 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_29.2: type = converted %int.make_type_unsigned.loc6_26, %.loc6_29.1 [template = constants.%.28] -// CHECK:STDOUT: %n.param: %.28 = value_param runtime_param0 -// CHECK:STDOUT: %n: %.28 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %.28 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.28 = return_slot %return.param +// CHECK:STDOUT: %UInt.ref.loc6_9: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] +// CHECK:STDOUT: %.loc6_14: Core.IntLiteral = int_value 64 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_unsigned.loc6_13: init type = call %UInt.ref.loc6_9(%.loc6_14) [template = constants.%u64] +// CHECK:STDOUT: %.loc6_16.1: type = value_of_initializer %int.make_type_unsigned.loc6_13 [template = constants.%u64] +// CHECK:STDOUT: %.loc6_16.2: type = converted %int.make_type_unsigned.loc6_13, %.loc6_16.1 [template = constants.%u64] +// CHECK:STDOUT: %UInt.ref.loc6_22: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] +// CHECK:STDOUT: %.loc6_27: Core.IntLiteral = int_value 64 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_unsigned.loc6_26: init type = call %UInt.ref.loc6_22(%.loc6_27) [template = constants.%u64] +// CHECK:STDOUT: %.loc6_29.1: type = value_of_initializer %int.make_type_unsigned.loc6_26 [template = constants.%u64] +// CHECK:STDOUT: %.loc6_29.2: type = converted %int.make_type_unsigned.loc6_26, %.loc6_29.1 [template = constants.%u64] +// CHECK:STDOUT: %n.param: %u64 = value_param runtime_param0 +// CHECK:STDOUT: %n: %u64 = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %u64 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %u64 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %n.patt: %.32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %.32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %u13 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %u13 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %u13 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %u13 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %UInt.ref.loc10_9: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] -// CHECK:STDOUT: %.loc10_14.1: Core.IntLiteral = int_value 13 [template = constants.%.29] -// CHECK:STDOUT: %.loc10_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_14.3: = bound_method %.loc10_14.1, %.loc10_14.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc10_14: init i32 = call %.loc10_14.3(%.loc10_14.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc10_14.4: i32 = value_of_initializer %int.convert_checked.loc10_14 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_14.5: i32 = converted %.loc10_14.1, %.loc10_14.4 [template = constants.%.31] -// CHECK:STDOUT: %int.make_type_unsigned.loc10_13: init type = call %UInt.ref.loc10_9(%.loc10_14.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc10_16.1: type = value_of_initializer %int.make_type_unsigned.loc10_13 [template = constants.%.32] -// CHECK:STDOUT: %.loc10_16.2: type = converted %int.make_type_unsigned.loc10_13, %.loc10_16.1 [template = constants.%.32] -// CHECK:STDOUT: %UInt.ref.loc10_22: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] -// CHECK:STDOUT: %.loc10_27.1: Core.IntLiteral = int_value 13 [template = constants.%.29] -// CHECK:STDOUT: %.loc10_27.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_27.3: = bound_method %.loc10_27.1, %.loc10_27.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc10_27: init i32 = call %.loc10_27.3(%.loc10_27.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc10_27.4: i32 = value_of_initializer %int.convert_checked.loc10_27 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_27.5: i32 = converted %.loc10_27.1, %.loc10_27.4 [template = constants.%.31] -// CHECK:STDOUT: %int.make_type_unsigned.loc10_26: init type = call %UInt.ref.loc10_22(%.loc10_27.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_unsigned.loc10_26 [template = constants.%.32] -// CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_unsigned.loc10_26, %.loc10_29.1 [template = constants.%.32] -// CHECK:STDOUT: %n.param: %.32 = value_param runtime_param0 -// CHECK:STDOUT: %n: %.32 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %.32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.32 = return_slot %return.param +// CHECK:STDOUT: %UInt.ref.loc10_9: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] +// CHECK:STDOUT: %.loc10_14: Core.IntLiteral = int_value 13 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned.loc10_13: init type = call %UInt.ref.loc10_9(%.loc10_14) [template = constants.%u13] +// CHECK:STDOUT: %.loc10_16.1: type = value_of_initializer %int.make_type_unsigned.loc10_13 [template = constants.%u13] +// CHECK:STDOUT: %.loc10_16.2: type = converted %int.make_type_unsigned.loc10_13, %.loc10_16.1 [template = constants.%u13] +// CHECK:STDOUT: %UInt.ref.loc10_22: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] +// CHECK:STDOUT: %.loc10_27: Core.IntLiteral = int_value 13 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_unsigned.loc10_26: init type = call %UInt.ref.loc10_22(%.loc10_27) [template = constants.%u13] +// CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_unsigned.loc10_26 [template = constants.%u13] +// CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_unsigned.loc10_26, %.loc10_29.1 [template = constants.%u13] +// CHECK:STDOUT: %n.param: %u13 = value_param runtime_param0 +// CHECK:STDOUT: %n: %u13 = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %u13 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %u13 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Symbolic.decl: %Symbolic.type = fn_decl @Symbolic [template = constants.%Symbolic] { -// CHECK:STDOUT: %N.patt.loc14_13.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt.2)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc14_13.1, runtime_param [symbolic = %N.patt.loc14_13.2 (constants.%N.patt.2)] -// CHECK:STDOUT: %x.patt: @Symbolic.%.loc14_29 (%.33) = binding_pattern x -// CHECK:STDOUT: %x.param_patt: @Symbolic.%.loc14_29 (%.33) = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: @Symbolic.%.loc14_29 (%.33) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Symbolic.%.loc14_29 (%.33) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %N.patt.loc14_13.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc14_13.1, runtime_param [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] +// CHECK:STDOUT: %x.patt: @Symbolic.%uN (%uN) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @Symbolic.%uN (%uN) = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @Symbolic.%uN (%uN) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Symbolic.%uN (%uN) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_17.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_17.2: type = converted %int.make_type_32, %.loc14_17.1 [template = i32] -// CHECK:STDOUT: %UInt.ref.loc14_25: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] -// CHECK:STDOUT: %N.ref.loc14_30: i32 = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N.2)] -// CHECK:STDOUT: %int.make_type_unsigned.loc14_29: init type = call %UInt.ref.loc14_25(%N.ref.loc14_30) [symbolic = %.loc14_29 (constants.%.33)] -// CHECK:STDOUT: %.loc14_31.1: type = value_of_initializer %int.make_type_unsigned.loc14_29 [symbolic = %.loc14_29 (constants.%.33)] -// CHECK:STDOUT: %.loc14_31.2: type = converted %int.make_type_unsigned.loc14_29, %.loc14_31.1 [symbolic = %.loc14_29 (constants.%.33)] -// CHECK:STDOUT: %UInt.ref.loc14_37: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] -// CHECK:STDOUT: %N.ref.loc14_42: i32 = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N.2)] -// CHECK:STDOUT: %int.make_type_unsigned.loc14_41: init type = call %UInt.ref.loc14_37(%N.ref.loc14_42) [symbolic = %.loc14_29 (constants.%.33)] -// CHECK:STDOUT: %.loc14_43.1: type = value_of_initializer %int.make_type_unsigned.loc14_41 [symbolic = %.loc14_29 (constants.%.33)] -// CHECK:STDOUT: %.loc14_43.2: type = converted %int.make_type_unsigned.loc14_41, %.loc14_43.1 [symbolic = %.loc14_29 (constants.%.33)] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc14_13.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_13.2 (constants.%N.2)] -// CHECK:STDOUT: %x.param: @Symbolic.%.loc14_29 (%.33) = value_param runtime_param0 -// CHECK:STDOUT: %x: @Symbolic.%.loc14_29 (%.33) = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref @Symbolic.%.loc14_29 (%.33) = out_param runtime_param1 -// CHECK:STDOUT: %return: ref @Symbolic.%.loc14_29 (%.33) = return_slot %return.param +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc14_28.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc14_28.2: type = converted %int_literal.make_type, %.loc14_28.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %UInt.ref.loc14_34: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] +// CHECK:STDOUT: %N.ref.loc14_39: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] +// CHECK:STDOUT: %int.make_type_unsigned.loc14_38: init type = call %UInt.ref.loc14_34(%N.ref.loc14_39) [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %.loc14_40.1: type = value_of_initializer %int.make_type_unsigned.loc14_38 [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %.loc14_40.2: type = converted %int.make_type_unsigned.loc14_38, %.loc14_40.1 [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %UInt.ref.loc14_46: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] +// CHECK:STDOUT: %N.ref.loc14_51: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] +// CHECK:STDOUT: %int.make_type_unsigned.loc14_50: init type = call %UInt.ref.loc14_46(%N.ref.loc14_51) [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %.loc14_52.1: type = value_of_initializer %int.make_type_unsigned.loc14_50 [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %.loc14_52.2: type = converted %int.make_type_unsigned.loc14_50, %.loc14_52.1 [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param +// CHECK:STDOUT: %N.loc14_13.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_13.2 (constants.%N)] +// CHECK:STDOUT: %x.param: @Symbolic.%uN (%uN) = value_param runtime_param0 +// CHECK:STDOUT: %x: @Symbolic.%uN (%uN) = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref @Symbolic.%uN (%uN) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @Symbolic.%uN (%uN) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @UInt(%n.param_patt: i32) -> type = "int.make_type_unsigned"; +// CHECK:STDOUT: fn @UInt(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_unsigned"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n.param_patt: %.28) -> %.28 { +// CHECK:STDOUT: fn @F(%n.param_patt: %u64) -> %u64 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: %.28 = name_ref n, %n +// CHECK:STDOUT: %n.ref: %u64 = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%n.param_patt: %.32) -> %.32 { +// CHECK:STDOUT: fn @G(%n.param_patt: %u13) -> %u13 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: %.32 = name_ref n, %n +// CHECK:STDOUT: %n.ref: %u13 = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Symbolic(%N.loc14_13.1: i32) { -// CHECK:STDOUT: %N.loc14_13.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc14_13.2 (constants.%N.2)] -// CHECK:STDOUT: %N.patt.loc14_13.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt.2)] -// CHECK:STDOUT: %.loc14_29: type = int_type unsigned, %N.loc14_13.2 [symbolic = %.loc14_29 (constants.%.33)] +// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Symbolic(%N.loc14_13.1: Core.IntLiteral) { +// CHECK:STDOUT: %N.loc14_13.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc14_13.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc14_13.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N.loc14_13.2 [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%N.param_patt: i32, %x.param_patt: @Symbolic.%.loc14_29 (%.33)) -> @Symbolic.%.loc14_29 (%.33) { +// CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral, %x.param_patt: @Symbolic.%uN (%uN)) -> @Symbolic.%uN (%uN) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.ref: @Symbolic.%.loc14_29 (%.33) = name_ref x, %x +// CHECK:STDOUT: %x.ref: @Symbolic.%uN (%uN) = name_ref x, %x // CHECK:STDOUT: return %x.ref // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Symbolic(constants.%N.2) { -// CHECK:STDOUT: %N.loc14_13.2 => constants.%N.2 -// CHECK:STDOUT: %N.patt.loc14_13.2 => constants.%N.2 -// CHECK:STDOUT: %.loc14_29 => constants.%.33 +// CHECK:STDOUT: specific @Symbolic(constants.%N) { +// CHECK:STDOUT: %N.loc14_13.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc14_13.2 => constants.%N +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_zero_size.carbon @@ -292,18 +278,12 @@ var m: UInt(1000000000); // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref Main//types, inst+22, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Main//types, inst+23, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -311,52 +291,59 @@ var m: UInt(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .UInt = imports.%import_ref.1 +// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 +// CHECK:STDOUT: .UInt = imports.%import_ref.2 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] -// CHECK:STDOUT: %.loc10_13.1: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc10_13.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_13.3: = bound_method %.loc10_13.1, %.loc10_13.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc10_13.3(%.loc10_13.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc10_13.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc10_13.5: i32 = converted %.loc10_13.1, %.loc10_13.4 [template = constants.%.27] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call %UInt.ref(%.loc10_13.5) [template = ] +// CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] +// CHECK:STDOUT: %.loc10_13: Core.IntLiteral = int_value 0 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_unsigned: init type = call %UInt.ref(%.loc10_13) [template = ] // CHECK:STDOUT: %.loc10_14.1: type = value_of_initializer %int.make_type_unsigned [template = ] // CHECK:STDOUT: %.loc10_14.2: type = converted %int.make_type_unsigned, %.loc10_14.1 [template = ] // CHECK:STDOUT: %n.var: ref = var n // CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @UInt(%n.param_patt: i32) -> type = "int.make_type_unsigned"; +// CHECK:STDOUT: fn @UInt(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_unsigned"; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_negative_size.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.26: %i32 = int_value -1 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] -// CHECK:STDOUT: %.28: i32 = int_value -1 [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.26, %Convert.15 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.4(%.1) [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value -1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref Main//types, inst+22, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Main//types, inst+23, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .Int = %import_ref.3 +// CHECK:STDOUT: .ImplicitAs = %import_ref.4 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -364,7 +351,8 @@ var m: UInt(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .UInt = imports.%import_ref.1 +// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 +// CHECK:STDOUT: .UInt = imports.%import_ref.2 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Negate = %Negate.decl // CHECK:STDOUT: .n = %n @@ -372,43 +360,52 @@ var m: UInt(1000000000); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] -// CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_32.loc6_14, %.loc6_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc6_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_32.loc6_22 [template = i32] -// CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc6_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_14: init type = call constants.%Int(%.loc6_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_signed.loc6_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_signed.loc6_14, %.loc6_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_22: init type = call constants.%Int(%.loc6_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.2: type = value_of_initializer %int.make_type_signed.loc6_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.3: type = converted %int.make_type_signed.loc6_22, %.loc6_22.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] +// CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_20.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_20.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_20.3: = bound_method %.loc12_20.1, %.loc12_20.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_20.3(%.loc12_20.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_20.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc12_20.5: i32 = converted %.loc12_20.1, %.loc12_20.4 [template = constants.%.27] -// CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc12_20.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc12_19.1: i32 = value_of_initializer %int.snegate [template = constants.%.28] -// CHECK:STDOUT: %.loc12_19.2: i32 = converted %int.snegate, %.loc12_19.1 [template = constants.%.28] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call %UInt.ref(%.loc12_19.2) [template = ] +// CHECK:STDOUT: %.loc12_20.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_20.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_20.3: = bound_method %.loc12_20.1, %.loc12_20.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_20.4: = specific_function %.loc12_20.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc12_20: init %i32 = call %.loc12_20.4(%.loc12_20.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_20.5: %i32 = value_of_initializer %int.convert_checked.loc12_20 [template = constants.%.25] +// CHECK:STDOUT: %.loc12_20.6: %i32 = converted %.loc12_20.1, %.loc12_20.5 [template = constants.%.25] +// CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc12_20.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc12_19.1: %Convert.type.6 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc12_19.2: = bound_method %int.snegate, %.loc12_19.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc12_19.3: = specific_function %.loc12_19.2, @Convert.4(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc12_19.4: %i32 = value_of_initializer %int.snegate [template = constants.%.26] +// CHECK:STDOUT: %.loc12_19.5: %i32 = converted %int.snegate, %.loc12_19.4 [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc12_19: init Core.IntLiteral = call %.loc12_19.3(%.loc12_19.5) [template = constants.%.30] +// CHECK:STDOUT: %.loc12_19.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc12_19 [template = constants.%.30] +// CHECK:STDOUT: %.loc12_19.7: Core.IntLiteral = converted %int.snegate, %.loc12_19.6 [template = constants.%.30] +// CHECK:STDOUT: %int.make_type_unsigned: init type = call %UInt.ref(%.loc12_19.7) [template = ] // CHECK:STDOUT: %.loc12_22.1: type = value_of_initializer %int.make_type_unsigned [template = ] // CHECK:STDOUT: %.loc12_22.2: type = converted %int.make_type_unsigned, %.loc12_22.1 [template = ] // CHECK:STDOUT: %n.var: ref = var n // CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%n.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%n.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @UInt(%n.param_patt: i32) -> type = "int.make_type_unsigned"; +// CHECK:STDOUT: fn @UInt(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_unsigned"; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_oversized.carbon // CHECK:STDOUT: @@ -416,18 +413,12 @@ var m: UInt(1000000000); // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1000000000 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1000000000 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref Main//types, inst+22, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Main//types, inst+23, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -435,25 +426,21 @@ var m: UInt(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .UInt = imports.%import_ref.1 +// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 +// CHECK:STDOUT: .UInt = imports.%import_ref.2 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .m = %m // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] -// CHECK:STDOUT: %.loc9_13.1: Core.IntLiteral = int_value 1000000000 [template = constants.%.1] -// CHECK:STDOUT: %.loc9_13.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_13.3: = bound_method %.loc9_13.1, %.loc9_13.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc9_13.3(%.loc9_13.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc9_13.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc9_13.5: i32 = converted %.loc9_13.1, %.loc9_13.4 [template = constants.%.27] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call %UInt.ref(%.loc9_13.5) [template = ] +// CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] +// CHECK:STDOUT: %.loc9_13: Core.IntLiteral = int_value 1000000000 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_unsigned: init type = call %UInt.ref(%.loc9_13) [template = ] // CHECK:STDOUT: %.loc9_23.1: type = value_of_initializer %int.make_type_unsigned [template = ] // CHECK:STDOUT: %.loc9_23.2: type = converted %int.make_type_unsigned, %.loc9_23.1 [template = ] // CHECK:STDOUT: %m.var: ref = var m // CHECK:STDOUT: %m: ref = bind_name m, %m.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @UInt(%n.param_patt: i32) -> type = "int.make_type_unsigned"; +// CHECK:STDOUT: fn @UInt(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_unsigned"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/neq.carbon b/toolchain/check/testdata/builtins/int/neq.carbon index 0c06083bfd53..ce7201a8f300 100644 --- a/toolchain/check/testdata/builtins/int/neq.carbon +++ b/toolchain/check/testdata/builtins/int/neq.carbon @@ -27,37 +27,41 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: --- int_neq.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %Neq.type: type = fn_type @Neq [template] // CHECK:STDOUT: %Neq: %Neq.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.29: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 1 [template] -// CHECK:STDOUT: %.31: bool = bool_literal false [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 2 [template] -// CHECK:STDOUT: %.35: bool = bool_literal true [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.26: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.27: = specific_function %.26, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.28: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.29: bool = bool_literal false [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.31: = bound_method %.30, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.34: bool = bool_literal true [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude @@ -76,26 +80,28 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Neq.decl: %Neq.type = fn_decl @Neq [template = constants.%Neq] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] +// CHECK:STDOUT: %.loc2_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%.loc2_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.3: type = converted %int.make_type_signed.loc2_11, %.loc2_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%.loc2_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.3: type = converted %int.make_type_signed.loc2_19, %.loc2_19.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_27.2: type = converted %bool.make_type, %.loc2_27.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } @@ -115,66 +121,70 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc12_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %int.make_type_32.loc12_19 [template = i32] -// CHECK:STDOUT: %.loc12_19.2: type = converted %int.make_type_32.loc12_19, %.loc12_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc12_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_27.1: type = value_of_initializer %int.make_type_32.loc12_27 [template = i32] -// CHECK:STDOUT: %.loc12_27.2: type = converted %int.make_type_32.loc12_27, %.loc12_27.1 [template = i32] +// CHECK:STDOUT: %.loc12_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_19: init type = call constants.%Int(%.loc12_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_19.2: type = value_of_initializer %int.make_type_signed.loc12_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_19.3: type = converted %int.make_type_signed.loc12_19, %.loc12_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_27: init type = call constants.%Int(%.loc12_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_27.2: type = value_of_initializer %int.make_type_signed.loc12_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_27.3: type = converted %int.make_type_signed.loc12_27, %.loc12_27.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type, %.loc12_35.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc4: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %.loc5: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc5: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Neq(%a.param_patt: i32, %b.param_patt: i32) -> bool = "int.neq"; +// CHECK:STDOUT: fn @Neq(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.neq"; // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %false_.ref: %False = name_ref false_, %false_ // CHECK:STDOUT: %Neq.ref.loc8: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] -// CHECK:STDOUT: %.loc8_21.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc8_24.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc8_21.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_21.3: = bound_method %.loc8_21.1, %.loc8_21.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc8_21: init i32 = call %.loc8_21.3(%.loc8_21.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc8_21.4: i32 = value_of_initializer %int.convert_checked.loc8_21 [template = constants.%.30] -// CHECK:STDOUT: %.loc8_21.5: i32 = converted %.loc8_21.1, %.loc8_21.4 [template = constants.%.30] -// CHECK:STDOUT: %.loc8_24.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_24.3: = bound_method %.loc8_24.1, %.loc8_24.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc8_24: init i32 = call %.loc8_24.3(%.loc8_24.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc8_24.4: i32 = value_of_initializer %int.convert_checked.loc8_24 [template = constants.%.30] -// CHECK:STDOUT: %.loc8_24.5: i32 = converted %.loc8_24.1, %.loc8_24.4 [template = constants.%.30] -// CHECK:STDOUT: %int.neq.loc8: init bool = call %Neq.ref.loc8(%.loc8_21.5, %.loc8_24.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc8_14.1: bool = value_of_initializer %int.neq.loc8 [template = constants.%.31] -// CHECK:STDOUT: %.loc8_14.2: bool = converted %int.neq.loc8, %.loc8_14.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc8_21.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc8_24.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc8_21.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_21.3: = bound_method %.loc8_21.1, %.loc8_21.2 [template = constants.%.26] +// CHECK:STDOUT: %.loc8_21.4: = specific_function %.loc8_21.3, @Convert.2(constants.%.1) [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc8_21: init %i32 = call %.loc8_21.4(%.loc8_21.1) [template = constants.%.28] +// CHECK:STDOUT: %.loc8_21.5: %i32 = value_of_initializer %int.convert_checked.loc8_21 [template = constants.%.28] +// CHECK:STDOUT: %.loc8_21.6: %i32 = converted %.loc8_21.1, %.loc8_21.5 [template = constants.%.28] +// CHECK:STDOUT: %.loc8_24.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_24.3: = bound_method %.loc8_24.1, %.loc8_24.2 [template = constants.%.26] +// CHECK:STDOUT: %.loc8_24.4: = specific_function %.loc8_24.3, @Convert.2(constants.%.1) [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc8_24: init %i32 = call %.loc8_24.4(%.loc8_24.1) [template = constants.%.28] +// CHECK:STDOUT: %.loc8_24.5: %i32 = value_of_initializer %int.convert_checked.loc8_24 [template = constants.%.28] +// CHECK:STDOUT: %.loc8_24.6: %i32 = converted %.loc8_24.1, %.loc8_24.5 [template = constants.%.28] +// CHECK:STDOUT: %int.neq.loc8: init bool = call %Neq.ref.loc8(%.loc8_21.6, %.loc8_24.6) [template = constants.%.29] +// CHECK:STDOUT: %.loc8_14.1: bool = value_of_initializer %int.neq.loc8 [template = constants.%.29] +// CHECK:STDOUT: %.loc8_14.2: bool = converted %int.neq.loc8, %.loc8_14.1 [template = constants.%.29] // CHECK:STDOUT: if %.loc8_14.2 br !if.expr.then.loc8 else br !if.expr.else.loc8 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc8: @@ -189,21 +199,23 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc8_14.3: type = block_arg !if.expr.result.loc8 [template = constants.%False] // CHECK:STDOUT: %true_.ref: %True = name_ref true_, %true_ // CHECK:STDOUT: %Neq.ref.loc9: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] -// CHECK:STDOUT: %.loc9_20.1: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc9_23.1: Core.IntLiteral = int_value 2 [template = constants.%.32] -// CHECK:STDOUT: %.loc9_20.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_20.3: = bound_method %.loc9_20.1, %.loc9_20.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc9_20: init i32 = call %.loc9_20.3(%.loc9_20.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc9_20.4: i32 = value_of_initializer %int.convert_checked.loc9_20 [template = constants.%.30] -// CHECK:STDOUT: %.loc9_20.5: i32 = converted %.loc9_20.1, %.loc9_20.4 [template = constants.%.30] -// CHECK:STDOUT: %.loc9_23.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_23.3: = bound_method %.loc9_23.1, %.loc9_23.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc9_23: init i32 = call %.loc9_23.3(%.loc9_23.1) [template = constants.%.34] -// CHECK:STDOUT: %.loc9_23.4: i32 = value_of_initializer %int.convert_checked.loc9_23 [template = constants.%.34] -// CHECK:STDOUT: %.loc9_23.5: i32 = converted %.loc9_23.1, %.loc9_23.4 [template = constants.%.34] -// CHECK:STDOUT: %int.neq.loc9: init bool = call %Neq.ref.loc9(%.loc9_20.5, %.loc9_23.5) [template = constants.%.35] -// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %int.neq.loc9 [template = constants.%.35] -// CHECK:STDOUT: %.loc9_13.2: bool = converted %int.neq.loc9, %.loc9_13.1 [template = constants.%.35] +// CHECK:STDOUT: %.loc9_20.1: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_23.1: Core.IntLiteral = int_value 2 [template = constants.%.30] +// CHECK:STDOUT: %.loc9_20.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_20.3: = bound_method %.loc9_20.1, %.loc9_20.2 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_20.4: = specific_function %.loc9_20.3, @Convert.2(constants.%.1) [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc9_20: init %i32 = call %.loc9_20.4(%.loc9_20.1) [template = constants.%.28] +// CHECK:STDOUT: %.loc9_20.5: %i32 = value_of_initializer %int.convert_checked.loc9_20 [template = constants.%.28] +// CHECK:STDOUT: %.loc9_20.6: %i32 = converted %.loc9_20.1, %.loc9_20.5 [template = constants.%.28] +// CHECK:STDOUT: %.loc9_23.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_23.3: = bound_method %.loc9_23.1, %.loc9_23.2 [template = constants.%.31] +// CHECK:STDOUT: %.loc9_23.4: = specific_function %.loc9_23.3, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc9_23: init %i32 = call %.loc9_23.4(%.loc9_23.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc9_23.5: %i32 = value_of_initializer %int.convert_checked.loc9_23 [template = constants.%.33] +// CHECK:STDOUT: %.loc9_23.6: %i32 = converted %.loc9_23.1, %.loc9_23.5 [template = constants.%.33] +// CHECK:STDOUT: %int.neq.loc9: init bool = call %Neq.ref.loc9(%.loc9_20.6, %.loc9_23.6) [template = constants.%.34] +// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %int.neq.loc9 [template = constants.%.34] +// CHECK:STDOUT: %.loc9_13.2: bool = converted %int.neq.loc9, %.loc9_13.1 [template = constants.%.34] // CHECK:STDOUT: if %.loc9_13.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: @@ -219,11 +231,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Neq.ref: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.neq: init bool = call %Neq.ref(%a.ref, %b.ref) // CHECK:STDOUT: %.loc13_19.1: bool = value_of_initializer %int.neq // CHECK:STDOUT: %.loc13_19.2: bool = converted %int.neq, %.loc13_19.1 diff --git a/toolchain/check/testdata/builtins/int/or.carbon b/toolchain/check/testdata/builtins/int/or.carbon index 234b4aead058..55d3154c10e1 100644 --- a/toolchain/check/testdata/builtins/int/or.carbon +++ b/toolchain/check/testdata/builtins/int/or.carbon @@ -22,28 +22,33 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: --- int_or.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Or.type: type = fn_type @Or [template] // CHECK:STDOUT: %Or: %Or.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 10 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 10 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 12 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 10 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 14 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 12 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 10 [template] -// CHECK:STDOUT: %.31: i32 = int_value 14 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.16 [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.15 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.4(%.1) [template] // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 14 [template] -// CHECK:STDOUT: %.35: type = array_type %.34, i32 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, %i32 [template] // CHECK:STDOUT: %.36: type = ptr_type %.35 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] @@ -51,7 +56,7 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -68,98 +73,109 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Or.decl: %Or.type = fn_decl @Or [template = constants.%Or] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_10.1: type = value_of_initializer %int.make_type_32.loc2_10 [template = i32] -// CHECK:STDOUT: %.loc2_10.2: type = converted %int.make_type_32.loc2_10, %.loc2_10.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %int.make_type_32.loc2_18 [template = i32] -// CHECK:STDOUT: %.loc2_18.2: type = converted %int.make_type_32.loc2_18, %.loc2_18.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_26: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %int.make_type_32.loc2_26 [template = i32] -// CHECK:STDOUT: %.loc2_26.2: type = converted %int.make_type_32.loc2_26, %.loc2_26.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_10: init type = call constants.%Int(%.loc2_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_10.2: type = value_of_initializer %int.make_type_signed.loc2_10 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_10.3: type = converted %int.make_type_signed.loc2_10, %.loc2_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_18: init type = call constants.%Int(%.loc2_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_18.2: type = value_of_initializer %int.make_type_signed.loc2_18 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_18.3: type = converted %int.make_type_signed.loc2_18, %.loc2_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_26.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_26: init type = call constants.%Int(%.loc2_26.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_26.2: type = value_of_initializer %int.make_type_signed.loc2_26 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_26.3: type = converted %int.make_type_signed.loc2_26, %.loc2_26.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %Or.ref: %Or.type = name_ref Or, %Or.decl [template = constants.%Or] -// CHECK:STDOUT: %.loc4_19.1: Core.IntLiteral = int_value 12 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 10 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_19.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_19.3: = bound_method %.loc4_19.1, %.loc4_19.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init i32 = call %.loc4_19.3(%.loc4_19.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc4_19.4: i32 = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_19.5: i32 = converted %.loc4_19.1, %.loc4_19.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init i32 = call %.loc4_23.3(%.loc4_23.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.4: i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.5: i32 = converted %.loc4_23.1, %.loc4_23.4 [template = constants.%.30] -// CHECK:STDOUT: %int.or: init i32 = call %Or.ref(%.loc4_19.5, %.loc4_23.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_18.1: %Convert.type.5 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc4_18.2: = bound_method %int.or, %.loc4_18.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_18.3: i32 = value_of_initializer %int.or [template = constants.%.31] -// CHECK:STDOUT: %.loc4_18.4: i32 = converted %int.or, %.loc4_18.3 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc4_18: init Core.IntLiteral = call %.loc4_18.2(%.loc4_18.4) [template = constants.%.34] -// CHECK:STDOUT: %.loc4_18.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_18 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_18.6: Core.IntLiteral = converted %int.or, %.loc4_18.5 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_26: type = array_type %.loc4_18.6, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc4_19.1: Core.IntLiteral = int_value 12 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 10 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_19.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_19.3: = bound_method %.loc4_19.1, %.loc4_19.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_19.4: = specific_function %.loc4_19.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc4_19: init %i32 = call %.loc4_19.4(%.loc4_19.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc4_19.5: %i32 = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_19.6: %i32 = converted %.loc4_19.1, %.loc4_19.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_23.4: = specific_function %.loc4_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %.loc4_23.4(%.loc4_23.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.5: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.6: %i32 = converted %.loc4_23.1, %.loc4_23.5 [template = constants.%.29] +// CHECK:STDOUT: %int.or: init %i32 = call %Or.ref(%.loc4_19.6, %.loc4_23.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_18.1: %Convert.type.6 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_18.2: = bound_method %int.or, %.loc4_18.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc4_18.3: = specific_function %.loc4_18.2, @Convert.4(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc4_18.4: %i32 = value_of_initializer %int.or [template = constants.%.30] +// CHECK:STDOUT: %.loc4_18.5: %i32 = converted %int.or, %.loc4_18.4 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc4_18: init Core.IntLiteral = call %.loc4_18.3(%.loc4_18.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc4_18.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_18 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_18.7: Core.IntLiteral = converted %int.or, %.loc4_18.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_26: type = array_type %.loc4_18.7, %i32 [template = constants.%.35] // CHECK:STDOUT: %arr.var: ref %.35 = var arr // CHECK:STDOUT: %arr: ref %.35 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_13.1) [template = constants.%i32] // CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 14 [template = constants.%.34] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_20: type = array_type %.loc5_18, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_13.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_13.3: type = converted %int.make_type_signed.loc5, %.loc5_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_20: type = array_type %.loc5_18, %i32 [template = constants.%.35] // CHECK:STDOUT: %.loc5_21: type = ptr_type %.35 [template = constants.%.36] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.3: type = converted %int.make_type_signed.loc7_19, %.loc7_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%.loc7_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.3: type = converted %int.make_type_signed.loc7_27, %.loc7_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%.loc7_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.3: type = converted %int.make_type_signed.loc7_35, %.loc7_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Or(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.or"; +// CHECK:STDOUT: fn @Or(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.or"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Or.ref: %Or.type = name_ref Or, file.%Or.decl [template = constants.%Or] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %int.or: init i32 = call %Or.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_18.1: i32 = value_of_initializer %int.or -// CHECK:STDOUT: %.loc8_18.2: i32 = converted %int.or, %.loc8_18.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %int.or: init %i32 = call %Or.ref(%a.ref, %b.ref) +// CHECK:STDOUT: %.loc8_18.1: %i32 = value_of_initializer %int.or +// CHECK:STDOUT: %.loc8_18.2: %i32 = converted %int.or, %.loc8_18.1 // CHECK:STDOUT: return %.loc8_18.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/right_shift.carbon b/toolchain/check/testdata/builtins/int/right_shift.carbon index b6e3c3dd24dc..468c4b63a232 100644 --- a/toolchain/check/testdata/builtins/int/right_shift.carbon +++ b/toolchain/check/testdata/builtins/int/right_shift.carbon @@ -67,28 +67,33 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: --- int_right_shift.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %RightShift.type: type = fn_type @RightShift [template] // CHECK:STDOUT: %RightShift: %RightShift.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 22 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 22 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 22 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 5 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 22 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] -// CHECK:STDOUT: %.31: i32 = int_value 5 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.16 [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.15 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.4(%.1) [template] // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %.35: type = array_type %.34, i32 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, %i32 [template] // CHECK:STDOUT: %.36: type = ptr_type %.35 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] @@ -96,7 +101,7 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -113,98 +118,109 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %RightShift.decl: %RightShift.type = fn_decl @RightShift [template = constants.%RightShift] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %int.make_type_32.loc2_18 [template = i32] -// CHECK:STDOUT: %.loc2_18.2: type = converted %int.make_type_32.loc2_18, %.loc2_18.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_26: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %int.make_type_32.loc2_26 [template = i32] -// CHECK:STDOUT: %.loc2_26.2: type = converted %int.make_type_32.loc2_26, %.loc2_26.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_34.1: type = value_of_initializer %int.make_type_32.loc2_34 [template = i32] -// CHECK:STDOUT: %.loc2_34.2: type = converted %int.make_type_32.loc2_34, %.loc2_34.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_18: init type = call constants.%Int(%.loc2_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_18.2: type = value_of_initializer %int.make_type_signed.loc2_18 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_18.3: type = converted %int.make_type_signed.loc2_18, %.loc2_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_26.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_26: init type = call constants.%Int(%.loc2_26.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_26.2: type = value_of_initializer %int.make_type_signed.loc2_26 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_26.3: type = converted %int.make_type_signed.loc2_26, %.loc2_26.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_34.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_34: init type = call constants.%Int(%.loc2_34.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_34.2: type = value_of_initializer %int.make_type_signed.loc2_34 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_34.3: type = converted %int.make_type_signed.loc2_34, %.loc2_34.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %RightShift.ref: %RightShift.type = name_ref RightShift, %RightShift.decl [template = constants.%RightShift] -// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 22 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_31.1: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_27.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_27.3: = bound_method %.loc4_27.1, %.loc4_27.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc4_27: init i32 = call %.loc4_27.3(%.loc4_27.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc4_27.4: i32 = value_of_initializer %int.convert_checked.loc4_27 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_27.5: i32 = converted %.loc4_27.1, %.loc4_27.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_31.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_31.3: = bound_method %.loc4_31.1, %.loc4_31.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc4_31: init i32 = call %.loc4_31.3(%.loc4_31.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc4_31.4: i32 = value_of_initializer %int.convert_checked.loc4_31 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_31.5: i32 = converted %.loc4_31.1, %.loc4_31.4 [template = constants.%.30] -// CHECK:STDOUT: %int.right_shift: init i32 = call %RightShift.ref(%.loc4_27.5, %.loc4_31.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_26.1: %Convert.type.5 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc4_26.2: = bound_method %int.right_shift, %.loc4_26.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_26.3: i32 = value_of_initializer %int.right_shift [template = constants.%.31] -// CHECK:STDOUT: %.loc4_26.4: i32 = converted %int.right_shift, %.loc4_26.3 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc4_26: init Core.IntLiteral = call %.loc4_26.2(%.loc4_26.4) [template = constants.%.34] -// CHECK:STDOUT: %.loc4_26.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_26 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_26.6: Core.IntLiteral = converted %int.right_shift, %.loc4_26.5 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_33: type = array_type %.loc4_26.6, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 22 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_31.1: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_27.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_27.3: = bound_method %.loc4_27.1, %.loc4_27.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_27.4: = specific_function %.loc4_27.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc4_27: init %i32 = call %.loc4_27.4(%.loc4_27.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc4_27.5: %i32 = value_of_initializer %int.convert_checked.loc4_27 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_27.6: %i32 = converted %.loc4_27.1, %.loc4_27.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_31.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_31.3: = bound_method %.loc4_31.1, %.loc4_31.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_31.4: = specific_function %.loc4_31.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc4_31: init %i32 = call %.loc4_31.4(%.loc4_31.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_31.5: %i32 = value_of_initializer %int.convert_checked.loc4_31 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_31.6: %i32 = converted %.loc4_31.1, %.loc4_31.5 [template = constants.%.29] +// CHECK:STDOUT: %int.right_shift: init %i32 = call %RightShift.ref(%.loc4_27.6, %.loc4_31.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_26.1: %Convert.type.6 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_26.2: = bound_method %int.right_shift, %.loc4_26.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc4_26.3: = specific_function %.loc4_26.2, @Convert.4(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc4_26.4: %i32 = value_of_initializer %int.right_shift [template = constants.%.30] +// CHECK:STDOUT: %.loc4_26.5: %i32 = converted %int.right_shift, %.loc4_26.4 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc4_26: init Core.IntLiteral = call %.loc4_26.3(%.loc4_26.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc4_26.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_26 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_26.7: Core.IntLiteral = converted %int.right_shift, %.loc4_26.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_33: type = array_type %.loc4_26.7, %i32 [template = constants.%.35] // CHECK:STDOUT: %arr.var: ref %.35 = var arr // CHECK:STDOUT: %arr: ref %.35 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_13.1) [template = constants.%i32] // CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 5 [template = constants.%.34] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_13.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_13.3: type = converted %int.make_type_signed.loc5, %.loc5_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, %i32 [template = constants.%.35] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.35 [template = constants.%.36] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.3: type = converted %int.make_type_signed.loc7_19, %.loc7_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%.loc7_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.3: type = converted %int.make_type_signed.loc7_27, %.loc7_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%.loc7_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.3: type = converted %int.make_type_signed.loc7_35, %.loc7_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RightShift(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.right_shift"; +// CHECK:STDOUT: fn @RightShift(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.right_shift"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %RightShift.ref: %RightShift.type = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %int.right_shift: init i32 = call %RightShift.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_26.1: i32 = value_of_initializer %int.right_shift -// CHECK:STDOUT: %.loc8_26.2: i32 = converted %int.right_shift, %.loc8_26.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %int.right_shift: init %i32 = call %RightShift.ref(%a.ref, %b.ref) +// CHECK:STDOUT: %.loc8_26.1: %i32 = value_of_initializer %int.right_shift +// CHECK:STDOUT: %.loc8_26.2: %i32 = converted %int.right_shift, %.loc8_26.1 // CHECK:STDOUT: return %.loc8_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -219,45 +235,52 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: --- arith_shift.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %RightShift.type: type = fn_type @RightShift [template] // CHECK:STDOUT: %RightShift: %RightShift.type = struct_value () [template] // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.26: %i32 = int_value -1 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] -// CHECK:STDOUT: %.28: i32 = int_value -1 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.30: = bound_method %.27, %Convert.16 [template] -// CHECK:STDOUT: %.31: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.32: type = ptr_type %.31 [template] -// CHECK:STDOUT: %.33: Core.IntLiteral = int_value 10 [template] -// CHECK:STDOUT: %.34: = bound_method %.33, %Convert.15 [template] -// CHECK:STDOUT: %.35: i32 = int_value 10 [template] -// CHECK:STDOUT: %.36: i32 = int_value -10 [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.25, %Convert.15 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.4(%.1) [template] +// CHECK:STDOUT: %.30: type = array_type %.2, %i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] +// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 10 [template] +// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.14 [template] +// CHECK:STDOUT: %.34: = specific_function %.33, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.35: %i32 = int_value 10 [template] +// CHECK:STDOUT: %.36: %i32 = int_value -10 [template] // CHECK:STDOUT: %.37: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.38: = bound_method %.37, %Convert.15 [template] -// CHECK:STDOUT: %.39: i32 = int_value 2 [template] -// CHECK:STDOUT: %.40: i32 = int_value -3 [template] -// CHECK:STDOUT: %.41: i32 = int_value 3 [template] -// CHECK:STDOUT: %.42: = bound_method %.41, %Convert.16 [template] -// CHECK:STDOUT: %.43: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.44: type = array_type %.43, i32 [template] -// CHECK:STDOUT: %.45: type = ptr_type %.44 [template] +// CHECK:STDOUT: %.38: = bound_method %.37, %Convert.14 [template] +// CHECK:STDOUT: %.39: = specific_function %.38, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.40: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.41: %i32 = int_value -3 [template] +// CHECK:STDOUT: %.42: %i32 = int_value 3 [template] +// CHECK:STDOUT: %.43: = bound_method %.42, %Convert.15 [template] +// CHECK:STDOUT: %.44: = specific_function %.43, @Convert.4(%.1) [template] +// CHECK:STDOUT: %.45: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.46: type = array_type %.45, %i32 [template] +// CHECK:STDOUT: %.47: type = ptr_type %.46 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -276,177 +299,197 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %RightShift.decl: %RightShift.type = fn_decl @RightShift [template = constants.%RightShift] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc6_18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_18.1: type = value_of_initializer %int.make_type_32.loc6_18 [template = i32] -// CHECK:STDOUT: %.loc6_18.2: type = converted %int.make_type_32.loc6_18, %.loc6_18.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc6_26: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_26.1: type = value_of_initializer %int.make_type_32.loc6_26 [template = i32] -// CHECK:STDOUT: %.loc6_26.2: type = converted %int.make_type_32.loc6_26, %.loc6_26.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc6_34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_34.1: type = value_of_initializer %int.make_type_32.loc6_34 [template = i32] -// CHECK:STDOUT: %.loc6_34.2: type = converted %int.make_type_32.loc6_34, %.loc6_34.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc6_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_18: init type = call constants.%Int(%.loc6_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_18.2: type = value_of_initializer %int.make_type_signed.loc6_18 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_18.3: type = converted %int.make_type_signed.loc6_18, %.loc6_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_26.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_26: init type = call constants.%Int(%.loc6_26.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_26.2: type = value_of_initializer %int.make_type_signed.loc6_26 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_26.3: type = converted %int.make_type_signed.loc6_26, %.loc6_26.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_34.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_34: init type = call constants.%Int(%.loc6_34.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_34.2: type = value_of_initializer %int.make_type_signed.loc6_34 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_34.3: type = converted %int.make_type_signed.loc6_34, %.loc6_34.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_14.1: type = value_of_initializer %int.make_type_32.loc7_14 [template = i32] -// CHECK:STDOUT: %.loc7_14.2: type = converted %int.make_type_32.loc7_14, %.loc7_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_22.1: type = value_of_initializer %int.make_type_32.loc7_22 [template = i32] -// CHECK:STDOUT: %.loc7_22.2: type = converted %int.make_type_32.loc7_22, %.loc7_22.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_14: init type = call constants.%Int(%.loc7_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_14.2: type = value_of_initializer %int.make_type_signed.loc7_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_14.3: type = converted %int.make_type_signed.loc7_14, %.loc7_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_22: init type = call constants.%Int(%.loc7_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_22.2: type = value_of_initializer %int.make_type_signed.loc7_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_22.3: type = converted %int.make_type_signed.loc7_22, %.loc7_22.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc10_12.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc10: init type = call constants.%Int(%.loc10_12.1) [template = constants.%i32] // CHECK:STDOUT: %Negate.ref.loc10_17: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %RightShift.ref.loc10: %RightShift.type = name_ref RightShift, %RightShift.decl [template = constants.%RightShift] // CHECK:STDOUT: %Negate.ref.loc10_35: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc10_42.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc10_42.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_42.3: = bound_method %.loc10_42.1, %.loc10_42.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc10_42: init i32 = call %.loc10_42.3(%.loc10_42.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc10_42.4: i32 = value_of_initializer %int.convert_checked.loc10_42 [template = constants.%.27] -// CHECK:STDOUT: %.loc10_42.5: i32 = converted %.loc10_42.1, %.loc10_42.4 [template = constants.%.27] -// CHECK:STDOUT: %int.snegate.loc10_41: init i32 = call %Negate.ref.loc10_35(%.loc10_42.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc10_46.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc10_41.1: i32 = value_of_initializer %int.snegate.loc10_41 [template = constants.%.28] -// CHECK:STDOUT: %.loc10_41.2: i32 = converted %int.snegate.loc10_41, %.loc10_41.1 [template = constants.%.28] -// CHECK:STDOUT: %.loc10_46.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_46.3: = bound_method %.loc10_46.1, %.loc10_46.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc10_46: init i32 = call %.loc10_46.3(%.loc10_46.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc10_46.4: i32 = value_of_initializer %int.convert_checked.loc10_46 [template = constants.%.27] -// CHECK:STDOUT: %.loc10_46.5: i32 = converted %.loc10_46.1, %.loc10_46.4 [template = constants.%.27] -// CHECK:STDOUT: %int.right_shift.loc10: init i32 = call %RightShift.ref.loc10(%.loc10_41.2, %.loc10_46.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc10_34.1: i32 = value_of_initializer %int.right_shift.loc10 [template = constants.%.28] -// CHECK:STDOUT: %.loc10_34.2: i32 = converted %int.right_shift.loc10, %.loc10_34.1 [template = constants.%.28] -// CHECK:STDOUT: %int.snegate.loc10_23: init i32 = call %Negate.ref.loc10_17(%.loc10_34.2) [template = constants.%.27] -// CHECK:STDOUT: %.loc10_12.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32] -// CHECK:STDOUT: %.loc10_12.2: type = converted %int.make_type_32.loc10, %.loc10_12.1 [template = i32] -// CHECK:STDOUT: %.loc10_23.1: %Convert.type.5 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc10_23.2: = bound_method %int.snegate.loc10_23, %.loc10_23.1 [template = constants.%.30] -// CHECK:STDOUT: %.loc10_23.3: i32 = value_of_initializer %int.snegate.loc10_23 [template = constants.%.27] -// CHECK:STDOUT: %.loc10_23.4: i32 = converted %int.snegate.loc10_23, %.loc10_23.3 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc10_23: init Core.IntLiteral = call %.loc10_23.2(%.loc10_23.4) [template = constants.%.1] -// CHECK:STDOUT: %.loc10_23.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_23 [template = constants.%.1] -// CHECK:STDOUT: %.loc10_23.6: Core.IntLiteral = converted %int.snegate.loc10_23, %.loc10_23.5 [template = constants.%.1] -// CHECK:STDOUT: %.loc10_49: type = array_type %.loc10_23.6, i32 [template = constants.%.31] -// CHECK:STDOUT: %arr1.var: ref %.31 = var arr1 -// CHECK:STDOUT: %arr1: ref %.31 = bind_name arr1, %arr1.var -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_19: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32.loc11, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: %.loc11_20: type = array_type %.loc11_19, i32 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_21: type = ptr_type %.31 [template = constants.%.32] -// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc10_42.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc10_42.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_42.3: = bound_method %.loc10_42.1, %.loc10_42.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc10_42.4: = specific_function %.loc10_42.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc10_42: init %i32 = call %.loc10_42.4(%.loc10_42.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc10_42.5: %i32 = value_of_initializer %int.convert_checked.loc10_42 [template = constants.%.25] +// CHECK:STDOUT: %.loc10_42.6: %i32 = converted %.loc10_42.1, %.loc10_42.5 [template = constants.%.25] +// CHECK:STDOUT: %int.snegate.loc10_41: init %i32 = call %Negate.ref.loc10_35(%.loc10_42.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc10_46.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc10_41.1: %i32 = value_of_initializer %int.snegate.loc10_41 [template = constants.%.26] +// CHECK:STDOUT: %.loc10_41.2: %i32 = converted %int.snegate.loc10_41, %.loc10_41.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc10_46.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_46.3: = bound_method %.loc10_46.1, %.loc10_46.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc10_46.4: = specific_function %.loc10_46.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc10_46: init %i32 = call %.loc10_46.4(%.loc10_46.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc10_46.5: %i32 = value_of_initializer %int.convert_checked.loc10_46 [template = constants.%.25] +// CHECK:STDOUT: %.loc10_46.6: %i32 = converted %.loc10_46.1, %.loc10_46.5 [template = constants.%.25] +// CHECK:STDOUT: %int.right_shift.loc10: init %i32 = call %RightShift.ref.loc10(%.loc10_41.2, %.loc10_46.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc10_34.1: %i32 = value_of_initializer %int.right_shift.loc10 [template = constants.%.26] +// CHECK:STDOUT: %.loc10_34.2: %i32 = converted %int.right_shift.loc10, %.loc10_34.1 [template = constants.%.26] +// CHECK:STDOUT: %int.snegate.loc10_23: init %i32 = call %Negate.ref.loc10_17(%.loc10_34.2) [template = constants.%.25] +// CHECK:STDOUT: %.loc10_12.2: type = value_of_initializer %int.make_type_signed.loc10 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_12.3: type = converted %int.make_type_signed.loc10, %.loc10_12.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_23.1: %Convert.type.6 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc10_23.2: = bound_method %int.snegate.loc10_23, %.loc10_23.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc10_23.3: = specific_function %.loc10_23.2, @Convert.4(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc10_23.4: %i32 = value_of_initializer %int.snegate.loc10_23 [template = constants.%.25] +// CHECK:STDOUT: %.loc10_23.5: %i32 = converted %int.snegate.loc10_23, %.loc10_23.4 [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc10_23: init Core.IntLiteral = call %.loc10_23.3(%.loc10_23.5) [template = constants.%.2] +// CHECK:STDOUT: %.loc10_23.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_23 [template = constants.%.2] +// CHECK:STDOUT: %.loc10_23.7: Core.IntLiteral = converted %int.snegate.loc10_23, %.loc10_23.6 [template = constants.%.2] +// CHECK:STDOUT: %.loc10_49: type = array_type %.loc10_23.7, %i32 [template = constants.%.30] +// CHECK:STDOUT: %arr1.var: ref %.30 = var arr1 +// CHECK:STDOUT: %arr1: ref %.30 = bind_name arr1, %arr1.var +// CHECK:STDOUT: %.loc11_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_14.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.3: type = converted %int.make_type_signed.loc11, %.loc11_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_20: type = array_type %.loc11_19, %i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_21: type = ptr_type %.30 [template = constants.%.31] +// CHECK:STDOUT: %.loc14_12.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%.loc14_12.1) [template = constants.%i32] // CHECK:STDOUT: %Negate.ref.loc14_17: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %RightShift.ref.loc14: %RightShift.type = name_ref RightShift, %RightShift.decl [template = constants.%RightShift] // CHECK:STDOUT: %Negate.ref.loc14_35: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc14_42.1: Core.IntLiteral = int_value 10 [template = constants.%.33] -// CHECK:STDOUT: %.loc14_42.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_42.3: = bound_method %.loc14_42.1, %.loc14_42.2 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc14_42: init i32 = call %.loc14_42.3(%.loc14_42.1) [template = constants.%.35] -// CHECK:STDOUT: %.loc14_42.4: i32 = value_of_initializer %int.convert_checked.loc14_42 [template = constants.%.35] -// CHECK:STDOUT: %.loc14_42.5: i32 = converted %.loc14_42.1, %.loc14_42.4 [template = constants.%.35] -// CHECK:STDOUT: %int.snegate.loc14_41: init i32 = call %Negate.ref.loc14_35(%.loc14_42.5) [template = constants.%.36] +// CHECK:STDOUT: %.loc14_42.1: Core.IntLiteral = int_value 10 [template = constants.%.32] +// CHECK:STDOUT: %.loc14_42.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_42.3: = bound_method %.loc14_42.1, %.loc14_42.2 [template = constants.%.33] +// CHECK:STDOUT: %.loc14_42.4: = specific_function %.loc14_42.3, @Convert.2(constants.%.1) [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked.loc14_42: init %i32 = call %.loc14_42.4(%.loc14_42.1) [template = constants.%.35] +// CHECK:STDOUT: %.loc14_42.5: %i32 = value_of_initializer %int.convert_checked.loc14_42 [template = constants.%.35] +// CHECK:STDOUT: %.loc14_42.6: %i32 = converted %.loc14_42.1, %.loc14_42.5 [template = constants.%.35] +// CHECK:STDOUT: %int.snegate.loc14_41: init %i32 = call %Negate.ref.loc14_35(%.loc14_42.6) [template = constants.%.36] // CHECK:STDOUT: %.loc14_47.1: Core.IntLiteral = int_value 2 [template = constants.%.37] -// CHECK:STDOUT: %.loc14_41.1: i32 = value_of_initializer %int.snegate.loc14_41 [template = constants.%.36] -// CHECK:STDOUT: %.loc14_41.2: i32 = converted %int.snegate.loc14_41, %.loc14_41.1 [template = constants.%.36] -// CHECK:STDOUT: %.loc14_47.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc14_41.1: %i32 = value_of_initializer %int.snegate.loc14_41 [template = constants.%.36] +// CHECK:STDOUT: %.loc14_41.2: %i32 = converted %int.snegate.loc14_41, %.loc14_41.1 [template = constants.%.36] +// CHECK:STDOUT: %.loc14_47.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] // CHECK:STDOUT: %.loc14_47.3: = bound_method %.loc14_47.1, %.loc14_47.2 [template = constants.%.38] -// CHECK:STDOUT: %int.convert_checked.loc14_47: init i32 = call %.loc14_47.3(%.loc14_47.1) [template = constants.%.39] -// CHECK:STDOUT: %.loc14_47.4: i32 = value_of_initializer %int.convert_checked.loc14_47 [template = constants.%.39] -// CHECK:STDOUT: %.loc14_47.5: i32 = converted %.loc14_47.1, %.loc14_47.4 [template = constants.%.39] -// CHECK:STDOUT: %int.right_shift.loc14: init i32 = call %RightShift.ref.loc14(%.loc14_41.2, %.loc14_47.5) [template = constants.%.40] -// CHECK:STDOUT: %.loc14_34.1: i32 = value_of_initializer %int.right_shift.loc14 [template = constants.%.40] -// CHECK:STDOUT: %.loc14_34.2: i32 = converted %int.right_shift.loc14, %.loc14_34.1 [template = constants.%.40] -// CHECK:STDOUT: %int.snegate.loc14_23: init i32 = call %Negate.ref.loc14_17(%.loc14_34.2) [template = constants.%.41] -// CHECK:STDOUT: %.loc14_12.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] -// CHECK:STDOUT: %.loc14_12.2: type = converted %int.make_type_32.loc14, %.loc14_12.1 [template = i32] -// CHECK:STDOUT: %.loc14_23.1: %Convert.type.5 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc14_23.2: = bound_method %int.snegate.loc14_23, %.loc14_23.1 [template = constants.%.42] -// CHECK:STDOUT: %.loc14_23.3: i32 = value_of_initializer %int.snegate.loc14_23 [template = constants.%.41] -// CHECK:STDOUT: %.loc14_23.4: i32 = converted %int.snegate.loc14_23, %.loc14_23.3 [template = constants.%.41] -// CHECK:STDOUT: %int.convert_checked.loc14_23: init Core.IntLiteral = call %.loc14_23.2(%.loc14_23.4) [template = constants.%.43] -// CHECK:STDOUT: %.loc14_23.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_23 [template = constants.%.43] -// CHECK:STDOUT: %.loc14_23.6: Core.IntLiteral = converted %int.snegate.loc14_23, %.loc14_23.5 [template = constants.%.43] -// CHECK:STDOUT: %.loc14_50: type = array_type %.loc14_23.6, i32 [template = constants.%.44] -// CHECK:STDOUT: %arr2.var: ref %.44 = var arr2 -// CHECK:STDOUT: %arr2: ref %.44 = bind_name arr2, %arr2.var -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_19: Core.IntLiteral = int_value 3 [template = constants.%.43] -// CHECK:STDOUT: %.loc15_14.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_14.2: type = converted %int.make_type_32.loc15, %.loc15_14.1 [template = i32] -// CHECK:STDOUT: %.loc15_20: type = array_type %.loc15_19, i32 [template = constants.%.44] -// CHECK:STDOUT: %.loc15_21: type = ptr_type %.44 [template = constants.%.45] +// CHECK:STDOUT: %.loc14_47.4: = specific_function %.loc14_47.3, @Convert.2(constants.%.1) [template = constants.%.39] +// CHECK:STDOUT: %int.convert_checked.loc14_47: init %i32 = call %.loc14_47.4(%.loc14_47.1) [template = constants.%.40] +// CHECK:STDOUT: %.loc14_47.5: %i32 = value_of_initializer %int.convert_checked.loc14_47 [template = constants.%.40] +// CHECK:STDOUT: %.loc14_47.6: %i32 = converted %.loc14_47.1, %.loc14_47.5 [template = constants.%.40] +// CHECK:STDOUT: %int.right_shift.loc14: init %i32 = call %RightShift.ref.loc14(%.loc14_41.2, %.loc14_47.6) [template = constants.%.41] +// CHECK:STDOUT: %.loc14_34.1: %i32 = value_of_initializer %int.right_shift.loc14 [template = constants.%.41] +// CHECK:STDOUT: %.loc14_34.2: %i32 = converted %int.right_shift.loc14, %.loc14_34.1 [template = constants.%.41] +// CHECK:STDOUT: %int.snegate.loc14_23: init %i32 = call %Negate.ref.loc14_17(%.loc14_34.2) [template = constants.%.42] +// CHECK:STDOUT: %.loc14_12.2: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_12.3: type = converted %int.make_type_signed.loc14, %.loc14_12.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_23.1: %Convert.type.6 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc14_23.2: = bound_method %int.snegate.loc14_23, %.loc14_23.1 [template = constants.%.43] +// CHECK:STDOUT: %.loc14_23.3: = specific_function %.loc14_23.2, @Convert.4(constants.%.1) [template = constants.%.44] +// CHECK:STDOUT: %.loc14_23.4: %i32 = value_of_initializer %int.snegate.loc14_23 [template = constants.%.42] +// CHECK:STDOUT: %.loc14_23.5: %i32 = converted %int.snegate.loc14_23, %.loc14_23.4 [template = constants.%.42] +// CHECK:STDOUT: %int.convert_checked.loc14_23: init Core.IntLiteral = call %.loc14_23.3(%.loc14_23.5) [template = constants.%.45] +// CHECK:STDOUT: %.loc14_23.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_23 [template = constants.%.45] +// CHECK:STDOUT: %.loc14_23.7: Core.IntLiteral = converted %int.snegate.loc14_23, %.loc14_23.6 [template = constants.%.45] +// CHECK:STDOUT: %.loc14_50: type = array_type %.loc14_23.7, %i32 [template = constants.%.46] +// CHECK:STDOUT: %arr2.var: ref %.46 = var arr2 +// CHECK:STDOUT: %arr2: ref %.46 = bind_name arr2, %arr2.var +// CHECK:STDOUT: %.loc15_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_19: Core.IntLiteral = int_value 3 [template = constants.%.45] +// CHECK:STDOUT: %.loc15_14.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_14.3: type = converted %int.make_type_signed.loc15, %.loc15_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_20: type = array_type %.loc15_19, %i32 [template = constants.%.46] +// CHECK:STDOUT: %.loc15_21: type = ptr_type %.46 [template = constants.%.47] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RightShift(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.right_shift"; +// CHECK:STDOUT: fn @RightShift(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.right_shift"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr1.ref: ref %.31 = name_ref arr1, file.%arr1 -// CHECK:STDOUT: %.loc11: %.32 = addr_of %arr1.ref -// CHECK:STDOUT: %arr1_p: %.32 = bind_name arr1_p, %.loc11 -// CHECK:STDOUT: %arr2.ref: ref %.44 = name_ref arr2, file.%arr2 -// CHECK:STDOUT: %.loc15: %.45 = addr_of %arr2.ref -// CHECK:STDOUT: %arr2_p: %.45 = bind_name arr2_p, %.loc15 +// CHECK:STDOUT: %arr1.ref: ref %.30 = name_ref arr1, file.%arr1 +// CHECK:STDOUT: %.loc11: %.31 = addr_of %arr1.ref +// CHECK:STDOUT: %arr1_p: %.31 = bind_name arr1_p, %.loc11 +// CHECK:STDOUT: %arr2.ref: ref %.46 = name_ref arr2, file.%arr2 +// CHECK:STDOUT: %.loc15: %.47 = addr_of %arr2.ref +// CHECK:STDOUT: %arr2_p: %.47 = bind_name arr2_p, %.loc15 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_bad_shift.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %RightShift.type: type = fn_type @RightShift [template] // CHECK:STDOUT: %RightShift: %RightShift.type = struct_value () [template] // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 31 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 31 [template] -// CHECK:STDOUT: %.31: i32 = int_value 0 [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 32 [template] -// CHECK:STDOUT: %.35: Core.IntLiteral = int_value 33 [template] -// CHECK:STDOUT: %.36: = bound_method %.35, %Convert.15 [template] -// CHECK:STDOUT: %.37: i32 = int_value 33 [template] -// CHECK:STDOUT: %.38: i32 = int_value -1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 31 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 31 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.31: = bound_method %.1, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 32 [template] +// CHECK:STDOUT: %.34: Core.IntLiteral = int_value 33 [template] +// CHECK:STDOUT: %.35: = bound_method %.34, %Convert.14 [template] +// CHECK:STDOUT: %.36: = specific_function %.35, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.37: %i32 = int_value 33 [template] +// CHECK:STDOUT: %.38: %i32 = int_value -1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -465,138 +508,155 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %RightShift.decl: %RightShift.type = fn_decl @RightShift [template = constants.%RightShift] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_18.1: type = value_of_initializer %int.make_type_32.loc4_18 [template = i32] -// CHECK:STDOUT: %.loc4_18.2: type = converted %int.make_type_32.loc4_18, %.loc4_18.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_26: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_26.1: type = value_of_initializer %int.make_type_32.loc4_26 [template = i32] -// CHECK:STDOUT: %.loc4_26.2: type = converted %int.make_type_32.loc4_26, %.loc4_26.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_34.1: type = value_of_initializer %int.make_type_32.loc4_34 [template = i32] -// CHECK:STDOUT: %.loc4_34.2: type = converted %int.make_type_32.loc4_34, %.loc4_34.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_18: init type = call constants.%Int(%.loc4_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_18.2: type = value_of_initializer %int.make_type_signed.loc4_18 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_18.3: type = converted %int.make_type_signed.loc4_18, %.loc4_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_26.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_26: init type = call constants.%Int(%.loc4_26.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_26.2: type = value_of_initializer %int.make_type_signed.loc4_26 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_26.3: type = converted %int.make_type_signed.loc4_26, %.loc4_26.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_34.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_34: init type = call constants.%Int(%.loc4_34.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_34.2: type = value_of_initializer %int.make_type_signed.loc4_34 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_34.3: type = converted %int.make_type_signed.loc4_34, %.loc4_34.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc5_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_14.1: type = value_of_initializer %int.make_type_32.loc5_14 [template = i32] -// CHECK:STDOUT: %.loc5_14.2: type = converted %int.make_type_32.loc5_14, %.loc5_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int.make_type_32.loc5_22 [template = i32] -// CHECK:STDOUT: %.loc5_22.2: type = converted %int.make_type_32.loc5_22, %.loc5_22.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc5_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_14: init type = call constants.%Int(%.loc5_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_14.2: type = value_of_initializer %int.make_type_signed.loc5_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_14.3: type = converted %int.make_type_signed.loc5_14, %.loc5_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_22: init type = call constants.%Int(%.loc5_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_22.2: type = value_of_initializer %int.make_type_signed.loc5_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_22.3: type = converted %int.make_type_signed.loc5_22, %.loc5_22.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] -// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_32.loc8, %.loc8_13.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32.loc13, %.loc13_13.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_13.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] -// CHECK:STDOUT: %.loc18_13.2: type = converted %int.make_type_32.loc18, %.loc18_13.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc24: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc24_15.1: type = value_of_initializer %int.make_type_32.loc24 [template = i32] -// CHECK:STDOUT: %.loc24_15.2: type = converted %int.make_type_32.loc24, %.loc24_15.1 [template = i32] +// CHECK:STDOUT: %.loc8_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_13.2: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_13.3: type = converted %int.make_type_signed.loc8, %.loc8_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_13.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_13.3: type = converted %int.make_type_signed.loc13, %.loc13_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%.loc18_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_13.2: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_13.3: type = converted %int.make_type_signed.loc18, %.loc18_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc24_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc24: init type = call constants.%Int(%.loc24_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc24_15.2: type = value_of_initializer %int.make_type_signed.loc24 [template = constants.%i32] +// CHECK:STDOUT: %.loc24_15.3: type = converted %int.make_type_signed.loc24, %.loc24_15.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RightShift(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.right_shift"; +// CHECK:STDOUT: fn @RightShift(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.right_shift"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %RightShift.ref.loc8: %RightShift.type = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] -// CHECK:STDOUT: %.loc8_30.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc8_33.1: Core.IntLiteral = int_value 31 [template = constants.%.2] -// CHECK:STDOUT: %.loc8_30.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_30.3: = bound_method %.loc8_30.1, %.loc8_30.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc8_30: init i32 = call %.loc8_30.3(%.loc8_30.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc8_30.4: i32 = value_of_initializer %int.convert_checked.loc8_30 [template = constants.%.28] -// CHECK:STDOUT: %.loc8_30.5: i32 = converted %.loc8_30.1, %.loc8_30.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc8_33.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_33.3: = bound_method %.loc8_33.1, %.loc8_33.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc8_33: init i32 = call %.loc8_33.3(%.loc8_33.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc8_33.4: i32 = value_of_initializer %int.convert_checked.loc8_33 [template = constants.%.30] -// CHECK:STDOUT: %.loc8_33.5: i32 = converted %.loc8_33.1, %.loc8_33.4 [template = constants.%.30] -// CHECK:STDOUT: %int.right_shift.loc8: init i32 = call %RightShift.ref.loc8(%.loc8_30.5, %.loc8_33.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc8_36.1: i32 = value_of_initializer %int.right_shift.loc8 [template = constants.%.31] -// CHECK:STDOUT: %.loc8_36.2: i32 = converted %int.right_shift.loc8, %.loc8_36.1 [template = constants.%.31] -// CHECK:STDOUT: %size_1: i32 = bind_name size_1, %.loc8_36.2 +// CHECK:STDOUT: %.loc8_30.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc8_33.1: Core.IntLiteral = int_value 31 [template = constants.%.3] +// CHECK:STDOUT: %.loc8_30.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_30.3: = bound_method %.loc8_30.1, %.loc8_30.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc8_30.4: = specific_function %.loc8_30.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc8_30: init %i32 = call %.loc8_30.4(%.loc8_30.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc8_30.5: %i32 = value_of_initializer %int.convert_checked.loc8_30 [template = constants.%.26] +// CHECK:STDOUT: %.loc8_30.6: %i32 = converted %.loc8_30.1, %.loc8_30.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc8_33.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_33.3: = bound_method %.loc8_33.1, %.loc8_33.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc8_33.4: = specific_function %.loc8_33.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc8_33: init %i32 = call %.loc8_33.4(%.loc8_33.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc8_33.5: %i32 = value_of_initializer %int.convert_checked.loc8_33 [template = constants.%.29] +// CHECK:STDOUT: %.loc8_33.6: %i32 = converted %.loc8_33.1, %.loc8_33.5 [template = constants.%.29] +// CHECK:STDOUT: %int.right_shift.loc8: init %i32 = call %RightShift.ref.loc8(%.loc8_30.6, %.loc8_33.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc8_36.1: %i32 = value_of_initializer %int.right_shift.loc8 [template = constants.%.30] +// CHECK:STDOUT: %.loc8_36.2: %i32 = converted %int.right_shift.loc8, %.loc8_36.1 [template = constants.%.30] +// CHECK:STDOUT: %size_1: %i32 = bind_name size_1, %.loc8_36.2 // CHECK:STDOUT: %RightShift.ref.loc13: %RightShift.type = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] -// CHECK:STDOUT: %.loc13_30.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc13_33.1: Core.IntLiteral = int_value 32 [template = constants.%.32] -// CHECK:STDOUT: %.loc13_30.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_30.3: = bound_method %.loc13_30.1, %.loc13_30.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc13_30: init i32 = call %.loc13_30.3(%.loc13_30.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc13_30.4: i32 = value_of_initializer %int.convert_checked.loc13_30 [template = constants.%.28] -// CHECK:STDOUT: %.loc13_30.5: i32 = converted %.loc13_30.1, %.loc13_30.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc13_33.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_33.3: = bound_method %.loc13_33.1, %.loc13_33.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc13_33: init i32 = call %.loc13_33.3(%.loc13_33.1) [template = constants.%.34] -// CHECK:STDOUT: %.loc13_33.4: i32 = value_of_initializer %int.convert_checked.loc13_33 [template = constants.%.34] -// CHECK:STDOUT: %.loc13_33.5: i32 = converted %.loc13_33.1, %.loc13_33.4 [template = constants.%.34] -// CHECK:STDOUT: %int.right_shift.loc13: init i32 = call %RightShift.ref.loc13(%.loc13_30.5, %.loc13_33.5) [template = ] -// CHECK:STDOUT: %.loc13_36.1: i32 = value_of_initializer %int.right_shift.loc13 [template = ] -// CHECK:STDOUT: %.loc13_36.2: i32 = converted %int.right_shift.loc13, %.loc13_36.1 [template = ] -// CHECK:STDOUT: %size_2: i32 = bind_name size_2, %.loc13_36.2 +// CHECK:STDOUT: %.loc13_30.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc13_33.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %.loc13_30.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_30.3: = bound_method %.loc13_30.1, %.loc13_30.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc13_30.4: = specific_function %.loc13_30.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc13_30: init %i32 = call %.loc13_30.4(%.loc13_30.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc13_30.5: %i32 = value_of_initializer %int.convert_checked.loc13_30 [template = constants.%.26] +// CHECK:STDOUT: %.loc13_30.6: %i32 = converted %.loc13_30.1, %.loc13_30.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc13_33.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_33.3: = bound_method %.loc13_33.1, %.loc13_33.2 [template = constants.%.31] +// CHECK:STDOUT: %.loc13_33.4: = specific_function %.loc13_33.3, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc13_33: init %i32 = call %.loc13_33.4(%.loc13_33.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc13_33.5: %i32 = value_of_initializer %int.convert_checked.loc13_33 [template = constants.%.33] +// CHECK:STDOUT: %.loc13_33.6: %i32 = converted %.loc13_33.1, %.loc13_33.5 [template = constants.%.33] +// CHECK:STDOUT: %int.right_shift.loc13: init %i32 = call %RightShift.ref.loc13(%.loc13_30.6, %.loc13_33.6) [template = ] +// CHECK:STDOUT: %.loc13_36.1: %i32 = value_of_initializer %int.right_shift.loc13 [template = ] +// CHECK:STDOUT: %.loc13_36.2: %i32 = converted %int.right_shift.loc13, %.loc13_36.1 [template = ] +// CHECK:STDOUT: %size_2: %i32 = bind_name size_2, %.loc13_36.2 // CHECK:STDOUT: %RightShift.ref.loc18: %RightShift.type = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] -// CHECK:STDOUT: %.loc18_30.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc18_33.1: Core.IntLiteral = int_value 33 [template = constants.%.35] -// CHECK:STDOUT: %.loc18_30.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_30.3: = bound_method %.loc18_30.1, %.loc18_30.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc18_30: init i32 = call %.loc18_30.3(%.loc18_30.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc18_30.4: i32 = value_of_initializer %int.convert_checked.loc18_30 [template = constants.%.28] -// CHECK:STDOUT: %.loc18_30.5: i32 = converted %.loc18_30.1, %.loc18_30.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc18_33.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_33.3: = bound_method %.loc18_33.1, %.loc18_33.2 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc18_33: init i32 = call %.loc18_33.3(%.loc18_33.1) [template = constants.%.37] -// CHECK:STDOUT: %.loc18_33.4: i32 = value_of_initializer %int.convert_checked.loc18_33 [template = constants.%.37] -// CHECK:STDOUT: %.loc18_33.5: i32 = converted %.loc18_33.1, %.loc18_33.4 [template = constants.%.37] -// CHECK:STDOUT: %int.right_shift.loc18: init i32 = call %RightShift.ref.loc18(%.loc18_30.5, %.loc18_33.5) [template = ] -// CHECK:STDOUT: %.loc18_36.1: i32 = value_of_initializer %int.right_shift.loc18 [template = ] -// CHECK:STDOUT: %.loc18_36.2: i32 = converted %int.right_shift.loc18, %.loc18_36.1 [template = ] -// CHECK:STDOUT: %size_3: i32 = bind_name size_3, %.loc18_36.2 +// CHECK:STDOUT: %.loc18_30.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc18_33.1: Core.IntLiteral = int_value 33 [template = constants.%.34] +// CHECK:STDOUT: %.loc18_30.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_30.3: = bound_method %.loc18_30.1, %.loc18_30.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc18_30.4: = specific_function %.loc18_30.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc18_30: init %i32 = call %.loc18_30.4(%.loc18_30.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc18_30.5: %i32 = value_of_initializer %int.convert_checked.loc18_30 [template = constants.%.26] +// CHECK:STDOUT: %.loc18_30.6: %i32 = converted %.loc18_30.1, %.loc18_30.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc18_33.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_33.3: = bound_method %.loc18_33.1, %.loc18_33.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc18_33.4: = specific_function %.loc18_33.3, @Convert.2(constants.%.1) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc18_33: init %i32 = call %.loc18_33.4(%.loc18_33.1) [template = constants.%.37] +// CHECK:STDOUT: %.loc18_33.5: %i32 = value_of_initializer %int.convert_checked.loc18_33 [template = constants.%.37] +// CHECK:STDOUT: %.loc18_33.6: %i32 = converted %.loc18_33.1, %.loc18_33.5 [template = constants.%.37] +// CHECK:STDOUT: %int.right_shift.loc18: init %i32 = call %RightShift.ref.loc18(%.loc18_30.6, %.loc18_33.6) [template = ] +// CHECK:STDOUT: %.loc18_36.1: %i32 = value_of_initializer %int.right_shift.loc18 [template = ] +// CHECK:STDOUT: %.loc18_36.2: %i32 = converted %int.right_shift.loc18, %.loc18_36.1 [template = ] +// CHECK:STDOUT: %size_3: %i32 = bind_name size_3, %.loc18_36.2 // CHECK:STDOUT: %RightShift.ref.loc24: %RightShift.type = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] -// CHECK:STDOUT: %.loc24_32.1: Core.IntLiteral = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc24_32.1: Core.IntLiteral = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc24_42.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc24_42.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc24_42.3: = bound_method %.loc24_42.1, %.loc24_42.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc24_42: init i32 = call %.loc24_42.3(%.loc24_42.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc24_42.4: i32 = value_of_initializer %int.convert_checked.loc24_42 [template = constants.%.28] -// CHECK:STDOUT: %.loc24_42.5: i32 = converted %.loc24_42.1, %.loc24_42.4 [template = constants.%.28] -// CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc24_42.5) [template = constants.%.38] -// CHECK:STDOUT: %.loc24_32.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc24_32.3: = bound_method %.loc24_32.1, %.loc24_32.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc24_32: init i32 = call %.loc24_32.3(%.loc24_32.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc24_32.4: i32 = value_of_initializer %int.convert_checked.loc24_32 [template = constants.%.28] -// CHECK:STDOUT: %.loc24_32.5: i32 = converted %.loc24_32.1, %.loc24_32.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc24_41.1: i32 = value_of_initializer %int.snegate [template = constants.%.38] -// CHECK:STDOUT: %.loc24_41.2: i32 = converted %int.snegate, %.loc24_41.1 [template = constants.%.38] -// CHECK:STDOUT: %int.right_shift.loc24: init i32 = call %RightShift.ref.loc24(%.loc24_32.5, %.loc24_41.2) [template = ] -// CHECK:STDOUT: %.loc24_45.1: i32 = value_of_initializer %int.right_shift.loc24 [template = ] -// CHECK:STDOUT: %.loc24_45.2: i32 = converted %int.right_shift.loc24, %.loc24_45.1 [template = ] -// CHECK:STDOUT: %negative: i32 = bind_name negative, %.loc24_45.2 +// CHECK:STDOUT: %.loc24_42.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc24_42.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc24_42.3: = bound_method %.loc24_42.1, %.loc24_42.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc24_42.4: = specific_function %.loc24_42.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc24_42: init %i32 = call %.loc24_42.4(%.loc24_42.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc24_42.5: %i32 = value_of_initializer %int.convert_checked.loc24_42 [template = constants.%.26] +// CHECK:STDOUT: %.loc24_42.6: %i32 = converted %.loc24_42.1, %.loc24_42.5 [template = constants.%.26] +// CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc24_42.6) [template = constants.%.38] +// CHECK:STDOUT: %.loc24_32.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc24_32.3: = bound_method %.loc24_32.1, %.loc24_32.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc24_32.4: = specific_function %.loc24_32.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc24_32: init %i32 = call %.loc24_32.4(%.loc24_32.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc24_32.5: %i32 = value_of_initializer %int.convert_checked.loc24_32 [template = constants.%.26] +// CHECK:STDOUT: %.loc24_32.6: %i32 = converted %.loc24_32.1, %.loc24_32.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc24_41.1: %i32 = value_of_initializer %int.snegate [template = constants.%.38] +// CHECK:STDOUT: %.loc24_41.2: %i32 = converted %int.snegate, %.loc24_41.1 [template = constants.%.38] +// CHECK:STDOUT: %int.right_shift.loc24: init %i32 = call %RightShift.ref.loc24(%.loc24_32.6, %.loc24_41.2) [template = ] +// CHECK:STDOUT: %.loc24_45.1: %i32 = value_of_initializer %int.right_shift.loc24 [template = ] +// CHECK:STDOUT: %.loc24_45.2: %i32 = converted %int.right_shift.loc24, %.loc24_45.1 [template = ] +// CHECK:STDOUT: %negative: %i32 = bind_name negative, %.loc24_45.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/sadd.carbon b/toolchain/check/testdata/builtins/int/sadd.carbon index 039dd4910bdb..3133e90a6c1a 100644 --- a/toolchain/check/testdata/builtins/int/sadd.carbon +++ b/toolchain/check/testdata/builtins/int/sadd.carbon @@ -92,28 +92,33 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: --- int_add.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Add.type: type = fn_type @Add [template] // CHECK:STDOUT: %Add: %Add.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 3 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] -// CHECK:STDOUT: %.31: i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.16 [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.15 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.4(%.1) [template] // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.35: type = array_type %.34, i32 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, %i32 [template] // CHECK:STDOUT: %.36: type = ptr_type %.35 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] @@ -121,7 +126,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -138,98 +143,109 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%.loc2_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.3: type = converted %int.make_type_signed.loc2_11, %.loc2_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%.loc2_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.3: type = converted %int.make_type_signed.loc2_19, %.loc2_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%.loc2_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.2: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.3: type = converted %int.make_type_signed.loc2_27, %.loc2_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] -// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init i32 = call %.loc4_20.3(%.loc4_20.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.4: i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.5: i32 = converted %.loc4_20.1, %.loc4_20.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init i32 = call %.loc4_23.3(%.loc4_23.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.4: i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.5: i32 = converted %.loc4_23.1, %.loc4_23.4 [template = constants.%.30] -// CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%.loc4_20.5, %.loc4_23.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_19.1: %Convert.type.5 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.sadd, %.loc4_19.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.sadd [template = constants.%.31] -// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.sadd, %.loc4_19.3 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.sadd, %.loc4_19.5 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_20.4: = specific_function %.loc4_20.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %.loc4_20.4(%.loc4_20.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.5: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.6: %i32 = converted %.loc4_20.1, %.loc4_20.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_23.4: = specific_function %.loc4_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %.loc4_23.4(%.loc4_23.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.5: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.6: %i32 = converted %.loc4_23.1, %.loc4_23.5 [template = constants.%.29] +// CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%.loc4_20.6, %.loc4_23.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.6 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.sadd, %.loc4_19.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc4_19.3: = specific_function %.loc4_19.2, @Convert.4(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc4_19.4: %i32 = value_of_initializer %int.sadd [template = constants.%.30] +// CHECK:STDOUT: %.loc4_19.5: %i32 = converted %int.sadd, %.loc4_19.4 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.3(%.loc4_19.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.7: Core.IntLiteral = converted %int.sadd, %.loc4_19.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.7, %i32 [template = constants.%.35] // CHECK:STDOUT: %arr.var: ref %.35 = var arr // CHECK:STDOUT: %arr: ref %.35 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_13.1) [template = constants.%i32] // CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 3 [template = constants.%.34] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_13.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_13.3: type = converted %int.make_type_signed.loc5, %.loc5_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, %i32 [template = constants.%.35] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.35 [template = constants.%.36] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.3: type = converted %int.make_type_signed.loc7_19, %.loc7_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%.loc7_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.3: type = converted %int.make_type_signed.loc7_27, %.loc7_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%.loc7_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.3: type = converted %int.make_type_signed.loc7_35, %.loc7_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @Add(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: i32 = value_of_initializer %int.sadd -// CHECK:STDOUT: %.loc8_19.2: i32 = converted %int.sadd, %.loc8_19.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%a.ref, %b.ref) +// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.sadd +// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.sadd, %.loc8_19.1 // CHECK:STDOUT: return %.loc8_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -244,8 +260,10 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: --- fail_bad_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %TooFew.type: type = fn_type @TooFew [template] // CHECK:STDOUT: %TooFew: %TooFew.type = struct_value () [template] // CHECK:STDOUT: %TooMany.type: type = fn_type @TooMany [template] @@ -256,19 +274,22 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %BadReturnType: %BadReturnType.type = struct_value () [template] // CHECK:STDOUT: %JustRight.type: type = fn_type @JustRight [template] // CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.30: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 2 [template] -// CHECK:STDOUT: %.32: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 3 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.28: = bound_method %.26, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.31: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 3 [template] // CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] // CHECK:STDOUT: %RuntimeCallTooFew: %RuntimeCallTooFew.type = struct_value () [template] // CHECK:STDOUT: %RuntimeCallTooMany.type: type = fn_type @RuntimeCallTooMany [template] @@ -279,7 +300,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude @@ -304,277 +325,306 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc8_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %int.make_type_32.loc8_14 [template = i32] -// CHECK:STDOUT: %.loc8_14.2: type = converted %int.make_type_32.loc8_14, %.loc8_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc8_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_22.1: type = value_of_initializer %int.make_type_32.loc8_22 [template = i32] -// CHECK:STDOUT: %.loc8_22.2: type = converted %int.make_type_32.loc8_22, %.loc8_22.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc8_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8_14: init type = call constants.%Int(%.loc8_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_14.2: type = value_of_initializer %int.make_type_signed.loc8_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_14.3: type = converted %int.make_type_signed.loc8_14, %.loc8_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8_22: init type = call constants.%Int(%.loc8_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_22.2: type = value_of_initializer %int.make_type_signed.loc8_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_22.3: type = converted %int.make_type_signed.loc8_22, %.loc8_22.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %c.patt: i32 = binding_pattern c -// CHECK:STDOUT: %c.param_patt: i32 = value_param_pattern %c.patt, runtime_param2 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param3 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %c.patt: %i32 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %i32 = value_param_pattern %c.patt, runtime_param2 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc13_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %int.make_type_32.loc13_15 [template = i32] -// CHECK:STDOUT: %.loc13_15.2: type = converted %int.make_type_32.loc13_15, %.loc13_15.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_32.loc13_23 [template = i32] -// CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_32.loc13_23, %.loc13_23.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_31: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_32.loc13_31 [template = i32] -// CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_32.loc13_31, %.loc13_31.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_39: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_39.1: type = value_of_initializer %int.make_type_32.loc13_39 [template = i32] -// CHECK:STDOUT: %.loc13_39.2: type = converted %int.make_type_32.loc13_39, %.loc13_39.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %c.param: i32 = value_param runtime_param2 -// CHECK:STDOUT: %c: i32 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param3 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc13_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_15: init type = call constants.%Int(%.loc13_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_15.2: type = value_of_initializer %int.make_type_signed.loc13_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_15.3: type = converted %int.make_type_signed.loc13_15, %.loc13_15.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_23: init type = call constants.%Int(%.loc13_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_23.2: type = value_of_initializer %int.make_type_signed.loc13_23 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_23.3: type = converted %int.make_type_signed.loc13_23, %.loc13_23.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_31: init type = call constants.%Int(%.loc13_31.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.2: type = value_of_initializer %int.make_type_signed.loc13_31 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.3: type = converted %int.make_type_signed.loc13_31, %.loc13_31.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_39.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_39: init type = call constants.%Int(%.loc13_39.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_39.2: type = value_of_initializer %int.make_type_signed.loc13_39 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_39.3: type = converted %int.make_type_signed.loc13_39, %.loc13_39.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %c.param: %i32 = value_param runtime_param2 +// CHECK:STDOUT: %c: %i32 = bind_name c, %c.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc18_21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_32.loc18_21 [template = i32] -// CHECK:STDOUT: %.loc18_21.2: type = converted %int.make_type_32.loc18_21, %.loc18_21.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc18_29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %int.make_type_32.loc18_29 [template = i32] -// CHECK:STDOUT: %.loc18_29.2: type = converted %int.make_type_32.loc18_29, %.loc18_29.1 [template = i32] +// CHECK:STDOUT: %.loc18_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18_21: init type = call constants.%Int(%.loc18_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_21.2: type = value_of_initializer %int.make_type_signed.loc18_21 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_21.3: type = converted %int.make_type_signed.loc18_21, %.loc18_21.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_29.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18_29: init type = call constants.%Int(%.loc18_29.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_29.2: type = value_of_initializer %int.make_type_signed.loc18_29 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_29.3: type = converted %int.make_type_signed.loc18_29, %.loc18_29.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc19_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_32.loc19_17 [template = i32] -// CHECK:STDOUT: %.loc19_17.2: type = converted %int.make_type_32.loc19_17, %.loc19_17.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc19_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_25.1: type = value_of_initializer %int.make_type_32.loc19_25 [template = i32] -// CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_32.loc19_25, %.loc19_25.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc19_33: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_33.1: type = value_of_initializer %int.make_type_32.loc19_33 [template = i32] -// CHECK:STDOUT: %.loc19_33.2: type = converted %int.make_type_32.loc19_33, %.loc19_33.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc19_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19_17: init type = call constants.%Int(%.loc19_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_17.2: type = value_of_initializer %int.make_type_signed.loc19_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_17.3: type = converted %int.make_type_signed.loc19_17, %.loc19_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19_25: init type = call constants.%Int(%.loc19_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_25.2: type = value_of_initializer %int.make_type_signed.loc19_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_25.3: type = converted %int.make_type_signed.loc19_25, %.loc19_25.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_33.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19_33: init type = call constants.%Int(%.loc19_33.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_33.2: type = value_of_initializer %int.make_type_signed.loc19_33 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_33.3: type = converted %int.make_type_signed.loc19_33, %.loc19_33.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc25_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc25: init type = call constants.%Int(%.loc25_15.1) [template = constants.%i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %.loc25_27.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc25_27.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc25_27.3: = bound_method %.loc25_27.1, %.loc25_27.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc25: init i32 = call %.loc25_27.3(%.loc25_27.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc25_27.4: i32 = value_of_initializer %int.convert_checked.loc25 [template = constants.%.27] -// CHECK:STDOUT: %.loc25_27.5: i32 = converted %.loc25_27.1, %.loc25_27.4 [template = constants.%.27] -// CHECK:STDOUT: %TooFew.call: init i32 = call %TooFew.ref(%.loc25_27.5) -// CHECK:STDOUT: %.loc25_15.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] -// CHECK:STDOUT: %.loc25_15.2: type = converted %int.make_type_32.loc25, %.loc25_15.1 [template = i32] +// CHECK:STDOUT: %.loc25_27.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc25_27.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc25_27.3: = bound_method %.loc25_27.1, %.loc25_27.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc25_27.4: = specific_function %.loc25_27.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc25: init %i32 = call %.loc25_27.4(%.loc25_27.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc25_27.5: %i32 = value_of_initializer %int.convert_checked.loc25 [template = constants.%.25] +// CHECK:STDOUT: %.loc25_27.6: %i32 = converted %.loc25_27.1, %.loc25_27.5 [template = constants.%.25] +// CHECK:STDOUT: %TooFew.call: init %i32 = call %TooFew.ref(%.loc25_27.6) +// CHECK:STDOUT: %.loc25_15.2: type = value_of_initializer %int.make_type_signed.loc25 [template = constants.%i32] +// CHECK:STDOUT: %.loc25_15.3: type = converted %int.make_type_signed.loc25, %.loc25_15.2 [template = constants.%i32] // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var -// CHECK:STDOUT: %int.make_type_32.loc30: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc30_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc30: init type = call constants.%Int(%.loc30_16.1) [template = constants.%i32] // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, %TooMany.decl [template = constants.%TooMany] -// CHECK:STDOUT: %.loc30_29.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc30_32.1: Core.IntLiteral = int_value 2 [template = constants.%.28] -// CHECK:STDOUT: %.loc30_35.1: Core.IntLiteral = int_value 3 [template = constants.%.29] -// CHECK:STDOUT: %.loc30_29.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc30_29.3: = bound_method %.loc30_29.1, %.loc30_29.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc30_29: init i32 = call %.loc30_29.3(%.loc30_29.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc30_29.4: i32 = value_of_initializer %int.convert_checked.loc30_29 [template = constants.%.27] -// CHECK:STDOUT: %.loc30_29.5: i32 = converted %.loc30_29.1, %.loc30_29.4 [template = constants.%.27] -// CHECK:STDOUT: %.loc30_32.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc30_32.3: = bound_method %.loc30_32.1, %.loc30_32.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc30_32: init i32 = call %.loc30_32.3(%.loc30_32.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc30_32.4: i32 = value_of_initializer %int.convert_checked.loc30_32 [template = constants.%.31] -// CHECK:STDOUT: %.loc30_32.5: i32 = converted %.loc30_32.1, %.loc30_32.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc30_35.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc30_35.3: = bound_method %.loc30_35.1, %.loc30_35.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc30_35: init i32 = call %.loc30_35.3(%.loc30_35.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc30_35.4: i32 = value_of_initializer %int.convert_checked.loc30_35 [template = constants.%.33] -// CHECK:STDOUT: %.loc30_35.5: i32 = converted %.loc30_35.1, %.loc30_35.4 [template = constants.%.33] -// CHECK:STDOUT: %TooMany.call: init i32 = call %TooMany.ref(%.loc30_29.5, %.loc30_32.5, %.loc30_35.5) -// CHECK:STDOUT: %.loc30_16.1: type = value_of_initializer %int.make_type_32.loc30 [template = i32] -// CHECK:STDOUT: %.loc30_16.2: type = converted %int.make_type_32.loc30, %.loc30_16.1 [template = i32] +// CHECK:STDOUT: %.loc30_29.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc30_32.1: Core.IntLiteral = int_value 2 [template = constants.%.26] +// CHECK:STDOUT: %.loc30_35.1: Core.IntLiteral = int_value 3 [template = constants.%.27] +// CHECK:STDOUT: %.loc30_29.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc30_29.3: = bound_method %.loc30_29.1, %.loc30_29.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc30_29.4: = specific_function %.loc30_29.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc30_29: init %i32 = call %.loc30_29.4(%.loc30_29.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc30_29.5: %i32 = value_of_initializer %int.convert_checked.loc30_29 [template = constants.%.25] +// CHECK:STDOUT: %.loc30_29.6: %i32 = converted %.loc30_29.1, %.loc30_29.5 [template = constants.%.25] +// CHECK:STDOUT: %.loc30_32.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc30_32.3: = bound_method %.loc30_32.1, %.loc30_32.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc30_32.4: = specific_function %.loc30_32.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc30_32: init %i32 = call %.loc30_32.4(%.loc30_32.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc30_32.5: %i32 = value_of_initializer %int.convert_checked.loc30_32 [template = constants.%.30] +// CHECK:STDOUT: %.loc30_32.6: %i32 = converted %.loc30_32.1, %.loc30_32.5 [template = constants.%.30] +// CHECK:STDOUT: %.loc30_35.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc30_35.3: = bound_method %.loc30_35.1, %.loc30_35.2 [template = constants.%.31] +// CHECK:STDOUT: %.loc30_35.4: = specific_function %.loc30_35.3, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc30_35: init %i32 = call %.loc30_35.4(%.loc30_35.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc30_35.5: %i32 = value_of_initializer %int.convert_checked.loc30_35 [template = constants.%.33] +// CHECK:STDOUT: %.loc30_35.6: %i32 = converted %.loc30_35.1, %.loc30_35.5 [template = constants.%.33] +// CHECK:STDOUT: %TooMany.call: init %i32 = call %TooMany.ref(%.loc30_29.6, %.loc30_32.6, %.loc30_35.6) +// CHECK:STDOUT: %.loc30_16.2: type = value_of_initializer %int.make_type_signed.loc30 [template = constants.%i32] +// CHECK:STDOUT: %.loc30_16.3: type = converted %int.make_type_signed.loc30, %.loc30_16.2 [template = constants.%i32] // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var -// CHECK:STDOUT: %int.make_type_32.loc35: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc35_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc35: init type = call constants.%Int(%.loc35_23.1) [template = constants.%i32] // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %.loc35_42.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc35_45.1: Core.IntLiteral = int_value 2 [template = constants.%.28] -// CHECK:STDOUT: %.loc35_42.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc35_42.3: = bound_method %.loc35_42.1, %.loc35_42.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc35_42: init i32 = call %.loc35_42.3(%.loc35_42.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc35_42.4: i32 = value_of_initializer %int.convert_checked.loc35_42 [template = constants.%.27] -// CHECK:STDOUT: %.loc35_42.5: i32 = converted %.loc35_42.1, %.loc35_42.4 [template = constants.%.27] -// CHECK:STDOUT: %.loc35_45.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc35_45.3: = bound_method %.loc35_45.1, %.loc35_45.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc35_45: init i32 = call %.loc35_45.3(%.loc35_45.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc35_45.4: i32 = value_of_initializer %int.convert_checked.loc35_45 [template = constants.%.31] -// CHECK:STDOUT: %.loc35_45.5: i32 = converted %.loc35_45.1, %.loc35_45.4 [template = constants.%.31] -// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42.5, %.loc35_45.5) -// CHECK:STDOUT: %.loc35_23.1: type = value_of_initializer %int.make_type_32.loc35 [template = i32] -// CHECK:STDOUT: %.loc35_23.2: type = converted %int.make_type_32.loc35, %.loc35_23.1 [template = i32] +// CHECK:STDOUT: %.loc35_42.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc35_45.1: Core.IntLiteral = int_value 2 [template = constants.%.26] +// CHECK:STDOUT: %.loc35_42.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc35_42.3: = bound_method %.loc35_42.1, %.loc35_42.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc35_42.4: = specific_function %.loc35_42.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc35_42: init %i32 = call %.loc35_42.4(%.loc35_42.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc35_42.5: %i32 = value_of_initializer %int.convert_checked.loc35_42 [template = constants.%.25] +// CHECK:STDOUT: %.loc35_42.6: %i32 = converted %.loc35_42.1, %.loc35_42.5 [template = constants.%.25] +// CHECK:STDOUT: %.loc35_45.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc35_45.3: = bound_method %.loc35_45.1, %.loc35_45.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc35_45.4: = specific_function %.loc35_45.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc35_45: init %i32 = call %.loc35_45.4(%.loc35_45.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc35_45.5: %i32 = value_of_initializer %int.convert_checked.loc35_45 [template = constants.%.30] +// CHECK:STDOUT: %.loc35_45.6: %i32 = converted %.loc35_45.1, %.loc35_45.5 [template = constants.%.30] +// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42.6, %.loc35_45.6) +// CHECK:STDOUT: %.loc35_23.2: type = value_of_initializer %int.make_type_signed.loc35 [template = constants.%i32] +// CHECK:STDOUT: %.loc35_23.3: type = converted %int.make_type_signed.loc35, %.loc35_23.2 [template = constants.%i32] // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var -// CHECK:STDOUT: %int.make_type_32.loc44: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc44_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc44: init type = call constants.%Int(%.loc44_16.1) [template = constants.%i32] // CHECK:STDOUT: %JustRight.ref: %JustRight.type = name_ref JustRight, %JustRight.decl [template = constants.%JustRight] -// CHECK:STDOUT: %.loc44_31: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc44_34: Core.IntLiteral = int_value 2 [template = constants.%.28] -// CHECK:STDOUT: %.loc44_37: Core.IntLiteral = int_value 3 [template = constants.%.29] -// CHECK:STDOUT: %.loc44_16.1: type = value_of_initializer %int.make_type_32.loc44 [template = i32] -// CHECK:STDOUT: %.loc44_16.2: type = converted %int.make_type_32.loc44, %.loc44_16.1 [template = i32] -// CHECK:STDOUT: %.loc44_39: type = array_type , i32 [template = ] +// CHECK:STDOUT: %.loc44_31: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc44_34: Core.IntLiteral = int_value 2 [template = constants.%.26] +// CHECK:STDOUT: %.loc44_37: Core.IntLiteral = int_value 3 [template = constants.%.27] +// CHECK:STDOUT: %.loc44_16.2: type = value_of_initializer %int.make_type_signed.loc44 [template = constants.%i32] +// CHECK:STDOUT: %.loc44_16.3: type = converted %int.make_type_signed.loc44, %.loc44_16.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc44_39: type = array_type , %i32 [template = ] // CHECK:STDOUT: %bad_call.var: ref = var bad_call // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc46_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc46_25.1: type = value_of_initializer %int.make_type_32.loc46_25 [template = i32] -// CHECK:STDOUT: %.loc46_25.2: type = converted %int.make_type_32.loc46_25, %.loc46_25.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc46_33: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc46_33.1: type = value_of_initializer %int.make_type_32.loc46_33 [template = i32] -// CHECK:STDOUT: %.loc46_33.2: type = converted %int.make_type_32.loc46_33, %.loc46_33.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc46_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc46_25: init type = call constants.%Int(%.loc46_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc46_25.2: type = value_of_initializer %int.make_type_signed.loc46_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc46_25.3: type = converted %int.make_type_signed.loc46_25, %.loc46_25.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc46_33.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc46_33: init type = call constants.%Int(%.loc46_33.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc46_33.2: type = value_of_initializer %int.make_type_signed.loc46_33 [template = constants.%i32] +// CHECK:STDOUT: %.loc46_33.3: type = converted %int.make_type_signed.loc46_33, %.loc46_33.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %c.patt: i32 = binding_pattern c -// CHECK:STDOUT: %c.param_patt: i32 = value_param_pattern %c.patt, runtime_param2 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param3 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %c.patt: %i32 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %i32 = value_param_pattern %c.patt, runtime_param2 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc50_26: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc50_26.1: type = value_of_initializer %int.make_type_32.loc50_26 [template = i32] -// CHECK:STDOUT: %.loc50_26.2: type = converted %int.make_type_32.loc50_26, %.loc50_26.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc50_34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc50_34.1: type = value_of_initializer %int.make_type_32.loc50_34 [template = i32] -// CHECK:STDOUT: %.loc50_34.2: type = converted %int.make_type_32.loc50_34, %.loc50_34.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc50_42: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc50_42.1: type = value_of_initializer %int.make_type_32.loc50_42 [template = i32] -// CHECK:STDOUT: %.loc50_42.2: type = converted %int.make_type_32.loc50_42, %.loc50_42.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc50_50: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc50_50.1: type = value_of_initializer %int.make_type_32.loc50_50 [template = i32] -// CHECK:STDOUT: %.loc50_50.2: type = converted %int.make_type_32.loc50_50, %.loc50_50.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %c.param: i32 = value_param runtime_param2 -// CHECK:STDOUT: %c: i32 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param3 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc50_26.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc50_26: init type = call constants.%Int(%.loc50_26.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc50_26.2: type = value_of_initializer %int.make_type_signed.loc50_26 [template = constants.%i32] +// CHECK:STDOUT: %.loc50_26.3: type = converted %int.make_type_signed.loc50_26, %.loc50_26.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc50_34.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc50_34: init type = call constants.%Int(%.loc50_34.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc50_34.2: type = value_of_initializer %int.make_type_signed.loc50_34 [template = constants.%i32] +// CHECK:STDOUT: %.loc50_34.3: type = converted %int.make_type_signed.loc50_34, %.loc50_34.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc50_42.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc50_42: init type = call constants.%Int(%.loc50_42.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc50_42.2: type = value_of_initializer %int.make_type_signed.loc50_42 [template = constants.%i32] +// CHECK:STDOUT: %.loc50_42.3: type = converted %int.make_type_signed.loc50_42, %.loc50_42.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc50_50.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc50_50: init type = call constants.%Int(%.loc50_50.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc50_50.2: type = value_of_initializer %int.make_type_signed.loc50_50 [template = constants.%i32] +// CHECK:STDOUT: %.loc50_50.3: type = converted %int.make_type_signed.loc50_50, %.loc50_50.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %c.param: %i32 = value_param runtime_param2 +// CHECK:STDOUT: %c: %i32 = bind_name c, %c.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc54_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc54_32.1: type = value_of_initializer %int.make_type_32.loc54_32 [template = i32] -// CHECK:STDOUT: %.loc54_32.2: type = converted %int.make_type_32.loc54_32, %.loc54_32.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc54_40: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc54_40.1: type = value_of_initializer %int.make_type_32.loc54_40 [template = i32] -// CHECK:STDOUT: %.loc54_40.2: type = converted %int.make_type_32.loc54_40, %.loc54_40.1 [template = i32] +// CHECK:STDOUT: %.loc54_32.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc54_32: init type = call constants.%Int(%.loc54_32.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc54_32.2: type = value_of_initializer %int.make_type_signed.loc54_32 [template = constants.%i32] +// CHECK:STDOUT: %.loc54_32.3: type = converted %int.make_type_signed.loc54_32, %.loc54_32.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc54_40.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc54_40: init type = call constants.%Int(%.loc54_40.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc54_40.2: type = value_of_initializer %int.make_type_signed.loc54_40 [template = constants.%i32] +// CHECK:STDOUT: %.loc54_40.3: type = converted %int.make_type_signed.loc54_40, %.loc54_40.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc54_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc54_48.2: type = converted %bool.make_type, %.loc54_48.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooFew(%a.param_patt: i32) -> i32; +// CHECK:STDOUT: fn @TooFew(%a.param_patt: %i32) -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooMany(%a.param_patt: i32, %b.param_patt: i32, %c.param_patt: i32) -> i32; +// CHECK:STDOUT: fn @TooMany(%a.param_patt: %i32, %b.param_patt: %i32, %c.param_patt: %i32) -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: i32, %b.param_patt: i32) -> bool; +// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: %i32, %b.param_patt: %i32) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @JustRight(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @JustRight(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %TooFew.call: init i32 = call %TooFew.ref(%a.ref) -// CHECK:STDOUT: %.loc47_19.1: i32 = value_of_initializer %TooFew.call -// CHECK:STDOUT: %.loc47_19.2: i32 = converted %TooFew.call, %.loc47_19.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %TooFew.call: init %i32 = call %TooFew.ref(%a.ref) +// CHECK:STDOUT: %.loc47_19.1: %i32 = value_of_initializer %TooFew.call +// CHECK:STDOUT: %.loc47_19.2: %i32 = converted %TooFew.call, %.loc47_19.1 // CHECK:STDOUT: return %.loc47_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: i32, %b.param_patt: i32, %c.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: %i32, %b.param_patt: %i32, %c.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %c.ref: i32 = name_ref c, %c -// CHECK:STDOUT: %TooMany.call: init i32 = call %TooMany.ref(%a.ref, %b.ref, %c.ref) -// CHECK:STDOUT: %.loc51_26.1: i32 = value_of_initializer %TooMany.call -// CHECK:STDOUT: %.loc51_26.2: i32 = converted %TooMany.call, %.loc51_26.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %c.ref: %i32 = name_ref c, %c +// CHECK:STDOUT: %TooMany.call: init %i32 = call %TooMany.ref(%a.ref, %b.ref, %c.ref) +// CHECK:STDOUT: %.loc51_26.1: %i32 = value_of_initializer %TooMany.call +// CHECK:STDOUT: %.loc51_26.2: %i32 = converted %TooMany.call, %.loc51_26.1 // CHECK:STDOUT: return %.loc51_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: i32, %b.param_patt: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%a.ref, %b.ref) // CHECK:STDOUT: %.loc55_29.1: bool = value_of_initializer %BadReturnType.call // CHECK:STDOUT: %.loc55_29.2: bool = converted %BadReturnType.call, %.loc55_29.1 @@ -584,29 +634,34 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: --- fail_overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Add.type: type = fn_type @Add [template] // CHECK:STDOUT: %Add: %Add.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 0 [template] -// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.32: = bound_method %.31, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 1 [template] -// CHECK:STDOUT: %.34: i32 = int_value -2147483648 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.31: = bound_method %.30, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.34: %i32 = int_value -2147483648 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -622,75 +677,84 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4_11, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%.loc4_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.3: type = converted %int.make_type_signed.loc4_19, %.loc4_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed.loc4_27, %.loc4_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32] -// CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_32.loc10, %.loc10_8.1 [template = i32] +// CHECK:STDOUT: %.loc6_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.3: type = converted %int.make_type_signed.loc6, %.loc6_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc10: init type = call constants.%Int(%.loc10_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8.2: type = value_of_initializer %int.make_type_signed.loc10 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8.3: type = converted %int.make_type_signed.loc10, %.loc10_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @Add(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Add.ref.loc6: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] -// CHECK:STDOUT: %.loc6_18.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc6_30.1: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc6_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_18.3: = bound_method %.loc6_18.1, %.loc6_18.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc6_18: init i32 = call %.loc6_18.3(%.loc6_18.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc6_18.4: i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_18.5: i32 = converted %.loc6_18.1, %.loc6_18.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_30.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_30.3: = bound_method %.loc6_30.1, %.loc6_30.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc6_30: init i32 = call %.loc6_30.3(%.loc6_30.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc6_30.4: i32 = value_of_initializer %int.convert_checked.loc6_30 [template = constants.%.30] -// CHECK:STDOUT: %.loc6_30.5: i32 = converted %.loc6_30.1, %.loc6_30.4 [template = constants.%.30] -// CHECK:STDOUT: %int.sadd.loc6: init i32 = call %Add.ref.loc6(%.loc6_18.5, %.loc6_30.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc6_32.1: i32 = value_of_initializer %int.sadd.loc6 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_32.2: i32 = converted %int.sadd.loc6, %.loc6_32.1 [template = constants.%.28] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc6_32.2 +// CHECK:STDOUT: %.loc6_18.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc6_30.1: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc6_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_18.3: = bound_method %.loc6_18.1, %.loc6_18.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc6_18.4: = specific_function %.loc6_18.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %.loc6_18.4(%.loc6_18.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc6_18.5: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%.26] +// CHECK:STDOUT: %.loc6_18.6: %i32 = converted %.loc6_18.1, %.loc6_18.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc6_30.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_30.3: = bound_method %.loc6_30.1, %.loc6_30.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc6_30.4: = specific_function %.loc6_30.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc6_30: init %i32 = call %.loc6_30.4(%.loc6_30.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc6_30.5: %i32 = value_of_initializer %int.convert_checked.loc6_30 [template = constants.%.29] +// CHECK:STDOUT: %.loc6_30.6: %i32 = converted %.loc6_30.1, %.loc6_30.5 [template = constants.%.29] +// CHECK:STDOUT: %int.sadd.loc6: init %i32 = call %Add.ref.loc6(%.loc6_18.6, %.loc6_30.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc6_32.1: %i32 = value_of_initializer %int.sadd.loc6 [template = constants.%.26] +// CHECK:STDOUT: %.loc6_32.2: %i32 = converted %int.sadd.loc6, %.loc6_32.1 [template = constants.%.26] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc6_32.2 // CHECK:STDOUT: %Add.ref.loc10: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] -// CHECK:STDOUT: %.loc10_18.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc10_30.1: Core.IntLiteral = int_value 1 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_18.3: = bound_method %.loc10_18.1, %.loc10_18.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc10_18: init i32 = call %.loc10_18.3(%.loc10_18.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc10_18.4: i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%.28] -// CHECK:STDOUT: %.loc10_18.5: i32 = converted %.loc10_18.1, %.loc10_18.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc10_30.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_30.3: = bound_method %.loc10_30.1, %.loc10_30.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc10_30: init i32 = call %.loc10_30.3(%.loc10_30.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc10_30.4: i32 = value_of_initializer %int.convert_checked.loc10_30 [template = constants.%.33] -// CHECK:STDOUT: %.loc10_30.5: i32 = converted %.loc10_30.1, %.loc10_30.4 [template = constants.%.33] -// CHECK:STDOUT: %int.sadd.loc10: init i32 = call %Add.ref.loc10(%.loc10_18.5, %.loc10_30.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc10_32.1: i32 = value_of_initializer %int.sadd.loc10 [template = constants.%.34] -// CHECK:STDOUT: %.loc10_32.2: i32 = converted %int.sadd.loc10, %.loc10_32.1 [template = constants.%.34] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc10_32.2 +// CHECK:STDOUT: %.loc10_18.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc10_30.1: Core.IntLiteral = int_value 1 [template = constants.%.30] +// CHECK:STDOUT: %.loc10_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_18.3: = bound_method %.loc10_18.1, %.loc10_18.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc10_18.4: = specific_function %.loc10_18.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc10_18: init %i32 = call %.loc10_18.4(%.loc10_18.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc10_18.5: %i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%.26] +// CHECK:STDOUT: %.loc10_18.6: %i32 = converted %.loc10_18.1, %.loc10_18.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc10_30.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_30.3: = bound_method %.loc10_30.1, %.loc10_30.2 [template = constants.%.31] +// CHECK:STDOUT: %.loc10_30.4: = specific_function %.loc10_30.3, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc10_30: init %i32 = call %.loc10_30.4(%.loc10_30.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc10_30.5: %i32 = value_of_initializer %int.convert_checked.loc10_30 [template = constants.%.33] +// CHECK:STDOUT: %.loc10_30.6: %i32 = converted %.loc10_30.1, %.loc10_30.5 [template = constants.%.33] +// CHECK:STDOUT: %int.sadd.loc10: init %i32 = call %Add.ref.loc10(%.loc10_18.6, %.loc10_30.6) [template = constants.%.34] +// CHECK:STDOUT: %.loc10_32.1: %i32 = value_of_initializer %int.sadd.loc10 [template = constants.%.34] +// CHECK:STDOUT: %.loc10_32.2: %i32 = converted %int.sadd.loc10, %.loc10_32.1 [template = constants.%.34] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc10_32.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/sdiv.carbon b/toolchain/check/testdata/builtins/int/sdiv.carbon index 83ff76a298fb..f503e41124c6 100644 --- a/toolchain/check/testdata/builtins/int/sdiv.carbon +++ b/toolchain/check/testdata/builtins/int/sdiv.carbon @@ -60,28 +60,33 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: --- int_div.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Div.type: type = fn_type @Div [template] // CHECK:STDOUT: %Div: %Div.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 3 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 3 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.16 [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.15 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.4(%.1) [template] // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.35: type = array_type %.34, i32 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, %i32 [template] // CHECK:STDOUT: %.36: type = ptr_type %.35 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] @@ -89,7 +94,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -106,98 +111,109 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%.loc2_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.3: type = converted %int.make_type_signed.loc2_11, %.loc2_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%.loc2_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.3: type = converted %int.make_type_signed.loc2_19, %.loc2_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%.loc2_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.2: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.3: type = converted %int.make_type_signed.loc2_27, %.loc2_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, %Div.decl [template = constants.%Div] -// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init i32 = call %.loc4_20.3(%.loc4_20.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.4: i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.5: i32 = converted %.loc4_20.1, %.loc4_20.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init i32 = call %.loc4_23.3(%.loc4_23.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.4: i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.5: i32 = converted %.loc4_23.1, %.loc4_23.4 [template = constants.%.30] -// CHECK:STDOUT: %int.sdiv: init i32 = call %Div.ref(%.loc4_20.5, %.loc4_23.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_19.1: %Convert.type.5 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.sdiv, %.loc4_19.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.sdiv [template = constants.%.31] -// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.sdiv, %.loc4_19.3 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.sdiv, %.loc4_19.5 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_20.4: = specific_function %.loc4_20.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %.loc4_20.4(%.loc4_20.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.5: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.6: %i32 = converted %.loc4_20.1, %.loc4_20.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_23.4: = specific_function %.loc4_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %.loc4_23.4(%.loc4_23.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.5: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.6: %i32 = converted %.loc4_23.1, %.loc4_23.5 [template = constants.%.29] +// CHECK:STDOUT: %int.sdiv: init %i32 = call %Div.ref(%.loc4_20.6, %.loc4_23.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.6 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.sdiv, %.loc4_19.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc4_19.3: = specific_function %.loc4_19.2, @Convert.4(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc4_19.4: %i32 = value_of_initializer %int.sdiv [template = constants.%.30] +// CHECK:STDOUT: %.loc4_19.5: %i32 = converted %int.sdiv, %.loc4_19.4 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.3(%.loc4_19.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.7: Core.IntLiteral = converted %int.sdiv, %.loc4_19.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.7, %i32 [template = constants.%.35] // CHECK:STDOUT: %arr.var: ref %.35 = var arr // CHECK:STDOUT: %arr: ref %.35 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_13.1) [template = constants.%i32] // CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 1 [template = constants.%.34] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_13.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_13.3: type = converted %int.make_type_signed.loc5, %.loc5_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, %i32 [template = constants.%.35] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.35 [template = constants.%.36] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.3: type = converted %int.make_type_signed.loc7_19, %.loc7_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%.loc7_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.3: type = converted %int.make_type_signed.loc7_27, %.loc7_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%.loc7_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.3: type = converted %int.make_type_signed.loc7_35, %.loc7_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sdiv"; +// CHECK:STDOUT: fn @Div(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sdiv"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %int.sdiv: init i32 = call %Div.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: i32 = value_of_initializer %int.sdiv -// CHECK:STDOUT: %.loc8_19.2: i32 = converted %int.sdiv, %.loc8_19.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %int.sdiv: init %i32 = call %Div.ref(%a.ref, %b.ref) +// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.sdiv +// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.sdiv, %.loc8_19.1 // CHECK:STDOUT: return %.loc8_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -212,32 +228,36 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: --- fail_overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Div.type: type = fn_type @Div [template] // CHECK:STDOUT: %Div: %Div.type = struct_value () [template] // CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] // CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %.28: i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: i32 = int_value -1 [template] -// CHECK:STDOUT: %.33: i32 = int_value -2147483648 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.26: %i32 = int_value -2147483647 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: %i32 = int_value -1 [template] +// CHECK:STDOUT: %.32: %i32 = int_value -2147483648 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -256,205 +276,228 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4_11, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%.loc4_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.3: type = converted %int.make_type_signed.loc4_19, %.loc4_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed.loc4_27, %.loc4_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] -// CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_32.loc5_11, %.loc5_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_32.loc5_19 [template = i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_32.loc5_19, %.loc5_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_32.loc5_27 [template = i32] -// CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc5_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_11: init type = call constants.%Int(%.loc5_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_11.2: type = value_of_initializer %int.make_type_signed.loc5_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_11.3: type = converted %int.make_type_signed.loc5_11, %.loc5_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_19: init type = call constants.%Int(%.loc5_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.2: type = value_of_initializer %int.make_type_signed.loc5_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.3: type = converted %int.make_type_signed.loc5_19, %.loc5_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_27: init type = call constants.%Int(%.loc5_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.2: type = value_of_initializer %int.make_type_signed.loc5_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.3: type = converted %int.make_type_signed.loc5_27, %.loc5_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] -// CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_32.loc6_14, %.loc6_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc6_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_32.loc6_22 [template = i32] -// CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc6_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_14: init type = call constants.%Int(%.loc6_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_signed.loc6_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_signed.loc6_14, %.loc6_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_22: init type = call constants.%Int(%.loc6_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.2: type = value_of_initializer %int.make_type_signed.loc6_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.3: type = converted %int.make_type_signed.loc6_22, %.loc6_22.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] -// CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_32.loc9, %.loc9_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_8.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] -// CHECK:STDOUT: %.loc19_8.2: type = converted %int.make_type_32.loc19, %.loc19_8.1 [template = i32] +// CHECK:STDOUT: %.loc9_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%.loc9_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_8.2: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_8.3: type = converted %int.make_type_signed.loc9, %.loc9_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.3: type = converted %int.make_type_signed.loc12, %.loc12_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19: init type = call constants.%Int(%.loc19_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_8.2: type = value_of_initializer %int.make_type_signed.loc19 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_8.3: type = converted %int.make_type_signed.loc19, %.loc19_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sdiv"; +// CHECK:STDOUT: fn @Div(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sdiv"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.ssub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Div.ref.loc9: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc9_25.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc9_25.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_25.3: = bound_method %.loc9_25.1, %.loc9_25.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc9_25: init i32 = call %.loc9_25.3(%.loc9_25.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc9_25.4: i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%.27] -// CHECK:STDOUT: %.loc9_25.5: i32 = converted %.loc9_25.1, %.loc9_25.4 [template = constants.%.27] -// CHECK:STDOUT: %int.snegate.loc9_24: init i32 = call %Negate.ref.loc9_18(%.loc9_25.5) [template = constants.%.28] +// CHECK:STDOUT: %.loc9_25.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc9_25.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_25.3: = bound_method %.loc9_25.1, %.loc9_25.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc9_25.4: = specific_function %.loc9_25.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %.loc9_25.4(%.loc9_25.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc9_25.5: %i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%.25] +// CHECK:STDOUT: %.loc9_25.6: %i32 = converted %.loc9_25.1, %.loc9_25.5 [template = constants.%.25] +// CHECK:STDOUT: %int.snegate.loc9_24: init %i32 = call %Negate.ref.loc9_18(%.loc9_25.6) [template = constants.%.26] // CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc9_46.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc9_46.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_46.3: = bound_method %.loc9_46.1, %.loc9_46.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc9_46: init i32 = call %.loc9_46.3(%.loc9_46.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc9_46.4: i32 = value_of_initializer %int.convert_checked.loc9_46 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_46.5: i32 = converted %.loc9_46.1, %.loc9_46.4 [template = constants.%.31] -// CHECK:STDOUT: %int.snegate.loc9_45: init i32 = call %Negate.ref.loc9_39(%.loc9_46.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc9_24.1: i32 = value_of_initializer %int.snegate.loc9_24 [template = constants.%.28] -// CHECK:STDOUT: %.loc9_24.2: i32 = converted %int.snegate.loc9_24, %.loc9_24.1 [template = constants.%.28] -// CHECK:STDOUT: %.loc9_45.1: i32 = value_of_initializer %int.snegate.loc9_45 [template = constants.%.32] -// CHECK:STDOUT: %.loc9_45.2: i32 = converted %int.snegate.loc9_45, %.loc9_45.1 [template = constants.%.32] -// CHECK:STDOUT: %int.sdiv.loc9: init i32 = call %Div.ref.loc9(%.loc9_24.2, %.loc9_45.2) [template = constants.%.27] -// CHECK:STDOUT: %.loc9_49.1: i32 = value_of_initializer %int.sdiv.loc9 [template = constants.%.27] -// CHECK:STDOUT: %.loc9_49.2: i32 = converted %int.sdiv.loc9, %.loc9_49.1 [template = constants.%.27] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc9_49.2 +// CHECK:STDOUT: %.loc9_46.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_46.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_46.3: = bound_method %.loc9_46.1, %.loc9_46.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc9_46.4: = specific_function %.loc9_46.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc9_46: init %i32 = call %.loc9_46.4(%.loc9_46.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc9_46.5: %i32 = value_of_initializer %int.convert_checked.loc9_46 [template = constants.%.30] +// CHECK:STDOUT: %.loc9_46.6: %i32 = converted %.loc9_46.1, %.loc9_46.5 [template = constants.%.30] +// CHECK:STDOUT: %int.snegate.loc9_45: init %i32 = call %Negate.ref.loc9_39(%.loc9_46.6) [template = constants.%.31] +// CHECK:STDOUT: %.loc9_24.1: %i32 = value_of_initializer %int.snegate.loc9_24 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_24.2: %i32 = converted %int.snegate.loc9_24, %.loc9_24.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_45.1: %i32 = value_of_initializer %int.snegate.loc9_45 [template = constants.%.31] +// CHECK:STDOUT: %.loc9_45.2: %i32 = converted %int.snegate.loc9_45, %.loc9_45.1 [template = constants.%.31] +// CHECK:STDOUT: %int.sdiv.loc9: init %i32 = call %Div.ref.loc9(%.loc9_24.2, %.loc9_45.2) [template = constants.%.25] +// CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.sdiv.loc9 [template = constants.%.25] +// CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int.sdiv.loc9, %.loc9_49.1 [template = constants.%.25] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc9_49.2 // CHECK:STDOUT: %Div.ref.loc12: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %Sub.ref.loc12: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_29.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_29.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_29.3: = bound_method %.loc12_29.1, %.loc12_29.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc12_29: init i32 = call %.loc12_29.3(%.loc12_29.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_29.4: i32 = value_of_initializer %int.convert_checked.loc12_29 [template = constants.%.27] -// CHECK:STDOUT: %.loc12_29.5: i32 = converted %.loc12_29.1, %.loc12_29.4 [template = constants.%.27] -// CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_29.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc12_43.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc12_28.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.28] -// CHECK:STDOUT: %.loc12_28.2: i32 = converted %int.snegate.loc12, %.loc12_28.1 [template = constants.%.28] -// CHECK:STDOUT: %.loc12_43.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_43.3: = bound_method %.loc12_43.1, %.loc12_43.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc12_43: init i32 = call %.loc12_43.3(%.loc12_43.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc12_43.4: i32 = value_of_initializer %int.convert_checked.loc12_43 [template = constants.%.31] -// CHECK:STDOUT: %.loc12_43.5: i32 = converted %.loc12_43.1, %.loc12_43.4 [template = constants.%.31] -// CHECK:STDOUT: %int.ssub.loc12: init i32 = call %Sub.ref.loc12(%.loc12_28.2, %.loc12_43.5) [template = constants.%.33] -// CHECK:STDOUT: %.loc12_47.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc12_21.1: i32 = value_of_initializer %int.ssub.loc12 [template = constants.%.33] -// CHECK:STDOUT: %.loc12_21.2: i32 = converted %int.ssub.loc12, %.loc12_21.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc12_47.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_47.3: = bound_method %.loc12_47.1, %.loc12_47.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc12_47: init i32 = call %.loc12_47.3(%.loc12_47.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc12_47.4: i32 = value_of_initializer %int.convert_checked.loc12_47 [template = constants.%.31] -// CHECK:STDOUT: %.loc12_47.5: i32 = converted %.loc12_47.1, %.loc12_47.4 [template = constants.%.31] -// CHECK:STDOUT: %int.sdiv.loc12: init i32 = call %Div.ref.loc12(%.loc12_21.2, %.loc12_47.5) [template = constants.%.33] -// CHECK:STDOUT: %.loc12_49.1: i32 = value_of_initializer %int.sdiv.loc12 [template = constants.%.33] -// CHECK:STDOUT: %.loc12_49.2: i32 = converted %int.sdiv.loc12, %.loc12_49.1 [template = constants.%.33] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc12_49.2 +// CHECK:STDOUT: %.loc12_29.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_29.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_29.3: = bound_method %.loc12_29.1, %.loc12_29.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_29.4: = specific_function %.loc12_29.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %.loc12_29.4(%.loc12_29.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_29.5: %i32 = value_of_initializer %int.convert_checked.loc12_29 [template = constants.%.25] +// CHECK:STDOUT: %.loc12_29.6: %i32 = converted %.loc12_29.1, %.loc12_29.5 [template = constants.%.25] +// CHECK:STDOUT: %int.snegate.loc12: init %i32 = call %Negate.ref.loc12(%.loc12_29.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc12_43.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_28.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_28.2: %i32 = converted %int.snegate.loc12, %.loc12_28.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_43.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_43.3: = bound_method %.loc12_43.1, %.loc12_43.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc12_43.4: = specific_function %.loc12_43.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %.loc12_43.4(%.loc12_43.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc12_43.5: %i32 = value_of_initializer %int.convert_checked.loc12_43 [template = constants.%.30] +// CHECK:STDOUT: %.loc12_43.6: %i32 = converted %.loc12_43.1, %.loc12_43.5 [template = constants.%.30] +// CHECK:STDOUT: %int.ssub.loc12: init %i32 = call %Sub.ref.loc12(%.loc12_28.2, %.loc12_43.6) [template = constants.%.32] +// CHECK:STDOUT: %.loc12_47.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_21.1: %i32 = value_of_initializer %int.ssub.loc12 [template = constants.%.32] +// CHECK:STDOUT: %.loc12_21.2: %i32 = converted %int.ssub.loc12, %.loc12_21.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc12_47.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_47.3: = bound_method %.loc12_47.1, %.loc12_47.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc12_47.4: = specific_function %.loc12_47.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc12_47: init %i32 = call %.loc12_47.4(%.loc12_47.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc12_47.5: %i32 = value_of_initializer %int.convert_checked.loc12_47 [template = constants.%.30] +// CHECK:STDOUT: %.loc12_47.6: %i32 = converted %.loc12_47.1, %.loc12_47.5 [template = constants.%.30] +// CHECK:STDOUT: %int.sdiv.loc12: init %i32 = call %Div.ref.loc12(%.loc12_21.2, %.loc12_47.6) [template = constants.%.32] +// CHECK:STDOUT: %.loc12_49.1: %i32 = value_of_initializer %int.sdiv.loc12 [template = constants.%.32] +// CHECK:STDOUT: %.loc12_49.2: %i32 = converted %int.sdiv.loc12, %.loc12_49.1 [template = constants.%.32] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc12_49.2 // CHECK:STDOUT: %Div.ref.loc19: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %Sub.ref.loc19: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc19_22: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc19_29.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc19_29.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc19_29.3: = bound_method %.loc19_29.1, %.loc19_29.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc19_29: init i32 = call %.loc19_29.3(%.loc19_29.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc19_29.4: i32 = value_of_initializer %int.convert_checked.loc19_29 [template = constants.%.27] -// CHECK:STDOUT: %.loc19_29.5: i32 = converted %.loc19_29.1, %.loc19_29.4 [template = constants.%.27] -// CHECK:STDOUT: %int.snegate.loc19_28: init i32 = call %Negate.ref.loc19_22(%.loc19_29.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc19_43.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc19_28.1: i32 = value_of_initializer %int.snegate.loc19_28 [template = constants.%.28] -// CHECK:STDOUT: %.loc19_28.2: i32 = converted %int.snegate.loc19_28, %.loc19_28.1 [template = constants.%.28] -// CHECK:STDOUT: %.loc19_43.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc19_43.3: = bound_method %.loc19_43.1, %.loc19_43.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc19_43: init i32 = call %.loc19_43.3(%.loc19_43.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc19_43.4: i32 = value_of_initializer %int.convert_checked.loc19_43 [template = constants.%.31] -// CHECK:STDOUT: %.loc19_43.5: i32 = converted %.loc19_43.1, %.loc19_43.4 [template = constants.%.31] -// CHECK:STDOUT: %int.ssub.loc19: init i32 = call %Sub.ref.loc19(%.loc19_28.2, %.loc19_43.5) [template = constants.%.33] +// CHECK:STDOUT: %.loc19_29.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc19_29.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc19_29.3: = bound_method %.loc19_29.1, %.loc19_29.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc19_29.4: = specific_function %.loc19_29.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc19_29: init %i32 = call %.loc19_29.4(%.loc19_29.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc19_29.5: %i32 = value_of_initializer %int.convert_checked.loc19_29 [template = constants.%.25] +// CHECK:STDOUT: %.loc19_29.6: %i32 = converted %.loc19_29.1, %.loc19_29.5 [template = constants.%.25] +// CHECK:STDOUT: %int.snegate.loc19_28: init %i32 = call %Negate.ref.loc19_22(%.loc19_29.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc19_43.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc19_28.1: %i32 = value_of_initializer %int.snegate.loc19_28 [template = constants.%.26] +// CHECK:STDOUT: %.loc19_28.2: %i32 = converted %int.snegate.loc19_28, %.loc19_28.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc19_43.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc19_43.3: = bound_method %.loc19_43.1, %.loc19_43.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc19_43.4: = specific_function %.loc19_43.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc19_43: init %i32 = call %.loc19_43.4(%.loc19_43.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc19_43.5: %i32 = value_of_initializer %int.convert_checked.loc19_43 [template = constants.%.30] +// CHECK:STDOUT: %.loc19_43.6: %i32 = converted %.loc19_43.1, %.loc19_43.5 [template = constants.%.30] +// CHECK:STDOUT: %int.ssub.loc19: init %i32 = call %Sub.ref.loc19(%.loc19_28.2, %.loc19_43.6) [template = constants.%.32] // CHECK:STDOUT: %Negate.ref.loc19_47: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc19_54.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc19_54.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc19_54.3: = bound_method %.loc19_54.1, %.loc19_54.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc19_54: init i32 = call %.loc19_54.3(%.loc19_54.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc19_54.4: i32 = value_of_initializer %int.convert_checked.loc19_54 [template = constants.%.31] -// CHECK:STDOUT: %.loc19_54.5: i32 = converted %.loc19_54.1, %.loc19_54.4 [template = constants.%.31] -// CHECK:STDOUT: %int.snegate.loc19_53: init i32 = call %Negate.ref.loc19_47(%.loc19_54.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc19_21.1: i32 = value_of_initializer %int.ssub.loc19 [template = constants.%.33] -// CHECK:STDOUT: %.loc19_21.2: i32 = converted %int.ssub.loc19, %.loc19_21.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc19_53.1: i32 = value_of_initializer %int.snegate.loc19_53 [template = constants.%.32] -// CHECK:STDOUT: %.loc19_53.2: i32 = converted %int.snegate.loc19_53, %.loc19_53.1 [template = constants.%.32] -// CHECK:STDOUT: %int.sdiv.loc19: init i32 = call %Div.ref.loc19(%.loc19_21.2, %.loc19_53.2) [template = constants.%.33] -// CHECK:STDOUT: %.loc19_57.1: i32 = value_of_initializer %int.sdiv.loc19 [template = constants.%.33] -// CHECK:STDOUT: %.loc19_57.2: i32 = converted %int.sdiv.loc19, %.loc19_57.1 [template = constants.%.33] -// CHECK:STDOUT: %c: i32 = bind_name c, %.loc19_57.2 +// CHECK:STDOUT: %.loc19_54.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc19_54.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc19_54.3: = bound_method %.loc19_54.1, %.loc19_54.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc19_54.4: = specific_function %.loc19_54.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc19_54: init %i32 = call %.loc19_54.4(%.loc19_54.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc19_54.5: %i32 = value_of_initializer %int.convert_checked.loc19_54 [template = constants.%.30] +// CHECK:STDOUT: %.loc19_54.6: %i32 = converted %.loc19_54.1, %.loc19_54.5 [template = constants.%.30] +// CHECK:STDOUT: %int.snegate.loc19_53: init %i32 = call %Negate.ref.loc19_47(%.loc19_54.6) [template = constants.%.31] +// CHECK:STDOUT: %.loc19_21.1: %i32 = value_of_initializer %int.ssub.loc19 [template = constants.%.32] +// CHECK:STDOUT: %.loc19_21.2: %i32 = converted %int.ssub.loc19, %.loc19_21.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc19_53.1: %i32 = value_of_initializer %int.snegate.loc19_53 [template = constants.%.31] +// CHECK:STDOUT: %.loc19_53.2: %i32 = converted %int.snegate.loc19_53, %.loc19_53.1 [template = constants.%.31] +// CHECK:STDOUT: %int.sdiv.loc19: init %i32 = call %Div.ref.loc19(%.loc19_21.2, %.loc19_53.2) [template = constants.%.32] +// CHECK:STDOUT: %.loc19_57.1: %i32 = value_of_initializer %int.sdiv.loc19 [template = constants.%.32] +// CHECK:STDOUT: %.loc19_57.2: %i32 = converted %int.sdiv.loc19, %.loc19_57.1 [template = constants.%.32] +// CHECK:STDOUT: %c: %i32 = bind_name c, %.loc19_57.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_div_by_zero.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Div.type: type = fn_type @Div [template] // CHECK:STDOUT: %Div: %Div.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 0 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -470,75 +513,84 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4_11, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%.loc4_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.3: type = converted %int.make_type_signed.loc4_19, %.loc4_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed.loc4_27, %.loc4_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32] -// CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_32.loc10, %.loc10_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] +// CHECK:STDOUT: %.loc10_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc10: init type = call constants.%Int(%.loc10_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8.2: type = value_of_initializer %int.make_type_signed.loc10 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8.3: type = converted %int.make_type_signed.loc10, %.loc10_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed.loc15, %.loc15_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sdiv"; +// CHECK:STDOUT: fn @Div(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sdiv"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Div.ref.loc10: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %.loc10_18.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc10_21.1: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc10_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_18.3: = bound_method %.loc10_18.1, %.loc10_18.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc10_18: init i32 = call %.loc10_18.3(%.loc10_18.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc10_18.4: i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%.28] -// CHECK:STDOUT: %.loc10_18.5: i32 = converted %.loc10_18.1, %.loc10_18.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc10_21.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_21.3: = bound_method %.loc10_21.1, %.loc10_21.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc10_21: init i32 = call %.loc10_21.3(%.loc10_21.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc10_21.4: i32 = value_of_initializer %int.convert_checked.loc10_21 [template = constants.%.30] -// CHECK:STDOUT: %.loc10_21.5: i32 = converted %.loc10_21.1, %.loc10_21.4 [template = constants.%.30] -// CHECK:STDOUT: %int.sdiv.loc10: init i32 = call %Div.ref.loc10(%.loc10_18.5, %.loc10_21.5) [template = ] -// CHECK:STDOUT: %.loc10_23.1: i32 = value_of_initializer %int.sdiv.loc10 [template = ] -// CHECK:STDOUT: %.loc10_23.2: i32 = converted %int.sdiv.loc10, %.loc10_23.1 [template = ] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc10_23.2 +// CHECK:STDOUT: %.loc10_18.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc10_21.1: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc10_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_18.3: = bound_method %.loc10_18.1, %.loc10_18.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc10_18.4: = specific_function %.loc10_18.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc10_18: init %i32 = call %.loc10_18.4(%.loc10_18.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc10_18.5: %i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%.26] +// CHECK:STDOUT: %.loc10_18.6: %i32 = converted %.loc10_18.1, %.loc10_18.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc10_21.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_21.3: = bound_method %.loc10_21.1, %.loc10_21.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc10_21.4: = specific_function %.loc10_21.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc10_21: init %i32 = call %.loc10_21.4(%.loc10_21.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc10_21.5: %i32 = value_of_initializer %int.convert_checked.loc10_21 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_21.6: %i32 = converted %.loc10_21.1, %.loc10_21.5 [template = constants.%.29] +// CHECK:STDOUT: %int.sdiv.loc10: init %i32 = call %Div.ref.loc10(%.loc10_18.6, %.loc10_21.6) [template = ] +// CHECK:STDOUT: %.loc10_23.1: %i32 = value_of_initializer %int.sdiv.loc10 [template = ] +// CHECK:STDOUT: %.loc10_23.2: %i32 = converted %int.sdiv.loc10, %.loc10_23.1 [template = ] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc10_23.2 // CHECK:STDOUT: %Div.ref.loc15: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %.loc15_18.1: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc15_21.1: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc15_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_18.3: = bound_method %.loc15_18.1, %.loc15_18.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc15_18: init i32 = call %.loc15_18.3(%.loc15_18.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc15_18.4: i32 = value_of_initializer %int.convert_checked.loc15_18 [template = constants.%.30] -// CHECK:STDOUT: %.loc15_18.5: i32 = converted %.loc15_18.1, %.loc15_18.4 [template = constants.%.30] -// CHECK:STDOUT: %.loc15_21.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_21.3: = bound_method %.loc15_21.1, %.loc15_21.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc15_21: init i32 = call %.loc15_21.3(%.loc15_21.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc15_21.4: i32 = value_of_initializer %int.convert_checked.loc15_21 [template = constants.%.30] -// CHECK:STDOUT: %.loc15_21.5: i32 = converted %.loc15_21.1, %.loc15_21.4 [template = constants.%.30] -// CHECK:STDOUT: %int.sdiv.loc15: init i32 = call %Div.ref.loc15(%.loc15_18.5, %.loc15_21.5) [template = ] -// CHECK:STDOUT: %.loc15_23.1: i32 = value_of_initializer %int.sdiv.loc15 [template = ] -// CHECK:STDOUT: %.loc15_23.2: i32 = converted %int.sdiv.loc15, %.loc15_23.1 [template = ] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc15_23.2 +// CHECK:STDOUT: %.loc15_18.1: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_21.1: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_18.3: = bound_method %.loc15_18.1, %.loc15_18.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc15_18.4: = specific_function %.loc15_18.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc15_18: init %i32 = call %.loc15_18.4(%.loc15_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc15_18.5: %i32 = value_of_initializer %int.convert_checked.loc15_18 [template = constants.%.29] +// CHECK:STDOUT: %.loc15_18.6: %i32 = converted %.loc15_18.1, %.loc15_18.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc15_21.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_21.3: = bound_method %.loc15_21.1, %.loc15_21.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc15_21.4: = specific_function %.loc15_21.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc15_21: init %i32 = call %.loc15_21.4(%.loc15_21.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc15_21.5: %i32 = value_of_initializer %int.convert_checked.loc15_21 [template = constants.%.29] +// CHECK:STDOUT: %.loc15_21.6: %i32 = converted %.loc15_21.1, %.loc15_21.5 [template = constants.%.29] +// CHECK:STDOUT: %int.sdiv.loc15: init %i32 = call %Div.ref.loc15(%.loc15_18.6, %.loc15_21.6) [template = ] +// CHECK:STDOUT: %.loc15_23.1: %i32 = value_of_initializer %int.sdiv.loc15 [template = ] +// CHECK:STDOUT: %.loc15_23.2: %i32 = converted %int.sdiv.loc15, %.loc15_23.1 [template = ] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc15_23.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/smod.carbon b/toolchain/check/testdata/builtins/int/smod.carbon index 49470015147f..7c1d99d71e05 100644 --- a/toolchain/check/testdata/builtins/int/smod.carbon +++ b/toolchain/check/testdata/builtins/int/smod.carbon @@ -63,28 +63,33 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: --- int_div.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Mod.type: type = fn_type @Mod [template] // CHECK:STDOUT: %Mod: %Mod.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 5 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 3 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 5 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 3 [template] -// CHECK:STDOUT: %.31: i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.16 [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.15 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.4(%.1) [template] // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.35: type = array_type %.34, i32 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, %i32 [template] // CHECK:STDOUT: %.36: type = ptr_type %.35 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] @@ -92,7 +97,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -109,98 +114,109 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%.loc2_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.3: type = converted %int.make_type_signed.loc2_11, %.loc2_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%.loc2_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.3: type = converted %int.make_type_signed.loc2_19, %.loc2_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%.loc2_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.2: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.3: type = converted %int.make_type_signed.loc2_27, %.loc2_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %Mod.ref: %Mod.type = name_ref Mod, %Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 5 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 3 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init i32 = call %.loc4_20.3(%.loc4_20.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.4: i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.5: i32 = converted %.loc4_20.1, %.loc4_20.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init i32 = call %.loc4_23.3(%.loc4_23.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.4: i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.5: i32 = converted %.loc4_23.1, %.loc4_23.4 [template = constants.%.30] -// CHECK:STDOUT: %int.smod: init i32 = call %Mod.ref(%.loc4_20.5, %.loc4_23.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_19.1: %Convert.type.5 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.smod, %.loc4_19.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.smod [template = constants.%.31] -// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.smod, %.loc4_19.3 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.smod, %.loc4_19.5 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 5 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 3 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_20.4: = specific_function %.loc4_20.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %.loc4_20.4(%.loc4_20.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.5: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.6: %i32 = converted %.loc4_20.1, %.loc4_20.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_23.4: = specific_function %.loc4_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %.loc4_23.4(%.loc4_23.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.5: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.6: %i32 = converted %.loc4_23.1, %.loc4_23.5 [template = constants.%.29] +// CHECK:STDOUT: %int.smod: init %i32 = call %Mod.ref(%.loc4_20.6, %.loc4_23.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.6 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.smod, %.loc4_19.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc4_19.3: = specific_function %.loc4_19.2, @Convert.4(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc4_19.4: %i32 = value_of_initializer %int.smod [template = constants.%.30] +// CHECK:STDOUT: %.loc4_19.5: %i32 = converted %int.smod, %.loc4_19.4 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.3(%.loc4_19.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.7: Core.IntLiteral = converted %int.smod, %.loc4_19.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.7, %i32 [template = constants.%.35] // CHECK:STDOUT: %arr.var: ref %.35 = var arr // CHECK:STDOUT: %arr: ref %.35 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_13.1) [template = constants.%i32] // CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 2 [template = constants.%.34] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_13.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_13.3: type = converted %int.make_type_signed.loc5, %.loc5_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, %i32 [template = constants.%.35] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.35 [template = constants.%.36] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.3: type = converted %int.make_type_signed.loc7_19, %.loc7_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%.loc7_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.3: type = converted %int.make_type_signed.loc7_27, %.loc7_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%.loc7_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.3: type = converted %int.make_type_signed.loc7_35, %.loc7_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.smod"; +// CHECK:STDOUT: fn @Mod(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smod"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mod.ref: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %int.smod: init i32 = call %Mod.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: i32 = value_of_initializer %int.smod -// CHECK:STDOUT: %.loc8_19.2: i32 = converted %int.smod, %.loc8_19.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %int.smod: init %i32 = call %Mod.ref(%a.ref, %b.ref) +// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.smod +// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.smod, %.loc8_19.1 // CHECK:STDOUT: return %.loc8_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -215,33 +231,37 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: --- fail_overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Mod.type: type = fn_type @Mod [template] // CHECK:STDOUT: %Mod: %Mod.type = struct_value () [template] // CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] // CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %.28: i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: i32 = int_value -1 [template] -// CHECK:STDOUT: %.33: i32 = int_value 0 [template] -// CHECK:STDOUT: %.34: i32 = int_value -2147483648 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.26: %i32 = int_value -2147483647 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: %i32 = int_value -1 [template] +// CHECK:STDOUT: %.32: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.33: %i32 = int_value -2147483648 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -260,205 +280,228 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4_11, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%.loc4_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.3: type = converted %int.make_type_signed.loc4_19, %.loc4_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed.loc4_27, %.loc4_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] -// CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_32.loc5_11, %.loc5_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_32.loc5_19 [template = i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_32.loc5_19, %.loc5_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_32.loc5_27 [template = i32] -// CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc5_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_11: init type = call constants.%Int(%.loc5_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_11.2: type = value_of_initializer %int.make_type_signed.loc5_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_11.3: type = converted %int.make_type_signed.loc5_11, %.loc5_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_19: init type = call constants.%Int(%.loc5_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.2: type = value_of_initializer %int.make_type_signed.loc5_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.3: type = converted %int.make_type_signed.loc5_19, %.loc5_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_27: init type = call constants.%Int(%.loc5_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.2: type = value_of_initializer %int.make_type_signed.loc5_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.3: type = converted %int.make_type_signed.loc5_27, %.loc5_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] -// CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_32.loc6_14, %.loc6_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc6_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_32.loc6_22 [template = i32] -// CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc6_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_14: init type = call constants.%Int(%.loc6_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_signed.loc6_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_signed.loc6_14, %.loc6_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_22: init type = call constants.%Int(%.loc6_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.2: type = value_of_initializer %int.make_type_signed.loc6_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.3: type = converted %int.make_type_signed.loc6_22, %.loc6_22.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] -// CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_32.loc9, %.loc9_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc20_8.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32] -// CHECK:STDOUT: %.loc20_8.2: type = converted %int.make_type_32.loc20, %.loc20_8.1 [template = i32] +// CHECK:STDOUT: %.loc9_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%.loc9_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_8.2: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_8.3: type = converted %int.make_type_signed.loc9, %.loc9_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.3: type = converted %int.make_type_signed.loc12, %.loc12_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc20_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%.loc20_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc20_8.2: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] +// CHECK:STDOUT: %.loc20_8.3: type = converted %int.make_type_signed.loc20, %.loc20_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.smod"; +// CHECK:STDOUT: fn @Mod(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smod"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.ssub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mod.ref.loc9: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc9_25.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc9_25.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_25.3: = bound_method %.loc9_25.1, %.loc9_25.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc9_25: init i32 = call %.loc9_25.3(%.loc9_25.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc9_25.4: i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%.27] -// CHECK:STDOUT: %.loc9_25.5: i32 = converted %.loc9_25.1, %.loc9_25.4 [template = constants.%.27] -// CHECK:STDOUT: %int.snegate.loc9_24: init i32 = call %Negate.ref.loc9_18(%.loc9_25.5) [template = constants.%.28] +// CHECK:STDOUT: %.loc9_25.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc9_25.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_25.3: = bound_method %.loc9_25.1, %.loc9_25.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc9_25.4: = specific_function %.loc9_25.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %.loc9_25.4(%.loc9_25.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc9_25.5: %i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%.25] +// CHECK:STDOUT: %.loc9_25.6: %i32 = converted %.loc9_25.1, %.loc9_25.5 [template = constants.%.25] +// CHECK:STDOUT: %int.snegate.loc9_24: init %i32 = call %Negate.ref.loc9_18(%.loc9_25.6) [template = constants.%.26] // CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc9_46.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc9_46.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_46.3: = bound_method %.loc9_46.1, %.loc9_46.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc9_46: init i32 = call %.loc9_46.3(%.loc9_46.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc9_46.4: i32 = value_of_initializer %int.convert_checked.loc9_46 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_46.5: i32 = converted %.loc9_46.1, %.loc9_46.4 [template = constants.%.31] -// CHECK:STDOUT: %int.snegate.loc9_45: init i32 = call %Negate.ref.loc9_39(%.loc9_46.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc9_24.1: i32 = value_of_initializer %int.snegate.loc9_24 [template = constants.%.28] -// CHECK:STDOUT: %.loc9_24.2: i32 = converted %int.snegate.loc9_24, %.loc9_24.1 [template = constants.%.28] -// CHECK:STDOUT: %.loc9_45.1: i32 = value_of_initializer %int.snegate.loc9_45 [template = constants.%.32] -// CHECK:STDOUT: %.loc9_45.2: i32 = converted %int.snegate.loc9_45, %.loc9_45.1 [template = constants.%.32] -// CHECK:STDOUT: %int.smod.loc9: init i32 = call %Mod.ref.loc9(%.loc9_24.2, %.loc9_45.2) [template = constants.%.33] -// CHECK:STDOUT: %.loc9_49.1: i32 = value_of_initializer %int.smod.loc9 [template = constants.%.33] -// CHECK:STDOUT: %.loc9_49.2: i32 = converted %int.smod.loc9, %.loc9_49.1 [template = constants.%.33] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc9_49.2 +// CHECK:STDOUT: %.loc9_46.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_46.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_46.3: = bound_method %.loc9_46.1, %.loc9_46.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc9_46.4: = specific_function %.loc9_46.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc9_46: init %i32 = call %.loc9_46.4(%.loc9_46.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc9_46.5: %i32 = value_of_initializer %int.convert_checked.loc9_46 [template = constants.%.30] +// CHECK:STDOUT: %.loc9_46.6: %i32 = converted %.loc9_46.1, %.loc9_46.5 [template = constants.%.30] +// CHECK:STDOUT: %int.snegate.loc9_45: init %i32 = call %Negate.ref.loc9_39(%.loc9_46.6) [template = constants.%.31] +// CHECK:STDOUT: %.loc9_24.1: %i32 = value_of_initializer %int.snegate.loc9_24 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_24.2: %i32 = converted %int.snegate.loc9_24, %.loc9_24.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_45.1: %i32 = value_of_initializer %int.snegate.loc9_45 [template = constants.%.31] +// CHECK:STDOUT: %.loc9_45.2: %i32 = converted %int.snegate.loc9_45, %.loc9_45.1 [template = constants.%.31] +// CHECK:STDOUT: %int.smod.loc9: init %i32 = call %Mod.ref.loc9(%.loc9_24.2, %.loc9_45.2) [template = constants.%.32] +// CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.smod.loc9 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int.smod.loc9, %.loc9_49.1 [template = constants.%.32] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc9_49.2 // CHECK:STDOUT: %Mod.ref.loc12: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %Sub.ref.loc12: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_29.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_29.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_29.3: = bound_method %.loc12_29.1, %.loc12_29.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc12_29: init i32 = call %.loc12_29.3(%.loc12_29.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_29.4: i32 = value_of_initializer %int.convert_checked.loc12_29 [template = constants.%.27] -// CHECK:STDOUT: %.loc12_29.5: i32 = converted %.loc12_29.1, %.loc12_29.4 [template = constants.%.27] -// CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_29.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc12_43.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc12_28.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.28] -// CHECK:STDOUT: %.loc12_28.2: i32 = converted %int.snegate.loc12, %.loc12_28.1 [template = constants.%.28] -// CHECK:STDOUT: %.loc12_43.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_43.3: = bound_method %.loc12_43.1, %.loc12_43.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc12_43: init i32 = call %.loc12_43.3(%.loc12_43.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc12_43.4: i32 = value_of_initializer %int.convert_checked.loc12_43 [template = constants.%.31] -// CHECK:STDOUT: %.loc12_43.5: i32 = converted %.loc12_43.1, %.loc12_43.4 [template = constants.%.31] -// CHECK:STDOUT: %int.ssub.loc12: init i32 = call %Sub.ref.loc12(%.loc12_28.2, %.loc12_43.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc12_47.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc12_21.1: i32 = value_of_initializer %int.ssub.loc12 [template = constants.%.34] -// CHECK:STDOUT: %.loc12_21.2: i32 = converted %int.ssub.loc12, %.loc12_21.1 [template = constants.%.34] -// CHECK:STDOUT: %.loc12_47.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_47.3: = bound_method %.loc12_47.1, %.loc12_47.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc12_47: init i32 = call %.loc12_47.3(%.loc12_47.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc12_47.4: i32 = value_of_initializer %int.convert_checked.loc12_47 [template = constants.%.31] -// CHECK:STDOUT: %.loc12_47.5: i32 = converted %.loc12_47.1, %.loc12_47.4 [template = constants.%.31] -// CHECK:STDOUT: %int.smod.loc12: init i32 = call %Mod.ref.loc12(%.loc12_21.2, %.loc12_47.5) [template = constants.%.33] -// CHECK:STDOUT: %.loc12_49.1: i32 = value_of_initializer %int.smod.loc12 [template = constants.%.33] -// CHECK:STDOUT: %.loc12_49.2: i32 = converted %int.smod.loc12, %.loc12_49.1 [template = constants.%.33] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc12_49.2 +// CHECK:STDOUT: %.loc12_29.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_29.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_29.3: = bound_method %.loc12_29.1, %.loc12_29.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_29.4: = specific_function %.loc12_29.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %.loc12_29.4(%.loc12_29.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_29.5: %i32 = value_of_initializer %int.convert_checked.loc12_29 [template = constants.%.25] +// CHECK:STDOUT: %.loc12_29.6: %i32 = converted %.loc12_29.1, %.loc12_29.5 [template = constants.%.25] +// CHECK:STDOUT: %int.snegate.loc12: init %i32 = call %Negate.ref.loc12(%.loc12_29.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc12_43.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_28.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_28.2: %i32 = converted %int.snegate.loc12, %.loc12_28.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_43.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_43.3: = bound_method %.loc12_43.1, %.loc12_43.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc12_43.4: = specific_function %.loc12_43.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %.loc12_43.4(%.loc12_43.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc12_43.5: %i32 = value_of_initializer %int.convert_checked.loc12_43 [template = constants.%.30] +// CHECK:STDOUT: %.loc12_43.6: %i32 = converted %.loc12_43.1, %.loc12_43.5 [template = constants.%.30] +// CHECK:STDOUT: %int.ssub.loc12: init %i32 = call %Sub.ref.loc12(%.loc12_28.2, %.loc12_43.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc12_47.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_21.1: %i32 = value_of_initializer %int.ssub.loc12 [template = constants.%.33] +// CHECK:STDOUT: %.loc12_21.2: %i32 = converted %int.ssub.loc12, %.loc12_21.1 [template = constants.%.33] +// CHECK:STDOUT: %.loc12_47.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_47.3: = bound_method %.loc12_47.1, %.loc12_47.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc12_47.4: = specific_function %.loc12_47.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc12_47: init %i32 = call %.loc12_47.4(%.loc12_47.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc12_47.5: %i32 = value_of_initializer %int.convert_checked.loc12_47 [template = constants.%.30] +// CHECK:STDOUT: %.loc12_47.6: %i32 = converted %.loc12_47.1, %.loc12_47.5 [template = constants.%.30] +// CHECK:STDOUT: %int.smod.loc12: init %i32 = call %Mod.ref.loc12(%.loc12_21.2, %.loc12_47.6) [template = constants.%.32] +// CHECK:STDOUT: %.loc12_49.1: %i32 = value_of_initializer %int.smod.loc12 [template = constants.%.32] +// CHECK:STDOUT: %.loc12_49.2: %i32 = converted %int.smod.loc12, %.loc12_49.1 [template = constants.%.32] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc12_49.2 // CHECK:STDOUT: %Mod.ref.loc20: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %Sub.ref.loc20: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc20_22: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc20_29.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc20_29.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc20_29.3: = bound_method %.loc20_29.1, %.loc20_29.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc20_29: init i32 = call %.loc20_29.3(%.loc20_29.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc20_29.4: i32 = value_of_initializer %int.convert_checked.loc20_29 [template = constants.%.27] -// CHECK:STDOUT: %.loc20_29.5: i32 = converted %.loc20_29.1, %.loc20_29.4 [template = constants.%.27] -// CHECK:STDOUT: %int.snegate.loc20_28: init i32 = call %Negate.ref.loc20_22(%.loc20_29.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc20_43.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc20_28.1: i32 = value_of_initializer %int.snegate.loc20_28 [template = constants.%.28] -// CHECK:STDOUT: %.loc20_28.2: i32 = converted %int.snegate.loc20_28, %.loc20_28.1 [template = constants.%.28] -// CHECK:STDOUT: %.loc20_43.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc20_43.3: = bound_method %.loc20_43.1, %.loc20_43.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc20_43: init i32 = call %.loc20_43.3(%.loc20_43.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc20_43.4: i32 = value_of_initializer %int.convert_checked.loc20_43 [template = constants.%.31] -// CHECK:STDOUT: %.loc20_43.5: i32 = converted %.loc20_43.1, %.loc20_43.4 [template = constants.%.31] -// CHECK:STDOUT: %int.ssub.loc20: init i32 = call %Sub.ref.loc20(%.loc20_28.2, %.loc20_43.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc20_29.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc20_29.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc20_29.3: = bound_method %.loc20_29.1, %.loc20_29.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc20_29.4: = specific_function %.loc20_29.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc20_29: init %i32 = call %.loc20_29.4(%.loc20_29.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc20_29.5: %i32 = value_of_initializer %int.convert_checked.loc20_29 [template = constants.%.25] +// CHECK:STDOUT: %.loc20_29.6: %i32 = converted %.loc20_29.1, %.loc20_29.5 [template = constants.%.25] +// CHECK:STDOUT: %int.snegate.loc20_28: init %i32 = call %Negate.ref.loc20_22(%.loc20_29.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc20_43.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc20_28.1: %i32 = value_of_initializer %int.snegate.loc20_28 [template = constants.%.26] +// CHECK:STDOUT: %.loc20_28.2: %i32 = converted %int.snegate.loc20_28, %.loc20_28.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc20_43.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc20_43.3: = bound_method %.loc20_43.1, %.loc20_43.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc20_43.4: = specific_function %.loc20_43.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc20_43: init %i32 = call %.loc20_43.4(%.loc20_43.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc20_43.5: %i32 = value_of_initializer %int.convert_checked.loc20_43 [template = constants.%.30] +// CHECK:STDOUT: %.loc20_43.6: %i32 = converted %.loc20_43.1, %.loc20_43.5 [template = constants.%.30] +// CHECK:STDOUT: %int.ssub.loc20: init %i32 = call %Sub.ref.loc20(%.loc20_28.2, %.loc20_43.6) [template = constants.%.33] // CHECK:STDOUT: %Negate.ref.loc20_47: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc20_54.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc20_54.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc20_54.3: = bound_method %.loc20_54.1, %.loc20_54.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc20_54: init i32 = call %.loc20_54.3(%.loc20_54.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc20_54.4: i32 = value_of_initializer %int.convert_checked.loc20_54 [template = constants.%.31] -// CHECK:STDOUT: %.loc20_54.5: i32 = converted %.loc20_54.1, %.loc20_54.4 [template = constants.%.31] -// CHECK:STDOUT: %int.snegate.loc20_53: init i32 = call %Negate.ref.loc20_47(%.loc20_54.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc20_21.1: i32 = value_of_initializer %int.ssub.loc20 [template = constants.%.34] -// CHECK:STDOUT: %.loc20_21.2: i32 = converted %int.ssub.loc20, %.loc20_21.1 [template = constants.%.34] -// CHECK:STDOUT: %.loc20_53.1: i32 = value_of_initializer %int.snegate.loc20_53 [template = constants.%.32] -// CHECK:STDOUT: %.loc20_53.2: i32 = converted %int.snegate.loc20_53, %.loc20_53.1 [template = constants.%.32] -// CHECK:STDOUT: %int.smod.loc20: init i32 = call %Mod.ref.loc20(%.loc20_21.2, %.loc20_53.2) [template = constants.%.33] -// CHECK:STDOUT: %.loc20_57.1: i32 = value_of_initializer %int.smod.loc20 [template = constants.%.33] -// CHECK:STDOUT: %.loc20_57.2: i32 = converted %int.smod.loc20, %.loc20_57.1 [template = constants.%.33] -// CHECK:STDOUT: %c: i32 = bind_name c, %.loc20_57.2 +// CHECK:STDOUT: %.loc20_54.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc20_54.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc20_54.3: = bound_method %.loc20_54.1, %.loc20_54.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc20_54.4: = specific_function %.loc20_54.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc20_54: init %i32 = call %.loc20_54.4(%.loc20_54.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc20_54.5: %i32 = value_of_initializer %int.convert_checked.loc20_54 [template = constants.%.30] +// CHECK:STDOUT: %.loc20_54.6: %i32 = converted %.loc20_54.1, %.loc20_54.5 [template = constants.%.30] +// CHECK:STDOUT: %int.snegate.loc20_53: init %i32 = call %Negate.ref.loc20_47(%.loc20_54.6) [template = constants.%.31] +// CHECK:STDOUT: %.loc20_21.1: %i32 = value_of_initializer %int.ssub.loc20 [template = constants.%.33] +// CHECK:STDOUT: %.loc20_21.2: %i32 = converted %int.ssub.loc20, %.loc20_21.1 [template = constants.%.33] +// CHECK:STDOUT: %.loc20_53.1: %i32 = value_of_initializer %int.snegate.loc20_53 [template = constants.%.31] +// CHECK:STDOUT: %.loc20_53.2: %i32 = converted %int.snegate.loc20_53, %.loc20_53.1 [template = constants.%.31] +// CHECK:STDOUT: %int.smod.loc20: init %i32 = call %Mod.ref.loc20(%.loc20_21.2, %.loc20_53.2) [template = constants.%.32] +// CHECK:STDOUT: %.loc20_57.1: %i32 = value_of_initializer %int.smod.loc20 [template = constants.%.32] +// CHECK:STDOUT: %.loc20_57.2: %i32 = converted %int.smod.loc20, %.loc20_57.1 [template = constants.%.32] +// CHECK:STDOUT: %c: %i32 = bind_name c, %.loc20_57.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_div_by_zero.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Mod.type: type = fn_type @Mod [template] // CHECK:STDOUT: %Mod: %Mod.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 0 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -474,75 +517,84 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4_11, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%.loc4_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.3: type = converted %int.make_type_signed.loc4_19, %.loc4_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed.loc4_27, %.loc4_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_8.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] -// CHECK:STDOUT: %.loc17_8.2: type = converted %int.make_type_32.loc17, %.loc17_8.1 [template = i32] +// CHECK:STDOUT: %.loc12_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.3: type = converted %int.make_type_signed.loc12, %.loc12_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%.loc17_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_8.2: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_8.3: type = converted %int.make_type_signed.loc17, %.loc17_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.smod"; +// CHECK:STDOUT: fn @Mod(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smod"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mod.ref.loc12: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %.loc12_18.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_21.1: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc12_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_18.3: = bound_method %.loc12_18.1, %.loc12_18.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc12_18: init i32 = call %.loc12_18.3(%.loc12_18.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc12_18.4: i32 = value_of_initializer %int.convert_checked.loc12_18 [template = constants.%.28] -// CHECK:STDOUT: %.loc12_18.5: i32 = converted %.loc12_18.1, %.loc12_18.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc12_21.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_21.3: = bound_method %.loc12_21.1, %.loc12_21.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc12_21: init i32 = call %.loc12_21.3(%.loc12_21.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc12_21.4: i32 = value_of_initializer %int.convert_checked.loc12_21 [template = constants.%.30] -// CHECK:STDOUT: %.loc12_21.5: i32 = converted %.loc12_21.1, %.loc12_21.4 [template = constants.%.30] -// CHECK:STDOUT: %int.smod.loc12: init i32 = call %Mod.ref.loc12(%.loc12_18.5, %.loc12_21.5) [template = ] -// CHECK:STDOUT: %.loc12_23.1: i32 = value_of_initializer %int.smod.loc12 [template = ] -// CHECK:STDOUT: %.loc12_23.2: i32 = converted %int.smod.loc12, %.loc12_23.1 [template = ] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc12_23.2 +// CHECK:STDOUT: %.loc12_18.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_21.1: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_18.3: = bound_method %.loc12_18.1, %.loc12_18.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc12_18.4: = specific_function %.loc12_18.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc12_18: init %i32 = call %.loc12_18.4(%.loc12_18.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc12_18.5: %i32 = value_of_initializer %int.convert_checked.loc12_18 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_18.6: %i32 = converted %.loc12_18.1, %.loc12_18.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_21.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_21.3: = bound_method %.loc12_21.1, %.loc12_21.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_21.4: = specific_function %.loc12_21.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc12_21: init %i32 = call %.loc12_21.4(%.loc12_21.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc12_21.5: %i32 = value_of_initializer %int.convert_checked.loc12_21 [template = constants.%.29] +// CHECK:STDOUT: %.loc12_21.6: %i32 = converted %.loc12_21.1, %.loc12_21.5 [template = constants.%.29] +// CHECK:STDOUT: %int.smod.loc12: init %i32 = call %Mod.ref.loc12(%.loc12_18.6, %.loc12_21.6) [template = ] +// CHECK:STDOUT: %.loc12_23.1: %i32 = value_of_initializer %int.smod.loc12 [template = ] +// CHECK:STDOUT: %.loc12_23.2: %i32 = converted %int.smod.loc12, %.loc12_23.1 [template = ] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc12_23.2 // CHECK:STDOUT: %Mod.ref.loc17: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %.loc17_18.1: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc17_21.1: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc17_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc17_18.3: = bound_method %.loc17_18.1, %.loc17_18.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc17_18: init i32 = call %.loc17_18.3(%.loc17_18.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc17_18.4: i32 = value_of_initializer %int.convert_checked.loc17_18 [template = constants.%.30] -// CHECK:STDOUT: %.loc17_18.5: i32 = converted %.loc17_18.1, %.loc17_18.4 [template = constants.%.30] -// CHECK:STDOUT: %.loc17_21.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc17_21.3: = bound_method %.loc17_21.1, %.loc17_21.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc17_21: init i32 = call %.loc17_21.3(%.loc17_21.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc17_21.4: i32 = value_of_initializer %int.convert_checked.loc17_21 [template = constants.%.30] -// CHECK:STDOUT: %.loc17_21.5: i32 = converted %.loc17_21.1, %.loc17_21.4 [template = constants.%.30] -// CHECK:STDOUT: %int.smod.loc17: init i32 = call %Mod.ref.loc17(%.loc17_18.5, %.loc17_21.5) [template = ] -// CHECK:STDOUT: %.loc17_23.1: i32 = value_of_initializer %int.smod.loc17 [template = ] -// CHECK:STDOUT: %.loc17_23.2: i32 = converted %int.smod.loc17, %.loc17_23.1 [template = ] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc17_23.2 +// CHECK:STDOUT: %.loc17_18.1: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc17_21.1: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc17_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc17_18.3: = bound_method %.loc17_18.1, %.loc17_18.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc17_18.4: = specific_function %.loc17_18.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc17_18: init %i32 = call %.loc17_18.4(%.loc17_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc17_18.5: %i32 = value_of_initializer %int.convert_checked.loc17_18 [template = constants.%.29] +// CHECK:STDOUT: %.loc17_18.6: %i32 = converted %.loc17_18.1, %.loc17_18.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc17_21.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc17_21.3: = bound_method %.loc17_21.1, %.loc17_21.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc17_21.4: = specific_function %.loc17_21.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc17_21: init %i32 = call %.loc17_21.4(%.loc17_21.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc17_21.5: %i32 = value_of_initializer %int.convert_checked.loc17_21 [template = constants.%.29] +// CHECK:STDOUT: %.loc17_21.6: %i32 = converted %.loc17_21.1, %.loc17_21.5 [template = constants.%.29] +// CHECK:STDOUT: %int.smod.loc17: init %i32 = call %Mod.ref.loc17(%.loc17_18.6, %.loc17_21.6) [template = ] +// CHECK:STDOUT: %.loc17_23.1: %i32 = value_of_initializer %int.smod.loc17 [template = ] +// CHECK:STDOUT: %.loc17_23.2: %i32 = converted %int.smod.loc17, %.loc17_23.1 [template = ] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc17_23.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/smul.carbon b/toolchain/check/testdata/builtins/int/smul.carbon index 08ac2d506a6b..c4a04a3cbd7c 100644 --- a/toolchain/check/testdata/builtins/int/smul.carbon +++ b/toolchain/check/testdata/builtins/int/smul.carbon @@ -34,28 +34,33 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: --- int_mul.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Mul.type: type = fn_type @Mul [template] // CHECK:STDOUT: %Mul: %Mul.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 3 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 6 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 3 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] -// CHECK:STDOUT: %.31: i32 = int_value 6 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.16 [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.15 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.4(%.1) [template] // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 6 [template] -// CHECK:STDOUT: %.35: type = array_type %.34, i32 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, %i32 [template] // CHECK:STDOUT: %.36: type = ptr_type %.35 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] @@ -63,7 +68,7 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -80,98 +85,109 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%.loc2_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.3: type = converted %int.make_type_signed.loc2_11, %.loc2_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%.loc2_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.3: type = converted %int.make_type_signed.loc2_19, %.loc2_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%.loc2_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.2: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.3: type = converted %int.make_type_signed.loc2_27, %.loc2_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, %Mul.decl [template = constants.%Mul] -// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init i32 = call %.loc4_20.3(%.loc4_20.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.4: i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.5: i32 = converted %.loc4_20.1, %.loc4_20.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init i32 = call %.loc4_23.3(%.loc4_23.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.4: i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.5: i32 = converted %.loc4_23.1, %.loc4_23.4 [template = constants.%.30] -// CHECK:STDOUT: %int.smul: init i32 = call %Mul.ref(%.loc4_20.5, %.loc4_23.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_19.1: %Convert.type.5 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.smul, %.loc4_19.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.smul [template = constants.%.31] -// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.smul, %.loc4_19.3 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.smul, %.loc4_19.5 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_20.4: = specific_function %.loc4_20.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %.loc4_20.4(%.loc4_20.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.5: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.6: %i32 = converted %.loc4_20.1, %.loc4_20.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_23.4: = specific_function %.loc4_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %.loc4_23.4(%.loc4_23.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.5: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.6: %i32 = converted %.loc4_23.1, %.loc4_23.5 [template = constants.%.29] +// CHECK:STDOUT: %int.smul: init %i32 = call %Mul.ref(%.loc4_20.6, %.loc4_23.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.6 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.smul, %.loc4_19.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc4_19.3: = specific_function %.loc4_19.2, @Convert.4(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc4_19.4: %i32 = value_of_initializer %int.smul [template = constants.%.30] +// CHECK:STDOUT: %.loc4_19.5: %i32 = converted %int.smul, %.loc4_19.4 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.3(%.loc4_19.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.7: Core.IntLiteral = converted %int.smul, %.loc4_19.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.7, %i32 [template = constants.%.35] // CHECK:STDOUT: %arr.var: ref %.35 = var arr // CHECK:STDOUT: %arr: ref %.35 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_13.1) [template = constants.%i32] // CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 6 [template = constants.%.34] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_13.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_13.3: type = converted %int.make_type_signed.loc5, %.loc5_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, %i32 [template = constants.%.35] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.35 [template = constants.%.36] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.3: type = converted %int.make_type_signed.loc7_19, %.loc7_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%.loc7_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.3: type = converted %int.make_type_signed.loc7_27, %.loc7_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%.loc7_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.3: type = converted %int.make_type_signed.loc7_35, %.loc7_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mul(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.smul"; +// CHECK:STDOUT: fn @Mul(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smul"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %int.smul: init i32 = call %Mul.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: i32 = value_of_initializer %int.smul -// CHECK:STDOUT: %.loc8_19.2: i32 = converted %int.smul, %.loc8_19.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %int.smul: init %i32 = call %Mul.ref(%a.ref, %b.ref) +// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.smul +// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.smul, %.loc8_19.1 // CHECK:STDOUT: return %.loc8_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -186,30 +202,35 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: --- fail_overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Mul.type: type = fn_type @Mul [template] // CHECK:STDOUT: %Mul: %Mul.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32767 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 65536 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 32767 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 65536 [template] -// CHECK:STDOUT: %.31: i32 = int_value 2147418112 [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 32768 [template] -// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 32768 [template] -// CHECK:STDOUT: %.35: i32 = int_value -2147483648 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32767 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 65536 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 32767 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 65536 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 2147418112 [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 32768 [template] +// CHECK:STDOUT: %.32: = bound_method %.31, %Convert.14 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 32768 [template] +// CHECK:STDOUT: %.35: %i32 = int_value -2147483648 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -225,75 +246,84 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4_11, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%.loc4_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.3: type = converted %int.make_type_signed.loc4_19, %.loc4_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed.loc4_27, %.loc4_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32] -// CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_32.loc10, %.loc10_8.1 [template = i32] +// CHECK:STDOUT: %.loc6_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.3: type = converted %int.make_type_signed.loc6, %.loc6_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc10: init type = call constants.%Int(%.loc10_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8.2: type = value_of_initializer %int.make_type_signed.loc10 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8.3: type = converted %int.make_type_signed.loc10, %.loc10_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mul(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.smul"; +// CHECK:STDOUT: fn @Mul(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smul"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mul.ref.loc6: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] -// CHECK:STDOUT: %.loc6_18.1: Core.IntLiteral = int_value 32767 [template = constants.%.1] -// CHECK:STDOUT: %.loc6_26.1: Core.IntLiteral = int_value 65536 [template = constants.%.2] -// CHECK:STDOUT: %.loc6_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_18.3: = bound_method %.loc6_18.1, %.loc6_18.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc6_18: init i32 = call %.loc6_18.3(%.loc6_18.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc6_18.4: i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_18.5: i32 = converted %.loc6_18.1, %.loc6_18.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_26.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_26.3: = bound_method %.loc6_26.1, %.loc6_26.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc6_26: init i32 = call %.loc6_26.3(%.loc6_26.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc6_26.4: i32 = value_of_initializer %int.convert_checked.loc6_26 [template = constants.%.30] -// CHECK:STDOUT: %.loc6_26.5: i32 = converted %.loc6_26.1, %.loc6_26.4 [template = constants.%.30] -// CHECK:STDOUT: %int.smul.loc6: init i32 = call %Mul.ref.loc6(%.loc6_18.5, %.loc6_26.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc6_34.1: i32 = value_of_initializer %int.smul.loc6 [template = constants.%.31] -// CHECK:STDOUT: %.loc6_34.2: i32 = converted %int.smul.loc6, %.loc6_34.1 [template = constants.%.31] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc6_34.2 +// CHECK:STDOUT: %.loc6_18.1: Core.IntLiteral = int_value 32767 [template = constants.%.2] +// CHECK:STDOUT: %.loc6_26.1: Core.IntLiteral = int_value 65536 [template = constants.%.3] +// CHECK:STDOUT: %.loc6_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_18.3: = bound_method %.loc6_18.1, %.loc6_18.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc6_18.4: = specific_function %.loc6_18.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %.loc6_18.4(%.loc6_18.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc6_18.5: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%.26] +// CHECK:STDOUT: %.loc6_18.6: %i32 = converted %.loc6_18.1, %.loc6_18.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc6_26.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_26.3: = bound_method %.loc6_26.1, %.loc6_26.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc6_26.4: = specific_function %.loc6_26.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc6_26: init %i32 = call %.loc6_26.4(%.loc6_26.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc6_26.5: %i32 = value_of_initializer %int.convert_checked.loc6_26 [template = constants.%.29] +// CHECK:STDOUT: %.loc6_26.6: %i32 = converted %.loc6_26.1, %.loc6_26.5 [template = constants.%.29] +// CHECK:STDOUT: %int.smul.loc6: init %i32 = call %Mul.ref.loc6(%.loc6_18.6, %.loc6_26.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc6_34.1: %i32 = value_of_initializer %int.smul.loc6 [template = constants.%.30] +// CHECK:STDOUT: %.loc6_34.2: %i32 = converted %int.smul.loc6, %.loc6_34.1 [template = constants.%.30] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc6_34.2 // CHECK:STDOUT: %Mul.ref.loc10: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] -// CHECK:STDOUT: %.loc10_18.1: Core.IntLiteral = int_value 32768 [template = constants.%.32] -// CHECK:STDOUT: %.loc10_26.1: Core.IntLiteral = int_value 65536 [template = constants.%.2] -// CHECK:STDOUT: %.loc10_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_18.3: = bound_method %.loc10_18.1, %.loc10_18.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc10_18: init i32 = call %.loc10_18.3(%.loc10_18.1) [template = constants.%.34] -// CHECK:STDOUT: %.loc10_18.4: i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%.34] -// CHECK:STDOUT: %.loc10_18.5: i32 = converted %.loc10_18.1, %.loc10_18.4 [template = constants.%.34] -// CHECK:STDOUT: %.loc10_26.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_26.3: = bound_method %.loc10_26.1, %.loc10_26.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc10_26: init i32 = call %.loc10_26.3(%.loc10_26.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc10_26.4: i32 = value_of_initializer %int.convert_checked.loc10_26 [template = constants.%.30] -// CHECK:STDOUT: %.loc10_26.5: i32 = converted %.loc10_26.1, %.loc10_26.4 [template = constants.%.30] -// CHECK:STDOUT: %int.smul.loc10: init i32 = call %Mul.ref.loc10(%.loc10_18.5, %.loc10_26.5) [template = constants.%.35] -// CHECK:STDOUT: %.loc10_34.1: i32 = value_of_initializer %int.smul.loc10 [template = constants.%.35] -// CHECK:STDOUT: %.loc10_34.2: i32 = converted %int.smul.loc10, %.loc10_34.1 [template = constants.%.35] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc10_34.2 +// CHECK:STDOUT: %.loc10_18.1: Core.IntLiteral = int_value 32768 [template = constants.%.31] +// CHECK:STDOUT: %.loc10_26.1: Core.IntLiteral = int_value 65536 [template = constants.%.3] +// CHECK:STDOUT: %.loc10_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_18.3: = bound_method %.loc10_18.1, %.loc10_18.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc10_18.4: = specific_function %.loc10_18.3, @Convert.2(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc10_18: init %i32 = call %.loc10_18.4(%.loc10_18.1) [template = constants.%.34] +// CHECK:STDOUT: %.loc10_18.5: %i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%.34] +// CHECK:STDOUT: %.loc10_18.6: %i32 = converted %.loc10_18.1, %.loc10_18.5 [template = constants.%.34] +// CHECK:STDOUT: %.loc10_26.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_26.3: = bound_method %.loc10_26.1, %.loc10_26.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc10_26.4: = specific_function %.loc10_26.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc10_26: init %i32 = call %.loc10_26.4(%.loc10_26.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc10_26.5: %i32 = value_of_initializer %int.convert_checked.loc10_26 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_26.6: %i32 = converted %.loc10_26.1, %.loc10_26.5 [template = constants.%.29] +// CHECK:STDOUT: %int.smul.loc10: init %i32 = call %Mul.ref.loc10(%.loc10_18.6, %.loc10_26.6) [template = constants.%.35] +// CHECK:STDOUT: %.loc10_34.1: %i32 = value_of_initializer %int.smul.loc10 [template = constants.%.35] +// CHECK:STDOUT: %.loc10_34.2: %i32 = converted %int.smul.loc10, %.loc10_34.1 [template = constants.%.35] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc10_34.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index 1e134c7c8a48..4e707a911fb7 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -119,36 +119,41 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: --- int_negate.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 123 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 123 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 123 [template] +// CHECK:STDOUT: %.26: %i32 = int_value -123 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 123 [template] -// CHECK:STDOUT: %.28: i32 = int_value -123 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.30: = bound_method %.27, %Convert.16 [template] -// CHECK:STDOUT: %.31: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.32: type = ptr_type %.31 [template] -// CHECK:STDOUT: %.33: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.34: = bound_method %.33, %Convert.15 [template] -// CHECK:STDOUT: %.35: i32 = int_value 1 [template] -// CHECK:STDOUT: %.36: i32 = int_value -1 [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.25, %Convert.15 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.4(%.1) [template] +// CHECK:STDOUT: %.30: type = array_type %.2, %i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] +// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.14 [template] +// CHECK:STDOUT: %.34: = specific_function %.33, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.35: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.36: %i32 = int_value -1 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -166,118 +171,131 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %int.make_type_32.loc2_14 [template = i32] -// CHECK:STDOUT: %.loc2_14.2: type = converted %int.make_type_32.loc2_14, %.loc2_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_22.1: type = value_of_initializer %int.make_type_32.loc2_22 [template = i32] -// CHECK:STDOUT: %.loc2_22.2: type = converted %int.make_type_32.loc2_22, %.loc2_22.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_14: init type = call constants.%Int(%.loc2_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_14.2: type = value_of_initializer %int.make_type_signed.loc2_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_14.3: type = converted %int.make_type_signed.loc2_14, %.loc2_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_22: init type = call constants.%Int(%.loc2_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_22.2: type = value_of_initializer %int.make_type_signed.loc2_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_22.3: type = converted %int.make_type_signed.loc2_22, %.loc2_22.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %Negate.ref.loc4_16: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %Negate.ref.loc4_23: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc4_30.1: Core.IntLiteral = int_value 123 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_30.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_30.3: = bound_method %.loc4_30.1, %.loc4_30.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc4_30: init i32 = call %.loc4_30.3(%.loc4_30.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc4_30.4: i32 = value_of_initializer %int.convert_checked.loc4_30 [template = constants.%.27] -// CHECK:STDOUT: %.loc4_30.5: i32 = converted %.loc4_30.1, %.loc4_30.4 [template = constants.%.27] -// CHECK:STDOUT: %int.snegate.loc4_29: init i32 = call %Negate.ref.loc4_23(%.loc4_30.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc4_29.1: i32 = value_of_initializer %int.snegate.loc4_29 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_29.2: i32 = converted %int.snegate.loc4_29, %.loc4_29.1 [template = constants.%.28] -// CHECK:STDOUT: %int.snegate.loc4_22: init i32 = call %Negate.ref.loc4_16(%.loc4_29.2) [template = constants.%.27] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_22.1: %Convert.type.5 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc4_22.2: = bound_method %int.snegate.loc4_22, %.loc4_22.1 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_22.3: i32 = value_of_initializer %int.snegate.loc4_22 [template = constants.%.27] -// CHECK:STDOUT: %.loc4_22.4: i32 = converted %int.snegate.loc4_22, %.loc4_22.3 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc4_22: init Core.IntLiteral = call %.loc4_22.2(%.loc4_22.4) [template = constants.%.1] -// CHECK:STDOUT: %.loc4_22.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_22 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_22.6: Core.IntLiteral = converted %int.snegate.loc4_22, %.loc4_22.5 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_35: type = array_type %.loc4_22.6, i32 [template = constants.%.31] -// CHECK:STDOUT: %arr.var: ref %.31 = var arr -// CHECK:STDOUT: %arr: ref %.31 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 123 [template = constants.%.1] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_21: type = array_type %.loc5_18, i32 [template = constants.%.31] -// CHECK:STDOUT: %.loc5_22: type = ptr_type %.31 [template = constants.%.32] -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] +// CHECK:STDOUT: %.loc4_30.1: Core.IntLiteral = int_value 123 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_30.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_30.3: = bound_method %.loc4_30.1, %.loc4_30.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc4_30.4: = specific_function %.loc4_30.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc4_30: init %i32 = call %.loc4_30.4(%.loc4_30.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc4_30.5: %i32 = value_of_initializer %int.convert_checked.loc4_30 [template = constants.%.25] +// CHECK:STDOUT: %.loc4_30.6: %i32 = converted %.loc4_30.1, %.loc4_30.5 [template = constants.%.25] +// CHECK:STDOUT: %int.snegate.loc4_29: init %i32 = call %Negate.ref.loc4_23(%.loc4_30.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc4_29.1: %i32 = value_of_initializer %int.snegate.loc4_29 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_29.2: %i32 = converted %int.snegate.loc4_29, %.loc4_29.1 [template = constants.%.26] +// CHECK:STDOUT: %int.snegate.loc4_22: init %i32 = call %Negate.ref.loc4_16(%.loc4_29.2) [template = constants.%.25] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_22.1: %Convert.type.6 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_22.2: = bound_method %int.snegate.loc4_22, %.loc4_22.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_22.3: = specific_function %.loc4_22.2, @Convert.4(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_22.4: %i32 = value_of_initializer %int.snegate.loc4_22 [template = constants.%.25] +// CHECK:STDOUT: %.loc4_22.5: %i32 = converted %int.snegate.loc4_22, %.loc4_22.4 [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc4_22: init Core.IntLiteral = call %.loc4_22.3(%.loc4_22.5) [template = constants.%.2] +// CHECK:STDOUT: %.loc4_22.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_22 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_22.7: Core.IntLiteral = converted %int.snegate.loc4_22, %.loc4_22.6 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_35: type = array_type %.loc4_22.7, %i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc5_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 123 [template = constants.%.2] +// CHECK:STDOUT: %.loc5_13.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_13.3: type = converted %int.make_type_signed.loc5, %.loc5_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_21: type = array_type %.loc5_18, %i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_22: type = ptr_type %.30 [template = constants.%.31] +// CHECK:STDOUT: %.loc7_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%.loc7_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.2: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.3: type = converted %int.make_type_signed.loc7, %.loc7_8.2 [template = constants.%i32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc9_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_19.1: type = value_of_initializer %int.make_type_32.loc9_19 [template = i32] -// CHECK:STDOUT: %.loc9_19.2: type = converted %int.make_type_32.loc9_19, %.loc9_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc9_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_27.1: type = value_of_initializer %int.make_type_32.loc9_27 [template = i32] -// CHECK:STDOUT: %.loc9_27.2: type = converted %int.make_type_32.loc9_27, %.loc9_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc9_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_35.1: type = value_of_initializer %int.make_type_32.loc9_35 [template = i32] -// CHECK:STDOUT: %.loc9_35.2: type = converted %int.make_type_32.loc9_35, %.loc9_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc9_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc9_19: init type = call constants.%Int(%.loc9_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_19.2: type = value_of_initializer %int.make_type_signed.loc9_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_19.3: type = converted %int.make_type_signed.loc9_19, %.loc9_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc9_27: init type = call constants.%Int(%.loc9_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_27.2: type = value_of_initializer %int.make_type_signed.loc9_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_27.3: type = converted %int.make_type_signed.loc9_27, %.loc9_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc9_35: init type = call constants.%Int(%.loc9_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_35.2: type = value_of_initializer %int.make_type_signed.loc9_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_35.3: type = converted %int.make_type_signed.loc9_35, %.loc9_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%a.ref) -// CHECK:STDOUT: %.loc10_19.1: i32 = value_of_initializer %int.snegate -// CHECK:STDOUT: %.loc10_19.2: i32 = converted %int.snegate, %.loc10_19.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%a.ref) +// CHECK:STDOUT: %.loc10_19.1: %i32 = value_of_initializer %int.snegate +// CHECK:STDOUT: %.loc10_19.2: %i32 = converted %int.snegate, %.loc10_19.1 // CHECK:STDOUT: return %.loc10_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.31 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.32 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.32 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.30 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.31 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.31 = bind_name arr_p, %.loc5 // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc7_21.1: Core.IntLiteral = int_value 1 [template = constants.%.33] -// CHECK:STDOUT: %.loc7_21.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_21.3: = bound_method %.loc7_21.1, %.loc7_21.2 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc7_21.3(%.loc7_21.1) [template = constants.%.35] -// CHECK:STDOUT: %.loc7_21.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.35] -// CHECK:STDOUT: %.loc7_21.5: i32 = converted %.loc7_21.1, %.loc7_21.4 [template = constants.%.35] -// CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc7_21.5) [template = constants.%.36] -// CHECK:STDOUT: %.loc7_23.1: i32 = value_of_initializer %int.snegate [template = constants.%.36] -// CHECK:STDOUT: %.loc7_23.2: i32 = converted %int.snegate, %.loc7_23.1 [template = constants.%.36] -// CHECK:STDOUT: %n: i32 = bind_name n, %.loc7_23.2 +// CHECK:STDOUT: %.loc7_21.1: Core.IntLiteral = int_value 1 [template = constants.%.32] +// CHECK:STDOUT: %.loc7_21.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_21.3: = bound_method %.loc7_21.1, %.loc7_21.2 [template = constants.%.33] +// CHECK:STDOUT: %.loc7_21.4: = specific_function %.loc7_21.3, @Convert.2(constants.%.1) [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc7_21.4(%.loc7_21.1) [template = constants.%.35] +// CHECK:STDOUT: %.loc7_21.5: %i32 = value_of_initializer %int.convert_checked [template = constants.%.35] +// CHECK:STDOUT: %.loc7_21.6: %i32 = converted %.loc7_21.1, %.loc7_21.5 [template = constants.%.35] +// CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc7_21.6) [template = constants.%.36] +// CHECK:STDOUT: %.loc7_23.1: %i32 = value_of_initializer %int.snegate [template = constants.%.36] +// CHECK:STDOUT: %.loc7_23.2: %i32 = converted %int.snegate, %.loc7_23.1 [template = constants.%.36] +// CHECK:STDOUT: %n: %i32 = bind_name n, %.loc7_23.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_bad_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %TooFew.type: type = fn_type @TooFew [template] // CHECK:STDOUT: %TooFew: %TooFew.type = struct_value () [template] // CHECK:STDOUT: %TooMany.type: type = fn_type @TooMany [template] @@ -288,16 +306,18 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %BadReturnType: %BadReturnType.type = struct_value () [template] // CHECK:STDOUT: %JustRight.type: type = fn_type @JustRight [template] // CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] // CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] // CHECK:STDOUT: %RuntimeCallTooFew: %RuntimeCallTooFew.type = struct_value () [template] // CHECK:STDOUT: %RuntimeCallTooMany.type: type = fn_type @RuntimeCallTooMany [template] @@ -308,7 +328,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude @@ -333,253 +353,279 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_16.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_16.2: type = converted %int.make_type_32, %.loc8_16.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc8_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_16.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_16.3: type = converted %int.make_type_signed, %.loc8_16.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc13_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %int.make_type_32.loc13_15 [template = i32] -// CHECK:STDOUT: %.loc13_15.2: type = converted %int.make_type_32.loc13_15, %.loc13_15.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_32.loc13_23 [template = i32] -// CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_32.loc13_23, %.loc13_23.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_31: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_32.loc13_31 [template = i32] -// CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_32.loc13_31, %.loc13_31.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc13_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_15: init type = call constants.%Int(%.loc13_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_15.2: type = value_of_initializer %int.make_type_signed.loc13_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_15.3: type = converted %int.make_type_signed.loc13_15, %.loc13_15.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_23: init type = call constants.%Int(%.loc13_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_23.2: type = value_of_initializer %int.make_type_signed.loc13_23 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_23.3: type = converted %int.make_type_signed.loc13_23, %.loc13_23.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_31: init type = call constants.%Int(%.loc13_31.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.2: type = value_of_initializer %int.make_type_signed.loc13_31 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.3: type = converted %int.make_type_signed.loc13_31, %.loc13_31.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc18_21.2: type = converted %int.make_type_32, %.loc18_21.1 [template = i32] +// CHECK:STDOUT: %.loc18_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc18_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_21.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc18_21.3: type = converted %int.make_type_signed, %.loc18_21.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type, %.loc18_29.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param1 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc19_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_32.loc19_17 [template = i32] -// CHECK:STDOUT: %.loc19_17.2: type = converted %int.make_type_32.loc19_17, %.loc19_17.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc19_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_25.1: type = value_of_initializer %int.make_type_32.loc19_25 [template = i32] -// CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_32.loc19_25, %.loc19_25.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc19_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19_17: init type = call constants.%Int(%.loc19_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_17.2: type = value_of_initializer %int.make_type_signed.loc19_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_17.3: type = converted %int.make_type_signed.loc19_17, %.loc19_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19_25: init type = call constants.%Int(%.loc19_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_25.2: type = value_of_initializer %int.make_type_signed.loc19_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_25.3: type = converted %int.make_type_signed.loc19_25, %.loc19_25.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc25_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc25: init type = call constants.%Int(%.loc25_15.1) [template = constants.%i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %TooFew.call: init i32 = call %TooFew.ref() -// CHECK:STDOUT: %.loc25_15.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] -// CHECK:STDOUT: %.loc25_15.2: type = converted %int.make_type_32.loc25, %.loc25_15.1 [template = i32] +// CHECK:STDOUT: %TooFew.call: init %i32 = call %TooFew.ref() +// CHECK:STDOUT: %.loc25_15.2: type = value_of_initializer %int.make_type_signed.loc25 [template = constants.%i32] +// CHECK:STDOUT: %.loc25_15.3: type = converted %int.make_type_signed.loc25, %.loc25_15.2 [template = constants.%i32] // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var -// CHECK:STDOUT: %int.make_type_32.loc30: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc30_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc30: init type = call constants.%Int(%.loc30_16.1) [template = constants.%i32] // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, %TooMany.decl [template = constants.%TooMany] -// CHECK:STDOUT: %.loc30_29.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc30_32.1: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc30_29.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc30_29.3: = bound_method %.loc30_29.1, %.loc30_29.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc30_29: init i32 = call %.loc30_29.3(%.loc30_29.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc30_29.4: i32 = value_of_initializer %int.convert_checked.loc30_29 [template = constants.%.28] -// CHECK:STDOUT: %.loc30_29.5: i32 = converted %.loc30_29.1, %.loc30_29.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc30_32.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc30_32.3: = bound_method %.loc30_32.1, %.loc30_32.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc30_32: init i32 = call %.loc30_32.3(%.loc30_32.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc30_32.4: i32 = value_of_initializer %int.convert_checked.loc30_32 [template = constants.%.30] -// CHECK:STDOUT: %.loc30_32.5: i32 = converted %.loc30_32.1, %.loc30_32.4 [template = constants.%.30] -// CHECK:STDOUT: %TooMany.call: init i32 = call %TooMany.ref(%.loc30_29.5, %.loc30_32.5) -// CHECK:STDOUT: %.loc30_16.1: type = value_of_initializer %int.make_type_32.loc30 [template = i32] -// CHECK:STDOUT: %.loc30_16.2: type = converted %int.make_type_32.loc30, %.loc30_16.1 [template = i32] +// CHECK:STDOUT: %.loc30_29.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc30_32.1: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc30_29.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc30_29.3: = bound_method %.loc30_29.1, %.loc30_29.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc30_29.4: = specific_function %.loc30_29.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc30_29: init %i32 = call %.loc30_29.4(%.loc30_29.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc30_29.5: %i32 = value_of_initializer %int.convert_checked.loc30_29 [template = constants.%.26] +// CHECK:STDOUT: %.loc30_29.6: %i32 = converted %.loc30_29.1, %.loc30_29.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc30_32.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc30_32.3: = bound_method %.loc30_32.1, %.loc30_32.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc30_32.4: = specific_function %.loc30_32.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc30_32: init %i32 = call %.loc30_32.4(%.loc30_32.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc30_32.5: %i32 = value_of_initializer %int.convert_checked.loc30_32 [template = constants.%.29] +// CHECK:STDOUT: %.loc30_32.6: %i32 = converted %.loc30_32.1, %.loc30_32.5 [template = constants.%.29] +// CHECK:STDOUT: %TooMany.call: init %i32 = call %TooMany.ref(%.loc30_29.6, %.loc30_32.6) +// CHECK:STDOUT: %.loc30_16.2: type = value_of_initializer %int.make_type_signed.loc30 [template = constants.%i32] +// CHECK:STDOUT: %.loc30_16.3: type = converted %int.make_type_signed.loc30, %.loc30_16.2 [template = constants.%i32] // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var -// CHECK:STDOUT: %int.make_type_32.loc35: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc35_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc35: init type = call constants.%Int(%.loc35_23.1) [template = constants.%i32] // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %.loc35_42.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc35_42.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc35_42.3: = bound_method %.loc35_42.1, %.loc35_42.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc35: init i32 = call %.loc35_42.3(%.loc35_42.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc35_42.4: i32 = value_of_initializer %int.convert_checked.loc35 [template = constants.%.28] -// CHECK:STDOUT: %.loc35_42.5: i32 = converted %.loc35_42.1, %.loc35_42.4 [template = constants.%.28] -// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42.5) -// CHECK:STDOUT: %.loc35_23.1: type = value_of_initializer %int.make_type_32.loc35 [template = i32] -// CHECK:STDOUT: %.loc35_23.2: type = converted %int.make_type_32.loc35, %.loc35_23.1 [template = i32] +// CHECK:STDOUT: %.loc35_42.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc35_42.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc35_42.3: = bound_method %.loc35_42.1, %.loc35_42.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc35_42.4: = specific_function %.loc35_42.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc35: init %i32 = call %.loc35_42.4(%.loc35_42.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc35_42.5: %i32 = value_of_initializer %int.convert_checked.loc35 [template = constants.%.26] +// CHECK:STDOUT: %.loc35_42.6: %i32 = converted %.loc35_42.1, %.loc35_42.5 [template = constants.%.26] +// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42.6) +// CHECK:STDOUT: %.loc35_23.2: type = value_of_initializer %int.make_type_signed.loc35 [template = constants.%i32] +// CHECK:STDOUT: %.loc35_23.3: type = converted %int.make_type_signed.loc35, %.loc35_23.2 [template = constants.%i32] // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var -// CHECK:STDOUT: %int.make_type_32.loc44: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc44_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc44: init type = call constants.%Int(%.loc44_16.1) [template = constants.%i32] // CHECK:STDOUT: %JustRight.ref: %JustRight.type = name_ref JustRight, %JustRight.decl [template = constants.%JustRight] -// CHECK:STDOUT: %.loc44_31: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc44_34: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc44_16.1: type = value_of_initializer %int.make_type_32.loc44 [template = i32] -// CHECK:STDOUT: %.loc44_16.2: type = converted %int.make_type_32.loc44, %.loc44_16.1 [template = i32] -// CHECK:STDOUT: %.loc44_36: type = array_type , i32 [template = ] +// CHECK:STDOUT: %.loc44_31: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc44_34: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc44_16.2: type = value_of_initializer %int.make_type_signed.loc44 [template = constants.%i32] +// CHECK:STDOUT: %.loc44_16.3: type = converted %int.make_type_signed.loc44, %.loc44_16.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc44_36: type = array_type , %i32 [template = ] // CHECK:STDOUT: %bad_call.var: ref = var bad_call // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc46_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc46_25.1: type = value_of_initializer %int.make_type_32.loc46_25 [template = i32] -// CHECK:STDOUT: %.loc46_25.2: type = converted %int.make_type_32.loc46_25, %.loc46_25.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc46_33: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc46_33.1: type = value_of_initializer %int.make_type_32.loc46_33 [template = i32] -// CHECK:STDOUT: %.loc46_33.2: type = converted %int.make_type_32.loc46_33, %.loc46_33.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc46_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc46_25: init type = call constants.%Int(%.loc46_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc46_25.2: type = value_of_initializer %int.make_type_signed.loc46_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc46_25.3: type = converted %int.make_type_signed.loc46_25, %.loc46_25.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc46_33.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc46_33: init type = call constants.%Int(%.loc46_33.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc46_33.2: type = value_of_initializer %int.make_type_signed.loc46_33 [template = constants.%i32] +// CHECK:STDOUT: %.loc46_33.3: type = converted %int.make_type_signed.loc46_33, %.loc46_33.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %c.patt: i32 = binding_pattern c -// CHECK:STDOUT: %c.param_patt: i32 = value_param_pattern %c.patt, runtime_param2 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param3 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %c.patt: %i32 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %i32 = value_param_pattern %c.patt, runtime_param2 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc57_26: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc57_26.1: type = value_of_initializer %int.make_type_32.loc57_26 [template = i32] -// CHECK:STDOUT: %.loc57_26.2: type = converted %int.make_type_32.loc57_26, %.loc57_26.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc57_34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc57_34.1: type = value_of_initializer %int.make_type_32.loc57_34 [template = i32] -// CHECK:STDOUT: %.loc57_34.2: type = converted %int.make_type_32.loc57_34, %.loc57_34.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc57_42: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc57_42.1: type = value_of_initializer %int.make_type_32.loc57_42 [template = i32] -// CHECK:STDOUT: %.loc57_42.2: type = converted %int.make_type_32.loc57_42, %.loc57_42.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc57_50: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc57_50.1: type = value_of_initializer %int.make_type_32.loc57_50 [template = i32] -// CHECK:STDOUT: %.loc57_50.2: type = converted %int.make_type_32.loc57_50, %.loc57_50.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %c.param: i32 = value_param runtime_param2 -// CHECK:STDOUT: %c: i32 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param3 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc57_26.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc57_26: init type = call constants.%Int(%.loc57_26.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc57_26.2: type = value_of_initializer %int.make_type_signed.loc57_26 [template = constants.%i32] +// CHECK:STDOUT: %.loc57_26.3: type = converted %int.make_type_signed.loc57_26, %.loc57_26.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc57_34.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc57_34: init type = call constants.%Int(%.loc57_34.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc57_34.2: type = value_of_initializer %int.make_type_signed.loc57_34 [template = constants.%i32] +// CHECK:STDOUT: %.loc57_34.3: type = converted %int.make_type_signed.loc57_34, %.loc57_34.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc57_42.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc57_42: init type = call constants.%Int(%.loc57_42.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc57_42.2: type = value_of_initializer %int.make_type_signed.loc57_42 [template = constants.%i32] +// CHECK:STDOUT: %.loc57_42.3: type = converted %int.make_type_signed.loc57_42, %.loc57_42.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc57_50.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc57_50: init type = call constants.%Int(%.loc57_50.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc57_50.2: type = value_of_initializer %int.make_type_signed.loc57_50 [template = constants.%i32] +// CHECK:STDOUT: %.loc57_50.3: type = converted %int.make_type_signed.loc57_50, %.loc57_50.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %c.param: %i32 = value_param runtime_param2 +// CHECK:STDOUT: %c: %i32 = bind_name c, %c.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc68_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc68_32.1: type = value_of_initializer %int.make_type_32.loc68_32 [template = i32] -// CHECK:STDOUT: %.loc68_32.2: type = converted %int.make_type_32.loc68_32, %.loc68_32.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc68_40: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc68_40.1: type = value_of_initializer %int.make_type_32.loc68_40 [template = i32] -// CHECK:STDOUT: %.loc68_40.2: type = converted %int.make_type_32.loc68_40, %.loc68_40.1 [template = i32] +// CHECK:STDOUT: %.loc68_32.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc68_32: init type = call constants.%Int(%.loc68_32.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc68_32.2: type = value_of_initializer %int.make_type_signed.loc68_32 [template = constants.%i32] +// CHECK:STDOUT: %.loc68_32.3: type = converted %int.make_type_signed.loc68_32, %.loc68_32.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc68_40.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc68_40: init type = call constants.%Int(%.loc68_40.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc68_40.2: type = value_of_initializer %int.make_type_signed.loc68_40 [template = constants.%i32] +// CHECK:STDOUT: %.loc68_40.3: type = converted %int.make_type_signed.loc68_40, %.loc68_40.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc68_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc68_48.2: type = converted %bool.make_type, %.loc68_48.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooFew() -> i32; +// CHECK:STDOUT: fn @TooFew() -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooMany(%a.param_patt: i32, %b.param_patt: i32) -> i32; +// CHECK:STDOUT: fn @TooMany(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: i32) -> bool; +// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: %i32) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @JustRight(%a.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @JustRight(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: i32, %b.param_patt: i32, %c.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: %i32, %b.param_patt: %i32, %c.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %c.ref: i32 = name_ref c, %c +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %c.ref: %i32 = name_ref c, %c // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: i32, %b.param_patt: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] // CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %.28: i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: i32 = int_value -2147483648 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.26: %i32 = int_value -2147483647 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: %i32 = int_value -2147483648 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -596,100 +642,110 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer %int.make_type_32.loc4_14 [template = i32] -// CHECK:STDOUT: %.loc4_14.2: type = converted %int.make_type_32.loc4_14, %.loc4_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_22.1: type = value_of_initializer %int.make_type_32.loc4_22 [template = i32] -// CHECK:STDOUT: %.loc4_22.2: type = converted %int.make_type_32.loc4_22, %.loc4_22.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_14: init type = call constants.%Int(%.loc4_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_14.2: type = value_of_initializer %int.make_type_signed.loc4_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_14.3: type = converted %int.make_type_signed.loc4_14, %.loc4_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_22: init type = call constants.%Int(%.loc4_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_22.2: type = value_of_initializer %int.make_type_signed.loc4_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_22.3: type = converted %int.make_type_signed.loc4_22, %.loc4_22.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] -// CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_32.loc5_11, %.loc5_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_32.loc5_19 [template = i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_32.loc5_19, %.loc5_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_32.loc5_27 [template = i32] -// CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc5_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_11: init type = call constants.%Int(%.loc5_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_11.2: type = value_of_initializer %int.make_type_signed.loc5_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_11.3: type = converted %int.make_type_signed.loc5_11, %.loc5_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_19: init type = call constants.%Int(%.loc5_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.2: type = value_of_initializer %int.make_type_signed.loc5_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.3: type = converted %int.make_type_signed.loc5_19, %.loc5_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_27: init type = call constants.%Int(%.loc5_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.2: type = value_of_initializer %int.make_type_signed.loc5_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.3: type = converted %int.make_type_signed.loc5_27, %.loc5_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] -// CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_32.loc8, %.loc8_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_8.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] -// CHECK:STDOUT: %.loc14_8.2: type = converted %int.make_type_32.loc14, %.loc14_8.1 [template = i32] +// CHECK:STDOUT: %.loc8_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8.3: type = converted %int.make_type_signed.loc8, %.loc8_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%.loc14_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_8.2: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_8.3: type = converted %int.make_type_signed.loc14, %.loc14_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.ssub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Negate.ref.loc8_14: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %Negate.ref.loc8_21: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc8_28.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc8_28.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_28.3: = bound_method %.loc8_28.1, %.loc8_28.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc8: init i32 = call %.loc8_28.3(%.loc8_28.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc8_28.4: i32 = value_of_initializer %int.convert_checked.loc8 [template = constants.%.27] -// CHECK:STDOUT: %.loc8_28.5: i32 = converted %.loc8_28.1, %.loc8_28.4 [template = constants.%.27] -// CHECK:STDOUT: %int.snegate.loc8_27: init i32 = call %Negate.ref.loc8_21(%.loc8_28.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc8_27.1: i32 = value_of_initializer %int.snegate.loc8_27 [template = constants.%.28] -// CHECK:STDOUT: %.loc8_27.2: i32 = converted %int.snegate.loc8_27, %.loc8_27.1 [template = constants.%.28] -// CHECK:STDOUT: %int.snegate.loc8_20: init i32 = call %Negate.ref.loc8_14(%.loc8_27.2) [template = constants.%.27] -// CHECK:STDOUT: %.loc8_40.1: i32 = value_of_initializer %int.snegate.loc8_20 [template = constants.%.27] -// CHECK:STDOUT: %.loc8_40.2: i32 = converted %int.snegate.loc8_20, %.loc8_40.1 [template = constants.%.27] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc8_40.2 +// CHECK:STDOUT: %.loc8_28.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc8_28.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_28.3: = bound_method %.loc8_28.1, %.loc8_28.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc8_28.4: = specific_function %.loc8_28.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %.loc8_28.4(%.loc8_28.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc8_28.5: %i32 = value_of_initializer %int.convert_checked.loc8 [template = constants.%.25] +// CHECK:STDOUT: %.loc8_28.6: %i32 = converted %.loc8_28.1, %.loc8_28.5 [template = constants.%.25] +// CHECK:STDOUT: %int.snegate.loc8_27: init %i32 = call %Negate.ref.loc8_21(%.loc8_28.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %int.snegate.loc8_27 [template = constants.%.26] +// CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int.snegate.loc8_27, %.loc8_27.1 [template = constants.%.26] +// CHECK:STDOUT: %int.snegate.loc8_20: init %i32 = call %Negate.ref.loc8_14(%.loc8_27.2) [template = constants.%.25] +// CHECK:STDOUT: %.loc8_40.1: %i32 = value_of_initializer %int.snegate.loc8_20 [template = constants.%.25] +// CHECK:STDOUT: %.loc8_40.2: %i32 = converted %int.snegate.loc8_20, %.loc8_40.1 [template = constants.%.25] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc8_40.2 // CHECK:STDOUT: %Negate.ref.loc14_14: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc14_25: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc14_32.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc14_32.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_32.3: = bound_method %.loc14_32.1, %.loc14_32.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc14_32: init i32 = call %.loc14_32.3(%.loc14_32.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc14_32.4: i32 = value_of_initializer %int.convert_checked.loc14_32 [template = constants.%.27] -// CHECK:STDOUT: %.loc14_32.5: i32 = converted %.loc14_32.1, %.loc14_32.4 [template = constants.%.27] -// CHECK:STDOUT: %int.snegate.loc14_31: init i32 = call %Negate.ref.loc14_25(%.loc14_32.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc14_45.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc14_31.1: i32 = value_of_initializer %int.snegate.loc14_31 [template = constants.%.28] -// CHECK:STDOUT: %.loc14_31.2: i32 = converted %int.snegate.loc14_31, %.loc14_31.1 [template = constants.%.28] -// CHECK:STDOUT: %.loc14_45.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_45.3: = bound_method %.loc14_45.1, %.loc14_45.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc14_45: init i32 = call %.loc14_45.3(%.loc14_45.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc14_45.4: i32 = value_of_initializer %int.convert_checked.loc14_45 [template = constants.%.31] -// CHECK:STDOUT: %.loc14_45.5: i32 = converted %.loc14_45.1, %.loc14_45.4 [template = constants.%.31] -// CHECK:STDOUT: %int.ssub: init i32 = call %Sub.ref(%.loc14_31.2, %.loc14_45.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc14_24.1: i32 = value_of_initializer %int.ssub [template = constants.%.32] -// CHECK:STDOUT: %.loc14_24.2: i32 = converted %int.ssub, %.loc14_24.1 [template = constants.%.32] -// CHECK:STDOUT: %int.snegate.loc14_20: init i32 = call %Negate.ref.loc14_14(%.loc14_24.2) [template = constants.%.32] -// CHECK:STDOUT: %.loc14_48.1: i32 = value_of_initializer %int.snegate.loc14_20 [template = constants.%.32] -// CHECK:STDOUT: %.loc14_48.2: i32 = converted %int.snegate.loc14_20, %.loc14_48.1 [template = constants.%.32] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc14_48.2 +// CHECK:STDOUT: %.loc14_32.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_32.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_32.3: = bound_method %.loc14_32.1, %.loc14_32.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc14_32.4: = specific_function %.loc14_32.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc14_32: init %i32 = call %.loc14_32.4(%.loc14_32.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc14_32.5: %i32 = value_of_initializer %int.convert_checked.loc14_32 [template = constants.%.25] +// CHECK:STDOUT: %.loc14_32.6: %i32 = converted %.loc14_32.1, %.loc14_32.5 [template = constants.%.25] +// CHECK:STDOUT: %int.snegate.loc14_31: init %i32 = call %Negate.ref.loc14_25(%.loc14_32.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc14_45.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc14_31.1: %i32 = value_of_initializer %int.snegate.loc14_31 [template = constants.%.26] +// CHECK:STDOUT: %.loc14_31.2: %i32 = converted %int.snegate.loc14_31, %.loc14_31.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc14_45.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_45.3: = bound_method %.loc14_45.1, %.loc14_45.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc14_45.4: = specific_function %.loc14_45.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc14_45: init %i32 = call %.loc14_45.4(%.loc14_45.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc14_45.5: %i32 = value_of_initializer %int.convert_checked.loc14_45 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_45.6: %i32 = converted %.loc14_45.1, %.loc14_45.5 [template = constants.%.30] +// CHECK:STDOUT: %int.ssub: init %i32 = call %Sub.ref(%.loc14_31.2, %.loc14_45.6) [template = constants.%.31] +// CHECK:STDOUT: %.loc14_24.1: %i32 = value_of_initializer %int.ssub [template = constants.%.31] +// CHECK:STDOUT: %.loc14_24.2: %i32 = converted %int.ssub, %.loc14_24.1 [template = constants.%.31] +// CHECK:STDOUT: %int.snegate.loc14_20: init %i32 = call %Negate.ref.loc14_14(%.loc14_24.2) [template = constants.%.31] +// CHECK:STDOUT: %.loc14_48.1: %i32 = value_of_initializer %int.snegate.loc14_20 [template = constants.%.31] +// CHECK:STDOUT: %.loc14_48.2: %i32 = converted %int.snegate.loc14_20, %.loc14_48.1 [template = constants.%.31] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc14_48.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/ssub.carbon b/toolchain/check/testdata/builtins/int/ssub.carbon index ffd21dace057..9aad99ce26f9 100644 --- a/toolchain/check/testdata/builtins/int/ssub.carbon +++ b/toolchain/check/testdata/builtins/int/ssub.carbon @@ -35,28 +35,33 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: --- int_sub.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] // CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 3 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 3 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.16 [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.15 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.4(%.1) [template] // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.35: type = array_type %.34, i32 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, %i32 [template] // CHECK:STDOUT: %.36: type = ptr_type %.35 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] @@ -64,7 +69,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -81,98 +86,109 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%.loc2_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.3: type = converted %int.make_type_signed.loc2_11, %.loc2_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%.loc2_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.3: type = converted %int.make_type_signed.loc2_19, %.loc2_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%.loc2_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.2: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.3: type = converted %int.make_type_signed.loc2_27, %.loc2_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, %Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init i32 = call %.loc4_20.3(%.loc4_20.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.4: i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.5: i32 = converted %.loc4_20.1, %.loc4_20.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init i32 = call %.loc4_23.3(%.loc4_23.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.4: i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.5: i32 = converted %.loc4_23.1, %.loc4_23.4 [template = constants.%.30] -// CHECK:STDOUT: %int.ssub: init i32 = call %Sub.ref(%.loc4_20.5, %.loc4_23.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_19.1: %Convert.type.5 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.ssub, %.loc4_19.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.ssub [template = constants.%.31] -// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.ssub, %.loc4_19.3 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.ssub, %.loc4_19.5 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_20.4: = specific_function %.loc4_20.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %.loc4_20.4(%.loc4_20.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.5: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.6: %i32 = converted %.loc4_20.1, %.loc4_20.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_23.4: = specific_function %.loc4_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %.loc4_23.4(%.loc4_23.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.5: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.6: %i32 = converted %.loc4_23.1, %.loc4_23.5 [template = constants.%.29] +// CHECK:STDOUT: %int.ssub: init %i32 = call %Sub.ref(%.loc4_20.6, %.loc4_23.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.6 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.ssub, %.loc4_19.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc4_19.3: = specific_function %.loc4_19.2, @Convert.4(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc4_19.4: %i32 = value_of_initializer %int.ssub [template = constants.%.30] +// CHECK:STDOUT: %.loc4_19.5: %i32 = converted %int.ssub, %.loc4_19.4 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.3(%.loc4_19.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.7: Core.IntLiteral = converted %int.ssub, %.loc4_19.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.7, %i32 [template = constants.%.35] // CHECK:STDOUT: %arr.var: ref %.35 = var arr // CHECK:STDOUT: %arr: ref %.35 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_13.1) [template = constants.%i32] // CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 1 [template = constants.%.34] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_13.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_13.3: type = converted %int.make_type_signed.loc5, %.loc5_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, %i32 [template = constants.%.35] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.35 [template = constants.%.36] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.3: type = converted %int.make_type_signed.loc7_19, %.loc7_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%.loc7_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.3: type = converted %int.make_type_signed.loc7_27, %.loc7_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%.loc7_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.3: type = converted %int.make_type_signed.loc7_35, %.loc7_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.ssub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %int.ssub: init i32 = call %Sub.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: i32 = value_of_initializer %int.ssub -// CHECK:STDOUT: %.loc8_19.2: i32 = converted %int.ssub, %.loc8_19.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %int.ssub: init %i32 = call %Sub.ref(%a.ref, %b.ref) +// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.ssub +// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.ssub, %.loc8_19.1 // CHECK:STDOUT: return %.loc8_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -187,33 +203,39 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: --- fail_overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] // CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 0 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %.31: i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 1 [template] -// CHECK:STDOUT: %.35: i32 = int_value -2147483648 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.30: %i32 = int_value -2147483647 [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.32: = bound_method %.31, %Convert.14 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.35: %i32 = int_value -2147483648 [template] // CHECK:STDOUT: %.36: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.37: = bound_method %.36, %Convert.15 [template] -// CHECK:STDOUT: %.38: i32 = int_value 2 [template] +// CHECK:STDOUT: %.37: = bound_method %.36, %Convert.14 [template] +// CHECK:STDOUT: %.38: = specific_function %.37, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.39: %i32 = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -230,115 +252,129 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4_11, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%.loc4_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.3: type = converted %int.make_type_signed.loc4_19, %.loc4_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed.loc4_27, %.loc4_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_32.loc11, %.loc11_8.1 [template = i32] +// CHECK:STDOUT: %.loc6_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.3: type = converted %int.make_type_signed.loc6, %.loc6_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%.loc7_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.2: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.3: type = converted %int.make_type_signed.loc7, %.loc7_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_8.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_8.3: type = converted %int.make_type_signed.loc11, %.loc11_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.ssub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Sub.ref.loc6: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %.loc6_18.1: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc6_21.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] -// CHECK:STDOUT: %.loc6_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_18.3: = bound_method %.loc6_18.1, %.loc6_18.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc6_18: init i32 = call %.loc6_18.3(%.loc6_18.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc6_18.4: i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_18.5: i32 = converted %.loc6_18.1, %.loc6_18.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_21.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_21.3: = bound_method %.loc6_21.1, %.loc6_21.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc6_21: init i32 = call %.loc6_21.3(%.loc6_21.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc6_21.4: i32 = value_of_initializer %int.convert_checked.loc6_21 [template = constants.%.30] -// CHECK:STDOUT: %.loc6_21.5: i32 = converted %.loc6_21.1, %.loc6_21.4 [template = constants.%.30] -// CHECK:STDOUT: %int.ssub.loc6: init i32 = call %Sub.ref.loc6(%.loc6_18.5, %.loc6_21.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc6_32.1: i32 = value_of_initializer %int.ssub.loc6 [template = constants.%.31] -// CHECK:STDOUT: %.loc6_32.2: i32 = converted %int.ssub.loc6, %.loc6_32.1 [template = constants.%.31] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc6_32.2 +// CHECK:STDOUT: %.loc6_18.1: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc6_21.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.3] +// CHECK:STDOUT: %.loc6_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_18.3: = bound_method %.loc6_18.1, %.loc6_18.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc6_18.4: = specific_function %.loc6_18.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %.loc6_18.4(%.loc6_18.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc6_18.5: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%.26] +// CHECK:STDOUT: %.loc6_18.6: %i32 = converted %.loc6_18.1, %.loc6_18.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc6_21.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_21.3: = bound_method %.loc6_21.1, %.loc6_21.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc6_21.4: = specific_function %.loc6_21.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc6_21: init %i32 = call %.loc6_21.4(%.loc6_21.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc6_21.5: %i32 = value_of_initializer %int.convert_checked.loc6_21 [template = constants.%.29] +// CHECK:STDOUT: %.loc6_21.6: %i32 = converted %.loc6_21.1, %.loc6_21.5 [template = constants.%.29] +// CHECK:STDOUT: %int.ssub.loc6: init %i32 = call %Sub.ref.loc6(%.loc6_18.6, %.loc6_21.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc6_32.1: %i32 = value_of_initializer %int.ssub.loc6 [template = constants.%.30] +// CHECK:STDOUT: %.loc6_32.2: %i32 = converted %int.ssub.loc6, %.loc6_32.1 [template = constants.%.30] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc6_32.2 // CHECK:STDOUT: %Sub.ref.loc7_14: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Sub.ref.loc7_18: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %.loc7_22.1: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc7_25.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] -// CHECK:STDOUT: %.loc7_22.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_22.3: = bound_method %.loc7_22.1, %.loc7_22.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc7_22: init i32 = call %.loc7_22.3(%.loc7_22.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc7_22.4: i32 = value_of_initializer %int.convert_checked.loc7_22 [template = constants.%.28] -// CHECK:STDOUT: %.loc7_22.5: i32 = converted %.loc7_22.1, %.loc7_22.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc7_25.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_25.3: = bound_method %.loc7_25.1, %.loc7_25.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc7_25: init i32 = call %.loc7_25.3(%.loc7_25.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc7_25.4: i32 = value_of_initializer %int.convert_checked.loc7_25 [template = constants.%.30] -// CHECK:STDOUT: %.loc7_25.5: i32 = converted %.loc7_25.1, %.loc7_25.4 [template = constants.%.30] -// CHECK:STDOUT: %int.ssub.loc7_21: init i32 = call %Sub.ref.loc7_18(%.loc7_22.5, %.loc7_25.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc7_38.1: Core.IntLiteral = int_value 1 [template = constants.%.32] -// CHECK:STDOUT: %.loc7_21.1: i32 = value_of_initializer %int.ssub.loc7_21 [template = constants.%.31] -// CHECK:STDOUT: %.loc7_21.2: i32 = converted %int.ssub.loc7_21, %.loc7_21.1 [template = constants.%.31] -// CHECK:STDOUT: %.loc7_38.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_38.3: = bound_method %.loc7_38.1, %.loc7_38.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc7_38: init i32 = call %.loc7_38.3(%.loc7_38.1) [template = constants.%.34] -// CHECK:STDOUT: %.loc7_38.4: i32 = value_of_initializer %int.convert_checked.loc7_38 [template = constants.%.34] -// CHECK:STDOUT: %.loc7_38.5: i32 = converted %.loc7_38.1, %.loc7_38.4 [template = constants.%.34] -// CHECK:STDOUT: %int.ssub.loc7_17: init i32 = call %Sub.ref.loc7_14(%.loc7_21.2, %.loc7_38.5) [template = constants.%.35] -// CHECK:STDOUT: %.loc7_40.1: i32 = value_of_initializer %int.ssub.loc7_17 [template = constants.%.35] -// CHECK:STDOUT: %.loc7_40.2: i32 = converted %int.ssub.loc7_17, %.loc7_40.1 [template = constants.%.35] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc7_40.2 +// CHECK:STDOUT: %.loc7_22.1: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc7_25.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.3] +// CHECK:STDOUT: %.loc7_22.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_22.3: = bound_method %.loc7_22.1, %.loc7_22.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc7_22.4: = specific_function %.loc7_22.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc7_22: init %i32 = call %.loc7_22.4(%.loc7_22.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc7_22.5: %i32 = value_of_initializer %int.convert_checked.loc7_22 [template = constants.%.26] +// CHECK:STDOUT: %.loc7_22.6: %i32 = converted %.loc7_22.1, %.loc7_22.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc7_25.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_25.3: = bound_method %.loc7_25.1, %.loc7_25.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc7_25.4: = specific_function %.loc7_25.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc7_25: init %i32 = call %.loc7_25.4(%.loc7_25.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc7_25.5: %i32 = value_of_initializer %int.convert_checked.loc7_25 [template = constants.%.29] +// CHECK:STDOUT: %.loc7_25.6: %i32 = converted %.loc7_25.1, %.loc7_25.5 [template = constants.%.29] +// CHECK:STDOUT: %int.ssub.loc7_21: init %i32 = call %Sub.ref.loc7_18(%.loc7_22.6, %.loc7_25.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc7_38.1: Core.IntLiteral = int_value 1 [template = constants.%.31] +// CHECK:STDOUT: %.loc7_21.1: %i32 = value_of_initializer %int.ssub.loc7_21 [template = constants.%.30] +// CHECK:STDOUT: %.loc7_21.2: %i32 = converted %int.ssub.loc7_21, %.loc7_21.1 [template = constants.%.30] +// CHECK:STDOUT: %.loc7_38.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_38.3: = bound_method %.loc7_38.1, %.loc7_38.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc7_38.4: = specific_function %.loc7_38.3, @Convert.2(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc7_38: init %i32 = call %.loc7_38.4(%.loc7_38.1) [template = constants.%.34] +// CHECK:STDOUT: %.loc7_38.5: %i32 = value_of_initializer %int.convert_checked.loc7_38 [template = constants.%.34] +// CHECK:STDOUT: %.loc7_38.6: %i32 = converted %.loc7_38.1, %.loc7_38.5 [template = constants.%.34] +// CHECK:STDOUT: %int.ssub.loc7_17: init %i32 = call %Sub.ref.loc7_14(%.loc7_21.2, %.loc7_38.6) [template = constants.%.35] +// CHECK:STDOUT: %.loc7_40.1: %i32 = value_of_initializer %int.ssub.loc7_17 [template = constants.%.35] +// CHECK:STDOUT: %.loc7_40.2: %i32 = converted %int.ssub.loc7_17, %.loc7_40.1 [template = constants.%.35] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc7_40.2 // CHECK:STDOUT: %Sub.ref.loc11_14: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Sub.ref.loc11_18: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %.loc11_22.1: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_25.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] -// CHECK:STDOUT: %.loc11_22.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_22.3: = bound_method %.loc11_22.1, %.loc11_22.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc11_22: init i32 = call %.loc11_22.3(%.loc11_22.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc11_22.4: i32 = value_of_initializer %int.convert_checked.loc11_22 [template = constants.%.28] -// CHECK:STDOUT: %.loc11_22.5: i32 = converted %.loc11_22.1, %.loc11_22.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc11_25.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_25.3: = bound_method %.loc11_25.1, %.loc11_25.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc11_25: init i32 = call %.loc11_25.3(%.loc11_25.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc11_25.4: i32 = value_of_initializer %int.convert_checked.loc11_25 [template = constants.%.30] -// CHECK:STDOUT: %.loc11_25.5: i32 = converted %.loc11_25.1, %.loc11_25.4 [template = constants.%.30] -// CHECK:STDOUT: %int.ssub.loc11_21: init i32 = call %Sub.ref.loc11_18(%.loc11_22.5, %.loc11_25.5) [template = constants.%.31] +// CHECK:STDOUT: %.loc11_22.1: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_25.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_22.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_22.3: = bound_method %.loc11_22.1, %.loc11_22.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc11_22.4: = specific_function %.loc11_22.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc11_22: init %i32 = call %.loc11_22.4(%.loc11_22.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc11_22.5: %i32 = value_of_initializer %int.convert_checked.loc11_22 [template = constants.%.26] +// CHECK:STDOUT: %.loc11_22.6: %i32 = converted %.loc11_22.1, %.loc11_22.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc11_25.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_25.3: = bound_method %.loc11_25.1, %.loc11_25.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_25.4: = specific_function %.loc11_25.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc11_25: init %i32 = call %.loc11_25.4(%.loc11_25.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc11_25.5: %i32 = value_of_initializer %int.convert_checked.loc11_25 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_25.6: %i32 = converted %.loc11_25.1, %.loc11_25.5 [template = constants.%.29] +// CHECK:STDOUT: %int.ssub.loc11_21: init %i32 = call %Sub.ref.loc11_18(%.loc11_22.6, %.loc11_25.6) [template = constants.%.30] // CHECK:STDOUT: %.loc11_38.1: Core.IntLiteral = int_value 2 [template = constants.%.36] -// CHECK:STDOUT: %.loc11_21.1: i32 = value_of_initializer %int.ssub.loc11_21 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_21.2: i32 = converted %int.ssub.loc11_21, %.loc11_21.1 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_38.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc11_21.1: %i32 = value_of_initializer %int.ssub.loc11_21 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_21.2: %i32 = converted %int.ssub.loc11_21, %.loc11_21.1 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_38.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] // CHECK:STDOUT: %.loc11_38.3: = bound_method %.loc11_38.1, %.loc11_38.2 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc11_38: init i32 = call %.loc11_38.3(%.loc11_38.1) [template = constants.%.38] -// CHECK:STDOUT: %.loc11_38.4: i32 = value_of_initializer %int.convert_checked.loc11_38 [template = constants.%.38] -// CHECK:STDOUT: %.loc11_38.5: i32 = converted %.loc11_38.1, %.loc11_38.4 [template = constants.%.38] -// CHECK:STDOUT: %int.ssub.loc11_17: init i32 = call %Sub.ref.loc11_14(%.loc11_21.2, %.loc11_38.5) [template = constants.%.30] -// CHECK:STDOUT: %.loc11_40.1: i32 = value_of_initializer %int.ssub.loc11_17 [template = constants.%.30] -// CHECK:STDOUT: %.loc11_40.2: i32 = converted %int.ssub.loc11_17, %.loc11_40.1 [template = constants.%.30] -// CHECK:STDOUT: %c: i32 = bind_name c, %.loc11_40.2 +// CHECK:STDOUT: %.loc11_38.4: = specific_function %.loc11_38.3, @Convert.2(constants.%.1) [template = constants.%.38] +// CHECK:STDOUT: %int.convert_checked.loc11_38: init %i32 = call %.loc11_38.4(%.loc11_38.1) [template = constants.%.39] +// CHECK:STDOUT: %.loc11_38.5: %i32 = value_of_initializer %int.convert_checked.loc11_38 [template = constants.%.39] +// CHECK:STDOUT: %.loc11_38.6: %i32 = converted %.loc11_38.1, %.loc11_38.5 [template = constants.%.39] +// CHECK:STDOUT: %int.ssub.loc11_17: init %i32 = call %Sub.ref.loc11_14(%.loc11_21.2, %.loc11_38.6) [template = constants.%.29] +// CHECK:STDOUT: %.loc11_40.1: %i32 = value_of_initializer %int.ssub.loc11_17 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_40.2: %i32 = converted %int.ssub.loc11_17, %.loc11_40.1 [template = constants.%.29] +// CHECK:STDOUT: %c: %i32 = bind_name c, %.loc11_40.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/uadd.carbon b/toolchain/check/testdata/builtins/int/uadd.carbon index 1f54c12769a6..503a0efdb13f 100644 --- a/toolchain/check/testdata/builtins/int/uadd.carbon +++ b/toolchain/check/testdata/builtins/int/uadd.carbon @@ -89,28 +89,33 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: --- int_add.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Add.type: type = fn_type @Add [template] // CHECK:STDOUT: %Add: %Add.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 3 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] -// CHECK:STDOUT: %.31: i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.16 [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.15 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.4(%.1) [template] // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.35: type = array_type %.34, i32 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, %i32 [template] // CHECK:STDOUT: %.36: type = ptr_type %.35 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] @@ -118,7 +123,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -135,98 +140,109 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%.loc2_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.3: type = converted %int.make_type_signed.loc2_11, %.loc2_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%.loc2_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.3: type = converted %int.make_type_signed.loc2_19, %.loc2_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%.loc2_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.2: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.3: type = converted %int.make_type_signed.loc2_27, %.loc2_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] -// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init i32 = call %.loc4_20.3(%.loc4_20.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.4: i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.5: i32 = converted %.loc4_20.1, %.loc4_20.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init i32 = call %.loc4_23.3(%.loc4_23.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.4: i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.5: i32 = converted %.loc4_23.1, %.loc4_23.4 [template = constants.%.30] -// CHECK:STDOUT: %int.uadd: init i32 = call %Add.ref(%.loc4_20.5, %.loc4_23.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_19.1: %Convert.type.5 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.uadd, %.loc4_19.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.uadd [template = constants.%.31] -// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.uadd, %.loc4_19.3 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.uadd, %.loc4_19.5 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_20.4: = specific_function %.loc4_20.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %.loc4_20.4(%.loc4_20.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.5: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.6: %i32 = converted %.loc4_20.1, %.loc4_20.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_23.4: = specific_function %.loc4_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %.loc4_23.4(%.loc4_23.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.5: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.6: %i32 = converted %.loc4_23.1, %.loc4_23.5 [template = constants.%.29] +// CHECK:STDOUT: %int.uadd: init %i32 = call %Add.ref(%.loc4_20.6, %.loc4_23.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.6 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.uadd, %.loc4_19.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc4_19.3: = specific_function %.loc4_19.2, @Convert.4(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc4_19.4: %i32 = value_of_initializer %int.uadd [template = constants.%.30] +// CHECK:STDOUT: %.loc4_19.5: %i32 = converted %int.uadd, %.loc4_19.4 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.3(%.loc4_19.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.7: Core.IntLiteral = converted %int.uadd, %.loc4_19.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.7, %i32 [template = constants.%.35] // CHECK:STDOUT: %arr.var: ref %.35 = var arr // CHECK:STDOUT: %arr: ref %.35 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_13.1) [template = constants.%i32] // CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 3 [template = constants.%.34] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_13.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_13.3: type = converted %int.make_type_signed.loc5, %.loc5_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, %i32 [template = constants.%.35] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.35 [template = constants.%.36] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.3: type = converted %int.make_type_signed.loc7_19, %.loc7_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%.loc7_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.3: type = converted %int.make_type_signed.loc7_27, %.loc7_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%.loc7_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.3: type = converted %int.make_type_signed.loc7_35, %.loc7_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.uadd"; +// CHECK:STDOUT: fn @Add(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.uadd"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %int.uadd: init i32 = call %Add.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: i32 = value_of_initializer %int.uadd -// CHECK:STDOUT: %.loc8_19.2: i32 = converted %int.uadd, %.loc8_19.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %int.uadd: init %i32 = call %Add.ref(%a.ref, %b.ref) +// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.uadd +// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.uadd, %.loc8_19.1 // CHECK:STDOUT: return %.loc8_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -241,8 +257,10 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: --- fail_bad_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %TooFew.type: type = fn_type @TooFew [template] // CHECK:STDOUT: %TooFew: %TooFew.type = struct_value () [template] // CHECK:STDOUT: %TooMany.type: type = fn_type @TooMany [template] @@ -253,19 +271,22 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %BadReturnType: %BadReturnType.type = struct_value () [template] // CHECK:STDOUT: %JustRight.type: type = fn_type @JustRight [template] // CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.30: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 2 [template] -// CHECK:STDOUT: %.32: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 3 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.28: = bound_method %.26, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.31: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 3 [template] // CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] // CHECK:STDOUT: %RuntimeCallTooFew: %RuntimeCallTooFew.type = struct_value () [template] // CHECK:STDOUT: %RuntimeCallTooMany.type: type = fn_type @RuntimeCallTooMany [template] @@ -276,7 +297,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude @@ -301,277 +322,306 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc8_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %int.make_type_32.loc8_14 [template = i32] -// CHECK:STDOUT: %.loc8_14.2: type = converted %int.make_type_32.loc8_14, %.loc8_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc8_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_22.1: type = value_of_initializer %int.make_type_32.loc8_22 [template = i32] -// CHECK:STDOUT: %.loc8_22.2: type = converted %int.make_type_32.loc8_22, %.loc8_22.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc8_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8_14: init type = call constants.%Int(%.loc8_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_14.2: type = value_of_initializer %int.make_type_signed.loc8_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_14.3: type = converted %int.make_type_signed.loc8_14, %.loc8_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8_22: init type = call constants.%Int(%.loc8_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_22.2: type = value_of_initializer %int.make_type_signed.loc8_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_22.3: type = converted %int.make_type_signed.loc8_22, %.loc8_22.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %c.patt: i32 = binding_pattern c -// CHECK:STDOUT: %c.param_patt: i32 = value_param_pattern %c.patt, runtime_param2 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param3 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %c.patt: %i32 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %i32 = value_param_pattern %c.patt, runtime_param2 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc13_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %int.make_type_32.loc13_15 [template = i32] -// CHECK:STDOUT: %.loc13_15.2: type = converted %int.make_type_32.loc13_15, %.loc13_15.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_32.loc13_23 [template = i32] -// CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_32.loc13_23, %.loc13_23.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_31: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_32.loc13_31 [template = i32] -// CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_32.loc13_31, %.loc13_31.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_39: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_39.1: type = value_of_initializer %int.make_type_32.loc13_39 [template = i32] -// CHECK:STDOUT: %.loc13_39.2: type = converted %int.make_type_32.loc13_39, %.loc13_39.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %c.param: i32 = value_param runtime_param2 -// CHECK:STDOUT: %c: i32 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param3 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc13_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_15: init type = call constants.%Int(%.loc13_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_15.2: type = value_of_initializer %int.make_type_signed.loc13_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_15.3: type = converted %int.make_type_signed.loc13_15, %.loc13_15.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_23: init type = call constants.%Int(%.loc13_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_23.2: type = value_of_initializer %int.make_type_signed.loc13_23 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_23.3: type = converted %int.make_type_signed.loc13_23, %.loc13_23.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_31: init type = call constants.%Int(%.loc13_31.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.2: type = value_of_initializer %int.make_type_signed.loc13_31 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.3: type = converted %int.make_type_signed.loc13_31, %.loc13_31.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_39.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_39: init type = call constants.%Int(%.loc13_39.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_39.2: type = value_of_initializer %int.make_type_signed.loc13_39 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_39.3: type = converted %int.make_type_signed.loc13_39, %.loc13_39.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %c.param: %i32 = value_param runtime_param2 +// CHECK:STDOUT: %c: %i32 = bind_name c, %c.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc18_21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_32.loc18_21 [template = i32] -// CHECK:STDOUT: %.loc18_21.2: type = converted %int.make_type_32.loc18_21, %.loc18_21.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc18_29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %int.make_type_32.loc18_29 [template = i32] -// CHECK:STDOUT: %.loc18_29.2: type = converted %int.make_type_32.loc18_29, %.loc18_29.1 [template = i32] +// CHECK:STDOUT: %.loc18_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18_21: init type = call constants.%Int(%.loc18_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_21.2: type = value_of_initializer %int.make_type_signed.loc18_21 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_21.3: type = converted %int.make_type_signed.loc18_21, %.loc18_21.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_29.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18_29: init type = call constants.%Int(%.loc18_29.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_29.2: type = value_of_initializer %int.make_type_signed.loc18_29 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_29.3: type = converted %int.make_type_signed.loc18_29, %.loc18_29.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc19_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_32.loc19_17 [template = i32] -// CHECK:STDOUT: %.loc19_17.2: type = converted %int.make_type_32.loc19_17, %.loc19_17.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc19_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_25.1: type = value_of_initializer %int.make_type_32.loc19_25 [template = i32] -// CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_32.loc19_25, %.loc19_25.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc19_33: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_33.1: type = value_of_initializer %int.make_type_32.loc19_33 [template = i32] -// CHECK:STDOUT: %.loc19_33.2: type = converted %int.make_type_32.loc19_33, %.loc19_33.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc19_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19_17: init type = call constants.%Int(%.loc19_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_17.2: type = value_of_initializer %int.make_type_signed.loc19_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_17.3: type = converted %int.make_type_signed.loc19_17, %.loc19_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19_25: init type = call constants.%Int(%.loc19_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_25.2: type = value_of_initializer %int.make_type_signed.loc19_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_25.3: type = converted %int.make_type_signed.loc19_25, %.loc19_25.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_33.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19_33: init type = call constants.%Int(%.loc19_33.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_33.2: type = value_of_initializer %int.make_type_signed.loc19_33 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_33.3: type = converted %int.make_type_signed.loc19_33, %.loc19_33.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc25_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc25: init type = call constants.%Int(%.loc25_15.1) [template = constants.%i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %.loc25_27.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc25_27.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc25_27.3: = bound_method %.loc25_27.1, %.loc25_27.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc25: init i32 = call %.loc25_27.3(%.loc25_27.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc25_27.4: i32 = value_of_initializer %int.convert_checked.loc25 [template = constants.%.27] -// CHECK:STDOUT: %.loc25_27.5: i32 = converted %.loc25_27.1, %.loc25_27.4 [template = constants.%.27] -// CHECK:STDOUT: %TooFew.call: init i32 = call %TooFew.ref(%.loc25_27.5) -// CHECK:STDOUT: %.loc25_15.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] -// CHECK:STDOUT: %.loc25_15.2: type = converted %int.make_type_32.loc25, %.loc25_15.1 [template = i32] +// CHECK:STDOUT: %.loc25_27.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc25_27.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc25_27.3: = bound_method %.loc25_27.1, %.loc25_27.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc25_27.4: = specific_function %.loc25_27.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc25: init %i32 = call %.loc25_27.4(%.loc25_27.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc25_27.5: %i32 = value_of_initializer %int.convert_checked.loc25 [template = constants.%.25] +// CHECK:STDOUT: %.loc25_27.6: %i32 = converted %.loc25_27.1, %.loc25_27.5 [template = constants.%.25] +// CHECK:STDOUT: %TooFew.call: init %i32 = call %TooFew.ref(%.loc25_27.6) +// CHECK:STDOUT: %.loc25_15.2: type = value_of_initializer %int.make_type_signed.loc25 [template = constants.%i32] +// CHECK:STDOUT: %.loc25_15.3: type = converted %int.make_type_signed.loc25, %.loc25_15.2 [template = constants.%i32] // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var -// CHECK:STDOUT: %int.make_type_32.loc30: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc30_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc30: init type = call constants.%Int(%.loc30_16.1) [template = constants.%i32] // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, %TooMany.decl [template = constants.%TooMany] -// CHECK:STDOUT: %.loc30_29.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc30_32.1: Core.IntLiteral = int_value 2 [template = constants.%.28] -// CHECK:STDOUT: %.loc30_35.1: Core.IntLiteral = int_value 3 [template = constants.%.29] -// CHECK:STDOUT: %.loc30_29.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc30_29.3: = bound_method %.loc30_29.1, %.loc30_29.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc30_29: init i32 = call %.loc30_29.3(%.loc30_29.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc30_29.4: i32 = value_of_initializer %int.convert_checked.loc30_29 [template = constants.%.27] -// CHECK:STDOUT: %.loc30_29.5: i32 = converted %.loc30_29.1, %.loc30_29.4 [template = constants.%.27] -// CHECK:STDOUT: %.loc30_32.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc30_32.3: = bound_method %.loc30_32.1, %.loc30_32.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc30_32: init i32 = call %.loc30_32.3(%.loc30_32.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc30_32.4: i32 = value_of_initializer %int.convert_checked.loc30_32 [template = constants.%.31] -// CHECK:STDOUT: %.loc30_32.5: i32 = converted %.loc30_32.1, %.loc30_32.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc30_35.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc30_35.3: = bound_method %.loc30_35.1, %.loc30_35.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc30_35: init i32 = call %.loc30_35.3(%.loc30_35.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc30_35.4: i32 = value_of_initializer %int.convert_checked.loc30_35 [template = constants.%.33] -// CHECK:STDOUT: %.loc30_35.5: i32 = converted %.loc30_35.1, %.loc30_35.4 [template = constants.%.33] -// CHECK:STDOUT: %TooMany.call: init i32 = call %TooMany.ref(%.loc30_29.5, %.loc30_32.5, %.loc30_35.5) -// CHECK:STDOUT: %.loc30_16.1: type = value_of_initializer %int.make_type_32.loc30 [template = i32] -// CHECK:STDOUT: %.loc30_16.2: type = converted %int.make_type_32.loc30, %.loc30_16.1 [template = i32] +// CHECK:STDOUT: %.loc30_29.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc30_32.1: Core.IntLiteral = int_value 2 [template = constants.%.26] +// CHECK:STDOUT: %.loc30_35.1: Core.IntLiteral = int_value 3 [template = constants.%.27] +// CHECK:STDOUT: %.loc30_29.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc30_29.3: = bound_method %.loc30_29.1, %.loc30_29.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc30_29.4: = specific_function %.loc30_29.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc30_29: init %i32 = call %.loc30_29.4(%.loc30_29.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc30_29.5: %i32 = value_of_initializer %int.convert_checked.loc30_29 [template = constants.%.25] +// CHECK:STDOUT: %.loc30_29.6: %i32 = converted %.loc30_29.1, %.loc30_29.5 [template = constants.%.25] +// CHECK:STDOUT: %.loc30_32.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc30_32.3: = bound_method %.loc30_32.1, %.loc30_32.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc30_32.4: = specific_function %.loc30_32.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc30_32: init %i32 = call %.loc30_32.4(%.loc30_32.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc30_32.5: %i32 = value_of_initializer %int.convert_checked.loc30_32 [template = constants.%.30] +// CHECK:STDOUT: %.loc30_32.6: %i32 = converted %.loc30_32.1, %.loc30_32.5 [template = constants.%.30] +// CHECK:STDOUT: %.loc30_35.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc30_35.3: = bound_method %.loc30_35.1, %.loc30_35.2 [template = constants.%.31] +// CHECK:STDOUT: %.loc30_35.4: = specific_function %.loc30_35.3, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc30_35: init %i32 = call %.loc30_35.4(%.loc30_35.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc30_35.5: %i32 = value_of_initializer %int.convert_checked.loc30_35 [template = constants.%.33] +// CHECK:STDOUT: %.loc30_35.6: %i32 = converted %.loc30_35.1, %.loc30_35.5 [template = constants.%.33] +// CHECK:STDOUT: %TooMany.call: init %i32 = call %TooMany.ref(%.loc30_29.6, %.loc30_32.6, %.loc30_35.6) +// CHECK:STDOUT: %.loc30_16.2: type = value_of_initializer %int.make_type_signed.loc30 [template = constants.%i32] +// CHECK:STDOUT: %.loc30_16.3: type = converted %int.make_type_signed.loc30, %.loc30_16.2 [template = constants.%i32] // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var -// CHECK:STDOUT: %int.make_type_32.loc35: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc35_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc35: init type = call constants.%Int(%.loc35_23.1) [template = constants.%i32] // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %.loc35_42.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc35_45.1: Core.IntLiteral = int_value 2 [template = constants.%.28] -// CHECK:STDOUT: %.loc35_42.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc35_42.3: = bound_method %.loc35_42.1, %.loc35_42.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc35_42: init i32 = call %.loc35_42.3(%.loc35_42.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc35_42.4: i32 = value_of_initializer %int.convert_checked.loc35_42 [template = constants.%.27] -// CHECK:STDOUT: %.loc35_42.5: i32 = converted %.loc35_42.1, %.loc35_42.4 [template = constants.%.27] -// CHECK:STDOUT: %.loc35_45.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc35_45.3: = bound_method %.loc35_45.1, %.loc35_45.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc35_45: init i32 = call %.loc35_45.3(%.loc35_45.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc35_45.4: i32 = value_of_initializer %int.convert_checked.loc35_45 [template = constants.%.31] -// CHECK:STDOUT: %.loc35_45.5: i32 = converted %.loc35_45.1, %.loc35_45.4 [template = constants.%.31] -// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42.5, %.loc35_45.5) -// CHECK:STDOUT: %.loc35_23.1: type = value_of_initializer %int.make_type_32.loc35 [template = i32] -// CHECK:STDOUT: %.loc35_23.2: type = converted %int.make_type_32.loc35, %.loc35_23.1 [template = i32] +// CHECK:STDOUT: %.loc35_42.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc35_45.1: Core.IntLiteral = int_value 2 [template = constants.%.26] +// CHECK:STDOUT: %.loc35_42.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc35_42.3: = bound_method %.loc35_42.1, %.loc35_42.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc35_42.4: = specific_function %.loc35_42.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc35_42: init %i32 = call %.loc35_42.4(%.loc35_42.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc35_42.5: %i32 = value_of_initializer %int.convert_checked.loc35_42 [template = constants.%.25] +// CHECK:STDOUT: %.loc35_42.6: %i32 = converted %.loc35_42.1, %.loc35_42.5 [template = constants.%.25] +// CHECK:STDOUT: %.loc35_45.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc35_45.3: = bound_method %.loc35_45.1, %.loc35_45.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc35_45.4: = specific_function %.loc35_45.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc35_45: init %i32 = call %.loc35_45.4(%.loc35_45.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc35_45.5: %i32 = value_of_initializer %int.convert_checked.loc35_45 [template = constants.%.30] +// CHECK:STDOUT: %.loc35_45.6: %i32 = converted %.loc35_45.1, %.loc35_45.5 [template = constants.%.30] +// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42.6, %.loc35_45.6) +// CHECK:STDOUT: %.loc35_23.2: type = value_of_initializer %int.make_type_signed.loc35 [template = constants.%i32] +// CHECK:STDOUT: %.loc35_23.3: type = converted %int.make_type_signed.loc35, %.loc35_23.2 [template = constants.%i32] // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var -// CHECK:STDOUT: %int.make_type_32.loc43: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc43_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc43: init type = call constants.%Int(%.loc43_16.1) [template = constants.%i32] // CHECK:STDOUT: %JustRight.ref: %JustRight.type = name_ref JustRight, %JustRight.decl [template = constants.%JustRight] -// CHECK:STDOUT: %.loc43_31: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc43_34: Core.IntLiteral = int_value 2 [template = constants.%.28] -// CHECK:STDOUT: %.loc43_37: Core.IntLiteral = int_value 3 [template = constants.%.29] -// CHECK:STDOUT: %.loc43_16.1: type = value_of_initializer %int.make_type_32.loc43 [template = i32] -// CHECK:STDOUT: %.loc43_16.2: type = converted %int.make_type_32.loc43, %.loc43_16.1 [template = i32] -// CHECK:STDOUT: %.loc43_39: type = array_type , i32 [template = ] +// CHECK:STDOUT: %.loc43_31: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc43_34: Core.IntLiteral = int_value 2 [template = constants.%.26] +// CHECK:STDOUT: %.loc43_37: Core.IntLiteral = int_value 3 [template = constants.%.27] +// CHECK:STDOUT: %.loc43_16.2: type = value_of_initializer %int.make_type_signed.loc43 [template = constants.%i32] +// CHECK:STDOUT: %.loc43_16.3: type = converted %int.make_type_signed.loc43, %.loc43_16.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc43_39: type = array_type , %i32 [template = ] // CHECK:STDOUT: %bad_call.var: ref = var bad_call // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc45_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc45_25.1: type = value_of_initializer %int.make_type_32.loc45_25 [template = i32] -// CHECK:STDOUT: %.loc45_25.2: type = converted %int.make_type_32.loc45_25, %.loc45_25.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc45_33: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc45_33.1: type = value_of_initializer %int.make_type_32.loc45_33 [template = i32] -// CHECK:STDOUT: %.loc45_33.2: type = converted %int.make_type_32.loc45_33, %.loc45_33.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc45_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc45_25: init type = call constants.%Int(%.loc45_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc45_25.2: type = value_of_initializer %int.make_type_signed.loc45_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc45_25.3: type = converted %int.make_type_signed.loc45_25, %.loc45_25.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc45_33.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc45_33: init type = call constants.%Int(%.loc45_33.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc45_33.2: type = value_of_initializer %int.make_type_signed.loc45_33 [template = constants.%i32] +// CHECK:STDOUT: %.loc45_33.3: type = converted %int.make_type_signed.loc45_33, %.loc45_33.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %c.patt: i32 = binding_pattern c -// CHECK:STDOUT: %c.param_patt: i32 = value_param_pattern %c.patt, runtime_param2 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param3 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %c.patt: %i32 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %i32 = value_param_pattern %c.patt, runtime_param2 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc49_26: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc49_26.1: type = value_of_initializer %int.make_type_32.loc49_26 [template = i32] -// CHECK:STDOUT: %.loc49_26.2: type = converted %int.make_type_32.loc49_26, %.loc49_26.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc49_34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc49_34.1: type = value_of_initializer %int.make_type_32.loc49_34 [template = i32] -// CHECK:STDOUT: %.loc49_34.2: type = converted %int.make_type_32.loc49_34, %.loc49_34.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc49_42: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc49_42.1: type = value_of_initializer %int.make_type_32.loc49_42 [template = i32] -// CHECK:STDOUT: %.loc49_42.2: type = converted %int.make_type_32.loc49_42, %.loc49_42.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc49_50: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc49_50.1: type = value_of_initializer %int.make_type_32.loc49_50 [template = i32] -// CHECK:STDOUT: %.loc49_50.2: type = converted %int.make_type_32.loc49_50, %.loc49_50.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %c.param: i32 = value_param runtime_param2 -// CHECK:STDOUT: %c: i32 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param3 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc49_26.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc49_26: init type = call constants.%Int(%.loc49_26.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc49_26.2: type = value_of_initializer %int.make_type_signed.loc49_26 [template = constants.%i32] +// CHECK:STDOUT: %.loc49_26.3: type = converted %int.make_type_signed.loc49_26, %.loc49_26.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc49_34.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc49_34: init type = call constants.%Int(%.loc49_34.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc49_34.2: type = value_of_initializer %int.make_type_signed.loc49_34 [template = constants.%i32] +// CHECK:STDOUT: %.loc49_34.3: type = converted %int.make_type_signed.loc49_34, %.loc49_34.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc49_42.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc49_42: init type = call constants.%Int(%.loc49_42.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc49_42.2: type = value_of_initializer %int.make_type_signed.loc49_42 [template = constants.%i32] +// CHECK:STDOUT: %.loc49_42.3: type = converted %int.make_type_signed.loc49_42, %.loc49_42.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc49_50.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc49_50: init type = call constants.%Int(%.loc49_50.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc49_50.2: type = value_of_initializer %int.make_type_signed.loc49_50 [template = constants.%i32] +// CHECK:STDOUT: %.loc49_50.3: type = converted %int.make_type_signed.loc49_50, %.loc49_50.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %c.param: %i32 = value_param runtime_param2 +// CHECK:STDOUT: %c: %i32 = bind_name c, %c.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc53_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc53_32.1: type = value_of_initializer %int.make_type_32.loc53_32 [template = i32] -// CHECK:STDOUT: %.loc53_32.2: type = converted %int.make_type_32.loc53_32, %.loc53_32.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc53_40: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc53_40.1: type = value_of_initializer %int.make_type_32.loc53_40 [template = i32] -// CHECK:STDOUT: %.loc53_40.2: type = converted %int.make_type_32.loc53_40, %.loc53_40.1 [template = i32] +// CHECK:STDOUT: %.loc53_32.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc53_32: init type = call constants.%Int(%.loc53_32.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc53_32.2: type = value_of_initializer %int.make_type_signed.loc53_32 [template = constants.%i32] +// CHECK:STDOUT: %.loc53_32.3: type = converted %int.make_type_signed.loc53_32, %.loc53_32.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc53_40.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc53_40: init type = call constants.%Int(%.loc53_40.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc53_40.2: type = value_of_initializer %int.make_type_signed.loc53_40 [template = constants.%i32] +// CHECK:STDOUT: %.loc53_40.3: type = converted %int.make_type_signed.loc53_40, %.loc53_40.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc53_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc53_48.2: type = converted %bool.make_type, %.loc53_48.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooFew(%a.param_patt: i32) -> i32; +// CHECK:STDOUT: fn @TooFew(%a.param_patt: %i32) -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooMany(%a.param_patt: i32, %b.param_patt: i32, %c.param_patt: i32) -> i32; +// CHECK:STDOUT: fn @TooMany(%a.param_patt: %i32, %b.param_patt: %i32, %c.param_patt: %i32) -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: i32, %b.param_patt: i32) -> bool; +// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: %i32, %b.param_patt: %i32) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @JustRight(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.uadd"; +// CHECK:STDOUT: fn @JustRight(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.uadd"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %TooFew.call: init i32 = call %TooFew.ref(%a.ref) -// CHECK:STDOUT: %.loc46_19.1: i32 = value_of_initializer %TooFew.call -// CHECK:STDOUT: %.loc46_19.2: i32 = converted %TooFew.call, %.loc46_19.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %TooFew.call: init %i32 = call %TooFew.ref(%a.ref) +// CHECK:STDOUT: %.loc46_19.1: %i32 = value_of_initializer %TooFew.call +// CHECK:STDOUT: %.loc46_19.2: %i32 = converted %TooFew.call, %.loc46_19.1 // CHECK:STDOUT: return %.loc46_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: i32, %b.param_patt: i32, %c.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: %i32, %b.param_patt: %i32, %c.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %c.ref: i32 = name_ref c, %c -// CHECK:STDOUT: %TooMany.call: init i32 = call %TooMany.ref(%a.ref, %b.ref, %c.ref) -// CHECK:STDOUT: %.loc50_26.1: i32 = value_of_initializer %TooMany.call -// CHECK:STDOUT: %.loc50_26.2: i32 = converted %TooMany.call, %.loc50_26.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %c.ref: %i32 = name_ref c, %c +// CHECK:STDOUT: %TooMany.call: init %i32 = call %TooMany.ref(%a.ref, %b.ref, %c.ref) +// CHECK:STDOUT: %.loc50_26.1: %i32 = value_of_initializer %TooMany.call +// CHECK:STDOUT: %.loc50_26.2: %i32 = converted %TooMany.call, %.loc50_26.1 // CHECK:STDOUT: return %.loc50_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: i32, %b.param_patt: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%a.ref, %b.ref) // CHECK:STDOUT: %.loc54_29.1: bool = value_of_initializer %BadReturnType.call // CHECK:STDOUT: %.loc54_29.2: bool = converted %BadReturnType.call, %.loc54_29.1 @@ -581,29 +631,34 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: --- overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Add.type: type = fn_type @Add [template] // CHECK:STDOUT: %Add: %Add.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 0 [template] -// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.32: = bound_method %.31, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 1 [template] -// CHECK:STDOUT: %.34: i32 = int_value -2147483648 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.31: = bound_method %.30, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.34: %i32 = int_value -2147483648 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -619,75 +674,84 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4_11, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%.loc4_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.3: type = converted %int.make_type_signed.loc4_19, %.loc4_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed.loc4_27, %.loc4_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] -// CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_32.loc8, %.loc8_8.1 [template = i32] +// CHECK:STDOUT: %.loc7_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%.loc7_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.2: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.3: type = converted %int.make_type_signed.loc7, %.loc7_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8.3: type = converted %int.make_type_signed.loc8, %.loc8_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.uadd"; +// CHECK:STDOUT: fn @Add(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.uadd"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Add.ref.loc7: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] -// CHECK:STDOUT: %.loc7_18.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc7_30.1: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc7_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_18.3: = bound_method %.loc7_18.1, %.loc7_18.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc7_18: init i32 = call %.loc7_18.3(%.loc7_18.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc7_18.4: i32 = value_of_initializer %int.convert_checked.loc7_18 [template = constants.%.28] -// CHECK:STDOUT: %.loc7_18.5: i32 = converted %.loc7_18.1, %.loc7_18.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc7_30.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_30.3: = bound_method %.loc7_30.1, %.loc7_30.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc7_30: init i32 = call %.loc7_30.3(%.loc7_30.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc7_30.4: i32 = value_of_initializer %int.convert_checked.loc7_30 [template = constants.%.30] -// CHECK:STDOUT: %.loc7_30.5: i32 = converted %.loc7_30.1, %.loc7_30.4 [template = constants.%.30] -// CHECK:STDOUT: %int.uadd.loc7: init i32 = call %Add.ref.loc7(%.loc7_18.5, %.loc7_30.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc7_32.1: i32 = value_of_initializer %int.uadd.loc7 [template = constants.%.28] -// CHECK:STDOUT: %.loc7_32.2: i32 = converted %int.uadd.loc7, %.loc7_32.1 [template = constants.%.28] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc7_32.2 +// CHECK:STDOUT: %.loc7_18.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc7_30.1: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc7_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_18.3: = bound_method %.loc7_18.1, %.loc7_18.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc7_18.4: = specific_function %.loc7_18.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc7_18: init %i32 = call %.loc7_18.4(%.loc7_18.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc7_18.5: %i32 = value_of_initializer %int.convert_checked.loc7_18 [template = constants.%.26] +// CHECK:STDOUT: %.loc7_18.6: %i32 = converted %.loc7_18.1, %.loc7_18.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc7_30.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_30.3: = bound_method %.loc7_30.1, %.loc7_30.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc7_30.4: = specific_function %.loc7_30.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc7_30: init %i32 = call %.loc7_30.4(%.loc7_30.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc7_30.5: %i32 = value_of_initializer %int.convert_checked.loc7_30 [template = constants.%.29] +// CHECK:STDOUT: %.loc7_30.6: %i32 = converted %.loc7_30.1, %.loc7_30.5 [template = constants.%.29] +// CHECK:STDOUT: %int.uadd.loc7: init %i32 = call %Add.ref.loc7(%.loc7_18.6, %.loc7_30.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc7_32.1: %i32 = value_of_initializer %int.uadd.loc7 [template = constants.%.26] +// CHECK:STDOUT: %.loc7_32.2: %i32 = converted %int.uadd.loc7, %.loc7_32.1 [template = constants.%.26] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc7_32.2 // CHECK:STDOUT: %Add.ref.loc8: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] -// CHECK:STDOUT: %.loc8_18.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc8_30.1: Core.IntLiteral = int_value 1 [template = constants.%.31] -// CHECK:STDOUT: %.loc8_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_18.3: = bound_method %.loc8_18.1, %.loc8_18.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc8_18: init i32 = call %.loc8_18.3(%.loc8_18.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc8_18.4: i32 = value_of_initializer %int.convert_checked.loc8_18 [template = constants.%.28] -// CHECK:STDOUT: %.loc8_18.5: i32 = converted %.loc8_18.1, %.loc8_18.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc8_30.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_30.3: = bound_method %.loc8_30.1, %.loc8_30.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc8_30: init i32 = call %.loc8_30.3(%.loc8_30.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc8_30.4: i32 = value_of_initializer %int.convert_checked.loc8_30 [template = constants.%.33] -// CHECK:STDOUT: %.loc8_30.5: i32 = converted %.loc8_30.1, %.loc8_30.4 [template = constants.%.33] -// CHECK:STDOUT: %int.uadd.loc8: init i32 = call %Add.ref.loc8(%.loc8_18.5, %.loc8_30.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc8_32.1: i32 = value_of_initializer %int.uadd.loc8 [template = constants.%.34] -// CHECK:STDOUT: %.loc8_32.2: i32 = converted %int.uadd.loc8, %.loc8_32.1 [template = constants.%.34] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc8_32.2 +// CHECK:STDOUT: %.loc8_18.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc8_30.1: Core.IntLiteral = int_value 1 [template = constants.%.30] +// CHECK:STDOUT: %.loc8_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_18.3: = bound_method %.loc8_18.1, %.loc8_18.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc8_18.4: = specific_function %.loc8_18.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc8_18: init %i32 = call %.loc8_18.4(%.loc8_18.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc8_18.5: %i32 = value_of_initializer %int.convert_checked.loc8_18 [template = constants.%.26] +// CHECK:STDOUT: %.loc8_18.6: %i32 = converted %.loc8_18.1, %.loc8_18.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc8_30.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_30.3: = bound_method %.loc8_30.1, %.loc8_30.2 [template = constants.%.31] +// CHECK:STDOUT: %.loc8_30.4: = specific_function %.loc8_30.3, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc8_30: init %i32 = call %.loc8_30.4(%.loc8_30.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc8_30.5: %i32 = value_of_initializer %int.convert_checked.loc8_30 [template = constants.%.33] +// CHECK:STDOUT: %.loc8_30.6: %i32 = converted %.loc8_30.1, %.loc8_30.5 [template = constants.%.33] +// CHECK:STDOUT: %int.uadd.loc8: init %i32 = call %Add.ref.loc8(%.loc8_18.6, %.loc8_30.6) [template = constants.%.34] +// CHECK:STDOUT: %.loc8_32.1: %i32 = value_of_initializer %int.uadd.loc8 [template = constants.%.34] +// CHECK:STDOUT: %.loc8_32.2: %i32 = converted %int.uadd.loc8, %.loc8_32.1 [template = constants.%.34] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc8_32.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/udiv.carbon b/toolchain/check/testdata/builtins/int/udiv.carbon index 8798be0abb9f..4941b2e20be3 100644 --- a/toolchain/check/testdata/builtins/int/udiv.carbon +++ b/toolchain/check/testdata/builtins/int/udiv.carbon @@ -56,28 +56,33 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: --- int_div.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Div.type: type = fn_type @Div [template] // CHECK:STDOUT: %Div: %Div.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 3 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 3 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.16 [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.15 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.4(%.1) [template] // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.35: type = array_type %.34, i32 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, %i32 [template] // CHECK:STDOUT: %.36: type = ptr_type %.35 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] @@ -85,7 +90,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -102,98 +107,109 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%.loc2_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.3: type = converted %int.make_type_signed.loc2_11, %.loc2_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%.loc2_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.3: type = converted %int.make_type_signed.loc2_19, %.loc2_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%.loc2_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.2: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.3: type = converted %int.make_type_signed.loc2_27, %.loc2_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, %Div.decl [template = constants.%Div] -// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init i32 = call %.loc4_20.3(%.loc4_20.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.4: i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.5: i32 = converted %.loc4_20.1, %.loc4_20.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init i32 = call %.loc4_23.3(%.loc4_23.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.4: i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.5: i32 = converted %.loc4_23.1, %.loc4_23.4 [template = constants.%.30] -// CHECK:STDOUT: %int.udiv: init i32 = call %Div.ref(%.loc4_20.5, %.loc4_23.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_19.1: %Convert.type.5 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.udiv, %.loc4_19.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.udiv [template = constants.%.31] -// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.udiv, %.loc4_19.3 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.udiv, %.loc4_19.5 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_20.4: = specific_function %.loc4_20.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %.loc4_20.4(%.loc4_20.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.5: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.6: %i32 = converted %.loc4_20.1, %.loc4_20.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_23.4: = specific_function %.loc4_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %.loc4_23.4(%.loc4_23.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.5: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.6: %i32 = converted %.loc4_23.1, %.loc4_23.5 [template = constants.%.29] +// CHECK:STDOUT: %int.udiv: init %i32 = call %Div.ref(%.loc4_20.6, %.loc4_23.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.6 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.udiv, %.loc4_19.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc4_19.3: = specific_function %.loc4_19.2, @Convert.4(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc4_19.4: %i32 = value_of_initializer %int.udiv [template = constants.%.30] +// CHECK:STDOUT: %.loc4_19.5: %i32 = converted %int.udiv, %.loc4_19.4 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.3(%.loc4_19.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.7: Core.IntLiteral = converted %int.udiv, %.loc4_19.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.7, %i32 [template = constants.%.35] // CHECK:STDOUT: %arr.var: ref %.35 = var arr // CHECK:STDOUT: %arr: ref %.35 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_13.1) [template = constants.%i32] // CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 1 [template = constants.%.34] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_13.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_13.3: type = converted %int.make_type_signed.loc5, %.loc5_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, %i32 [template = constants.%.35] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.35 [template = constants.%.36] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.3: type = converted %int.make_type_signed.loc7_19, %.loc7_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%.loc7_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.3: type = converted %int.make_type_signed.loc7_27, %.loc7_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%.loc7_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.3: type = converted %int.make_type_signed.loc7_35, %.loc7_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.udiv"; +// CHECK:STDOUT: fn @Div(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.udiv"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %int.udiv: init i32 = call %Div.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: i32 = value_of_initializer %int.udiv -// CHECK:STDOUT: %.loc8_19.2: i32 = converted %int.udiv, %.loc8_19.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %int.udiv: init %i32 = call %Div.ref(%a.ref, %b.ref) +// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.udiv +// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.udiv, %.loc8_19.1 // CHECK:STDOUT: return %.loc8_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -208,33 +224,37 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: --- overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Div.type: type = fn_type @Div [template] // CHECK:STDOUT: %Div: %Div.type = struct_value () [template] // CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] // CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %.28: i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: i32 = int_value -1 [template] -// CHECK:STDOUT: %.33: i32 = int_value 0 [template] -// CHECK:STDOUT: %.34: i32 = int_value -2147483648 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.26: %i32 = int_value -2147483647 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: %i32 = int_value -1 [template] +// CHECK:STDOUT: %.32: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.33: %i32 = int_value -2147483648 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -253,205 +273,228 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4_11, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%.loc4_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.3: type = converted %int.make_type_signed.loc4_19, %.loc4_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed.loc4_27, %.loc4_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] -// CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_32.loc5_11, %.loc5_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_32.loc5_19 [template = i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_32.loc5_19, %.loc5_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_32.loc5_27 [template = i32] -// CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc5_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_11: init type = call constants.%Int(%.loc5_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_11.2: type = value_of_initializer %int.make_type_signed.loc5_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_11.3: type = converted %int.make_type_signed.loc5_11, %.loc5_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_19: init type = call constants.%Int(%.loc5_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.2: type = value_of_initializer %int.make_type_signed.loc5_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.3: type = converted %int.make_type_signed.loc5_19, %.loc5_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_27: init type = call constants.%Int(%.loc5_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.2: type = value_of_initializer %int.make_type_signed.loc5_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.3: type = converted %int.make_type_signed.loc5_27, %.loc5_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] -// CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_32.loc6_14, %.loc6_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc6_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_32.loc6_22 [template = i32] -// CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc6_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_14: init type = call constants.%Int(%.loc6_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_signed.loc6_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_signed.loc6_14, %.loc6_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_22: init type = call constants.%Int(%.loc6_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.2: type = value_of_initializer %int.make_type_signed.loc6_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.3: type = converted %int.make_type_signed.loc6_22, %.loc6_22.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] -// CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_32.loc9, %.loc9_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] +// CHECK:STDOUT: %.loc9_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%.loc9_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_8.2: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_8.3: type = converted %int.make_type_signed.loc9, %.loc9_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.3: type = converted %int.make_type_signed.loc12, %.loc12_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed.loc15, %.loc15_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.udiv"; +// CHECK:STDOUT: fn @Div(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.udiv"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.usub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.unegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.unegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Div.ref.loc9: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc9_25.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc9_25.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_25.3: = bound_method %.loc9_25.1, %.loc9_25.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc9_25: init i32 = call %.loc9_25.3(%.loc9_25.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc9_25.4: i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%.27] -// CHECK:STDOUT: %.loc9_25.5: i32 = converted %.loc9_25.1, %.loc9_25.4 [template = constants.%.27] -// CHECK:STDOUT: %int.unegate.loc9_24: init i32 = call %Negate.ref.loc9_18(%.loc9_25.5) [template = constants.%.28] +// CHECK:STDOUT: %.loc9_25.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc9_25.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_25.3: = bound_method %.loc9_25.1, %.loc9_25.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc9_25.4: = specific_function %.loc9_25.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %.loc9_25.4(%.loc9_25.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc9_25.5: %i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%.25] +// CHECK:STDOUT: %.loc9_25.6: %i32 = converted %.loc9_25.1, %.loc9_25.5 [template = constants.%.25] +// CHECK:STDOUT: %int.unegate.loc9_24: init %i32 = call %Negate.ref.loc9_18(%.loc9_25.6) [template = constants.%.26] // CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc9_46.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc9_46.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_46.3: = bound_method %.loc9_46.1, %.loc9_46.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc9_46: init i32 = call %.loc9_46.3(%.loc9_46.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc9_46.4: i32 = value_of_initializer %int.convert_checked.loc9_46 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_46.5: i32 = converted %.loc9_46.1, %.loc9_46.4 [template = constants.%.31] -// CHECK:STDOUT: %int.unegate.loc9_45: init i32 = call %Negate.ref.loc9_39(%.loc9_46.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc9_24.1: i32 = value_of_initializer %int.unegate.loc9_24 [template = constants.%.28] -// CHECK:STDOUT: %.loc9_24.2: i32 = converted %int.unegate.loc9_24, %.loc9_24.1 [template = constants.%.28] -// CHECK:STDOUT: %.loc9_45.1: i32 = value_of_initializer %int.unegate.loc9_45 [template = constants.%.32] -// CHECK:STDOUT: %.loc9_45.2: i32 = converted %int.unegate.loc9_45, %.loc9_45.1 [template = constants.%.32] -// CHECK:STDOUT: %int.udiv.loc9: init i32 = call %Div.ref.loc9(%.loc9_24.2, %.loc9_45.2) [template = constants.%.33] -// CHECK:STDOUT: %.loc9_49.1: i32 = value_of_initializer %int.udiv.loc9 [template = constants.%.33] -// CHECK:STDOUT: %.loc9_49.2: i32 = converted %int.udiv.loc9, %.loc9_49.1 [template = constants.%.33] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc9_49.2 +// CHECK:STDOUT: %.loc9_46.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_46.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_46.3: = bound_method %.loc9_46.1, %.loc9_46.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc9_46.4: = specific_function %.loc9_46.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc9_46: init %i32 = call %.loc9_46.4(%.loc9_46.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc9_46.5: %i32 = value_of_initializer %int.convert_checked.loc9_46 [template = constants.%.30] +// CHECK:STDOUT: %.loc9_46.6: %i32 = converted %.loc9_46.1, %.loc9_46.5 [template = constants.%.30] +// CHECK:STDOUT: %int.unegate.loc9_45: init %i32 = call %Negate.ref.loc9_39(%.loc9_46.6) [template = constants.%.31] +// CHECK:STDOUT: %.loc9_24.1: %i32 = value_of_initializer %int.unegate.loc9_24 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_24.2: %i32 = converted %int.unegate.loc9_24, %.loc9_24.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_45.1: %i32 = value_of_initializer %int.unegate.loc9_45 [template = constants.%.31] +// CHECK:STDOUT: %.loc9_45.2: %i32 = converted %int.unegate.loc9_45, %.loc9_45.1 [template = constants.%.31] +// CHECK:STDOUT: %int.udiv.loc9: init %i32 = call %Div.ref.loc9(%.loc9_24.2, %.loc9_45.2) [template = constants.%.32] +// CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.udiv.loc9 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int.udiv.loc9, %.loc9_49.1 [template = constants.%.32] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc9_49.2 // CHECK:STDOUT: %Div.ref.loc12: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %Sub.ref.loc12: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_29.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_29.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_29.3: = bound_method %.loc12_29.1, %.loc12_29.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc12_29: init i32 = call %.loc12_29.3(%.loc12_29.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_29.4: i32 = value_of_initializer %int.convert_checked.loc12_29 [template = constants.%.27] -// CHECK:STDOUT: %.loc12_29.5: i32 = converted %.loc12_29.1, %.loc12_29.4 [template = constants.%.27] -// CHECK:STDOUT: %int.unegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_29.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc12_43.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc12_28.1: i32 = value_of_initializer %int.unegate.loc12 [template = constants.%.28] -// CHECK:STDOUT: %.loc12_28.2: i32 = converted %int.unegate.loc12, %.loc12_28.1 [template = constants.%.28] -// CHECK:STDOUT: %.loc12_43.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_43.3: = bound_method %.loc12_43.1, %.loc12_43.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc12_43: init i32 = call %.loc12_43.3(%.loc12_43.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc12_43.4: i32 = value_of_initializer %int.convert_checked.loc12_43 [template = constants.%.31] -// CHECK:STDOUT: %.loc12_43.5: i32 = converted %.loc12_43.1, %.loc12_43.4 [template = constants.%.31] -// CHECK:STDOUT: %int.usub.loc12: init i32 = call %Sub.ref.loc12(%.loc12_28.2, %.loc12_43.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc12_47.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc12_21.1: i32 = value_of_initializer %int.usub.loc12 [template = constants.%.34] -// CHECK:STDOUT: %.loc12_21.2: i32 = converted %int.usub.loc12, %.loc12_21.1 [template = constants.%.34] -// CHECK:STDOUT: %.loc12_47.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_47.3: = bound_method %.loc12_47.1, %.loc12_47.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc12_47: init i32 = call %.loc12_47.3(%.loc12_47.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc12_47.4: i32 = value_of_initializer %int.convert_checked.loc12_47 [template = constants.%.31] -// CHECK:STDOUT: %.loc12_47.5: i32 = converted %.loc12_47.1, %.loc12_47.4 [template = constants.%.31] -// CHECK:STDOUT: %int.udiv.loc12: init i32 = call %Div.ref.loc12(%.loc12_21.2, %.loc12_47.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc12_49.1: i32 = value_of_initializer %int.udiv.loc12 [template = constants.%.34] -// CHECK:STDOUT: %.loc12_49.2: i32 = converted %int.udiv.loc12, %.loc12_49.1 [template = constants.%.34] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc12_49.2 +// CHECK:STDOUT: %.loc12_29.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_29.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_29.3: = bound_method %.loc12_29.1, %.loc12_29.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_29.4: = specific_function %.loc12_29.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %.loc12_29.4(%.loc12_29.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_29.5: %i32 = value_of_initializer %int.convert_checked.loc12_29 [template = constants.%.25] +// CHECK:STDOUT: %.loc12_29.6: %i32 = converted %.loc12_29.1, %.loc12_29.5 [template = constants.%.25] +// CHECK:STDOUT: %int.unegate.loc12: init %i32 = call %Negate.ref.loc12(%.loc12_29.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc12_43.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_28.1: %i32 = value_of_initializer %int.unegate.loc12 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_28.2: %i32 = converted %int.unegate.loc12, %.loc12_28.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_43.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_43.3: = bound_method %.loc12_43.1, %.loc12_43.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc12_43.4: = specific_function %.loc12_43.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %.loc12_43.4(%.loc12_43.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc12_43.5: %i32 = value_of_initializer %int.convert_checked.loc12_43 [template = constants.%.30] +// CHECK:STDOUT: %.loc12_43.6: %i32 = converted %.loc12_43.1, %.loc12_43.5 [template = constants.%.30] +// CHECK:STDOUT: %int.usub.loc12: init %i32 = call %Sub.ref.loc12(%.loc12_28.2, %.loc12_43.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc12_47.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_21.1: %i32 = value_of_initializer %int.usub.loc12 [template = constants.%.33] +// CHECK:STDOUT: %.loc12_21.2: %i32 = converted %int.usub.loc12, %.loc12_21.1 [template = constants.%.33] +// CHECK:STDOUT: %.loc12_47.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_47.3: = bound_method %.loc12_47.1, %.loc12_47.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc12_47.4: = specific_function %.loc12_47.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc12_47: init %i32 = call %.loc12_47.4(%.loc12_47.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc12_47.5: %i32 = value_of_initializer %int.convert_checked.loc12_47 [template = constants.%.30] +// CHECK:STDOUT: %.loc12_47.6: %i32 = converted %.loc12_47.1, %.loc12_47.5 [template = constants.%.30] +// CHECK:STDOUT: %int.udiv.loc12: init %i32 = call %Div.ref.loc12(%.loc12_21.2, %.loc12_47.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc12_49.1: %i32 = value_of_initializer %int.udiv.loc12 [template = constants.%.33] +// CHECK:STDOUT: %.loc12_49.2: %i32 = converted %int.udiv.loc12, %.loc12_49.1 [template = constants.%.33] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc12_49.2 // CHECK:STDOUT: %Div.ref.loc15: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %Sub.ref.loc15: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc15_22: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc15_29.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc15_29.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_29.3: = bound_method %.loc15_29.1, %.loc15_29.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc15_29: init i32 = call %.loc15_29.3(%.loc15_29.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc15_29.4: i32 = value_of_initializer %int.convert_checked.loc15_29 [template = constants.%.27] -// CHECK:STDOUT: %.loc15_29.5: i32 = converted %.loc15_29.1, %.loc15_29.4 [template = constants.%.27] -// CHECK:STDOUT: %int.unegate.loc15_28: init i32 = call %Negate.ref.loc15_22(%.loc15_29.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc15_43.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc15_28.1: i32 = value_of_initializer %int.unegate.loc15_28 [template = constants.%.28] -// CHECK:STDOUT: %.loc15_28.2: i32 = converted %int.unegate.loc15_28, %.loc15_28.1 [template = constants.%.28] -// CHECK:STDOUT: %.loc15_43.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_43.3: = bound_method %.loc15_43.1, %.loc15_43.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc15_43: init i32 = call %.loc15_43.3(%.loc15_43.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc15_43.4: i32 = value_of_initializer %int.convert_checked.loc15_43 [template = constants.%.31] -// CHECK:STDOUT: %.loc15_43.5: i32 = converted %.loc15_43.1, %.loc15_43.4 [template = constants.%.31] -// CHECK:STDOUT: %int.usub.loc15: init i32 = call %Sub.ref.loc15(%.loc15_28.2, %.loc15_43.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc15_29.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_29.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_29.3: = bound_method %.loc15_29.1, %.loc15_29.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc15_29.4: = specific_function %.loc15_29.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc15_29: init %i32 = call %.loc15_29.4(%.loc15_29.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc15_29.5: %i32 = value_of_initializer %int.convert_checked.loc15_29 [template = constants.%.25] +// CHECK:STDOUT: %.loc15_29.6: %i32 = converted %.loc15_29.1, %.loc15_29.5 [template = constants.%.25] +// CHECK:STDOUT: %int.unegate.loc15_28: init %i32 = call %Negate.ref.loc15_22(%.loc15_29.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc15_43.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc15_28.1: %i32 = value_of_initializer %int.unegate.loc15_28 [template = constants.%.26] +// CHECK:STDOUT: %.loc15_28.2: %i32 = converted %int.unegate.loc15_28, %.loc15_28.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc15_43.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_43.3: = bound_method %.loc15_43.1, %.loc15_43.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc15_43.4: = specific_function %.loc15_43.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc15_43: init %i32 = call %.loc15_43.4(%.loc15_43.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc15_43.5: %i32 = value_of_initializer %int.convert_checked.loc15_43 [template = constants.%.30] +// CHECK:STDOUT: %.loc15_43.6: %i32 = converted %.loc15_43.1, %.loc15_43.5 [template = constants.%.30] +// CHECK:STDOUT: %int.usub.loc15: init %i32 = call %Sub.ref.loc15(%.loc15_28.2, %.loc15_43.6) [template = constants.%.33] // CHECK:STDOUT: %Negate.ref.loc15_47: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc15_54.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc15_54.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_54.3: = bound_method %.loc15_54.1, %.loc15_54.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc15_54: init i32 = call %.loc15_54.3(%.loc15_54.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc15_54.4: i32 = value_of_initializer %int.convert_checked.loc15_54 [template = constants.%.31] -// CHECK:STDOUT: %.loc15_54.5: i32 = converted %.loc15_54.1, %.loc15_54.4 [template = constants.%.31] -// CHECK:STDOUT: %int.unegate.loc15_53: init i32 = call %Negate.ref.loc15_47(%.loc15_54.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc15_21.1: i32 = value_of_initializer %int.usub.loc15 [template = constants.%.34] -// CHECK:STDOUT: %.loc15_21.2: i32 = converted %int.usub.loc15, %.loc15_21.1 [template = constants.%.34] -// CHECK:STDOUT: %.loc15_53.1: i32 = value_of_initializer %int.unegate.loc15_53 [template = constants.%.32] -// CHECK:STDOUT: %.loc15_53.2: i32 = converted %int.unegate.loc15_53, %.loc15_53.1 [template = constants.%.32] -// CHECK:STDOUT: %int.udiv.loc15: init i32 = call %Div.ref.loc15(%.loc15_21.2, %.loc15_53.2) [template = constants.%.33] -// CHECK:STDOUT: %.loc15_57.1: i32 = value_of_initializer %int.udiv.loc15 [template = constants.%.33] -// CHECK:STDOUT: %.loc15_57.2: i32 = converted %int.udiv.loc15, %.loc15_57.1 [template = constants.%.33] -// CHECK:STDOUT: %c: i32 = bind_name c, %.loc15_57.2 +// CHECK:STDOUT: %.loc15_54.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc15_54.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_54.3: = bound_method %.loc15_54.1, %.loc15_54.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc15_54.4: = specific_function %.loc15_54.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc15_54: init %i32 = call %.loc15_54.4(%.loc15_54.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc15_54.5: %i32 = value_of_initializer %int.convert_checked.loc15_54 [template = constants.%.30] +// CHECK:STDOUT: %.loc15_54.6: %i32 = converted %.loc15_54.1, %.loc15_54.5 [template = constants.%.30] +// CHECK:STDOUT: %int.unegate.loc15_53: init %i32 = call %Negate.ref.loc15_47(%.loc15_54.6) [template = constants.%.31] +// CHECK:STDOUT: %.loc15_21.1: %i32 = value_of_initializer %int.usub.loc15 [template = constants.%.33] +// CHECK:STDOUT: %.loc15_21.2: %i32 = converted %int.usub.loc15, %.loc15_21.1 [template = constants.%.33] +// CHECK:STDOUT: %.loc15_53.1: %i32 = value_of_initializer %int.unegate.loc15_53 [template = constants.%.31] +// CHECK:STDOUT: %.loc15_53.2: %i32 = converted %int.unegate.loc15_53, %.loc15_53.1 [template = constants.%.31] +// CHECK:STDOUT: %int.udiv.loc15: init %i32 = call %Div.ref.loc15(%.loc15_21.2, %.loc15_53.2) [template = constants.%.32] +// CHECK:STDOUT: %.loc15_57.1: %i32 = value_of_initializer %int.udiv.loc15 [template = constants.%.32] +// CHECK:STDOUT: %.loc15_57.2: %i32 = converted %int.udiv.loc15, %.loc15_57.1 [template = constants.%.32] +// CHECK:STDOUT: %c: %i32 = bind_name c, %.loc15_57.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_div_by_zero.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Div.type: type = fn_type @Div [template] // CHECK:STDOUT: %Div: %Div.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 0 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -467,75 +510,84 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4_11, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%.loc4_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.3: type = converted %int.make_type_signed.loc4_19, %.loc4_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed.loc4_27, %.loc4_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32] -// CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_32.loc10, %.loc10_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] +// CHECK:STDOUT: %.loc10_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc10: init type = call constants.%Int(%.loc10_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8.2: type = value_of_initializer %int.make_type_signed.loc10 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8.3: type = converted %int.make_type_signed.loc10, %.loc10_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed.loc15, %.loc15_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.udiv"; +// CHECK:STDOUT: fn @Div(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.udiv"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Div.ref.loc10: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %.loc10_18.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc10_21.1: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc10_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_18.3: = bound_method %.loc10_18.1, %.loc10_18.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc10_18: init i32 = call %.loc10_18.3(%.loc10_18.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc10_18.4: i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%.28] -// CHECK:STDOUT: %.loc10_18.5: i32 = converted %.loc10_18.1, %.loc10_18.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc10_21.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_21.3: = bound_method %.loc10_21.1, %.loc10_21.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc10_21: init i32 = call %.loc10_21.3(%.loc10_21.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc10_21.4: i32 = value_of_initializer %int.convert_checked.loc10_21 [template = constants.%.30] -// CHECK:STDOUT: %.loc10_21.5: i32 = converted %.loc10_21.1, %.loc10_21.4 [template = constants.%.30] -// CHECK:STDOUT: %int.udiv.loc10: init i32 = call %Div.ref.loc10(%.loc10_18.5, %.loc10_21.5) [template = ] -// CHECK:STDOUT: %.loc10_23.1: i32 = value_of_initializer %int.udiv.loc10 [template = ] -// CHECK:STDOUT: %.loc10_23.2: i32 = converted %int.udiv.loc10, %.loc10_23.1 [template = ] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc10_23.2 +// CHECK:STDOUT: %.loc10_18.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc10_21.1: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc10_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_18.3: = bound_method %.loc10_18.1, %.loc10_18.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc10_18.4: = specific_function %.loc10_18.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc10_18: init %i32 = call %.loc10_18.4(%.loc10_18.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc10_18.5: %i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%.26] +// CHECK:STDOUT: %.loc10_18.6: %i32 = converted %.loc10_18.1, %.loc10_18.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc10_21.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_21.3: = bound_method %.loc10_21.1, %.loc10_21.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc10_21.4: = specific_function %.loc10_21.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc10_21: init %i32 = call %.loc10_21.4(%.loc10_21.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc10_21.5: %i32 = value_of_initializer %int.convert_checked.loc10_21 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_21.6: %i32 = converted %.loc10_21.1, %.loc10_21.5 [template = constants.%.29] +// CHECK:STDOUT: %int.udiv.loc10: init %i32 = call %Div.ref.loc10(%.loc10_18.6, %.loc10_21.6) [template = ] +// CHECK:STDOUT: %.loc10_23.1: %i32 = value_of_initializer %int.udiv.loc10 [template = ] +// CHECK:STDOUT: %.loc10_23.2: %i32 = converted %int.udiv.loc10, %.loc10_23.1 [template = ] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc10_23.2 // CHECK:STDOUT: %Div.ref.loc15: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %.loc15_18.1: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc15_21.1: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc15_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_18.3: = bound_method %.loc15_18.1, %.loc15_18.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc15_18: init i32 = call %.loc15_18.3(%.loc15_18.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc15_18.4: i32 = value_of_initializer %int.convert_checked.loc15_18 [template = constants.%.30] -// CHECK:STDOUT: %.loc15_18.5: i32 = converted %.loc15_18.1, %.loc15_18.4 [template = constants.%.30] -// CHECK:STDOUT: %.loc15_21.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_21.3: = bound_method %.loc15_21.1, %.loc15_21.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc15_21: init i32 = call %.loc15_21.3(%.loc15_21.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc15_21.4: i32 = value_of_initializer %int.convert_checked.loc15_21 [template = constants.%.30] -// CHECK:STDOUT: %.loc15_21.5: i32 = converted %.loc15_21.1, %.loc15_21.4 [template = constants.%.30] -// CHECK:STDOUT: %int.udiv.loc15: init i32 = call %Div.ref.loc15(%.loc15_18.5, %.loc15_21.5) [template = ] -// CHECK:STDOUT: %.loc15_23.1: i32 = value_of_initializer %int.udiv.loc15 [template = ] -// CHECK:STDOUT: %.loc15_23.2: i32 = converted %int.udiv.loc15, %.loc15_23.1 [template = ] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc15_23.2 +// CHECK:STDOUT: %.loc15_18.1: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_21.1: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_18.3: = bound_method %.loc15_18.1, %.loc15_18.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc15_18.4: = specific_function %.loc15_18.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc15_18: init %i32 = call %.loc15_18.4(%.loc15_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc15_18.5: %i32 = value_of_initializer %int.convert_checked.loc15_18 [template = constants.%.29] +// CHECK:STDOUT: %.loc15_18.6: %i32 = converted %.loc15_18.1, %.loc15_18.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc15_21.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_21.3: = bound_method %.loc15_21.1, %.loc15_21.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc15_21.4: = specific_function %.loc15_21.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc15_21: init %i32 = call %.loc15_21.4(%.loc15_21.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc15_21.5: %i32 = value_of_initializer %int.convert_checked.loc15_21 [template = constants.%.29] +// CHECK:STDOUT: %.loc15_21.6: %i32 = converted %.loc15_21.1, %.loc15_21.5 [template = constants.%.29] +// CHECK:STDOUT: %int.udiv.loc15: init %i32 = call %Div.ref.loc15(%.loc15_18.6, %.loc15_21.6) [template = ] +// CHECK:STDOUT: %.loc15_23.1: %i32 = value_of_initializer %int.udiv.loc15 [template = ] +// CHECK:STDOUT: %.loc15_23.2: %i32 = converted %int.udiv.loc15, %.loc15_23.1 [template = ] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc15_23.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/umod.carbon b/toolchain/check/testdata/builtins/int/umod.carbon index f1109a4dff40..19104219b209 100644 --- a/toolchain/check/testdata/builtins/int/umod.carbon +++ b/toolchain/check/testdata/builtins/int/umod.carbon @@ -58,28 +58,33 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: --- int_div.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Mod.type: type = fn_type @Mod [template] // CHECK:STDOUT: %Mod: %Mod.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 5 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 3 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 5 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 3 [template] -// CHECK:STDOUT: %.31: i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.16 [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.15 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.4(%.1) [template] // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.35: type = array_type %.34, i32 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, %i32 [template] // CHECK:STDOUT: %.36: type = ptr_type %.35 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] @@ -87,7 +92,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -104,98 +109,109 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%.loc2_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.3: type = converted %int.make_type_signed.loc2_11, %.loc2_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%.loc2_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.3: type = converted %int.make_type_signed.loc2_19, %.loc2_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%.loc2_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.2: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.3: type = converted %int.make_type_signed.loc2_27, %.loc2_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %Mod.ref: %Mod.type = name_ref Mod, %Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 5 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 3 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init i32 = call %.loc4_20.3(%.loc4_20.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.4: i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.5: i32 = converted %.loc4_20.1, %.loc4_20.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init i32 = call %.loc4_23.3(%.loc4_23.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.4: i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.5: i32 = converted %.loc4_23.1, %.loc4_23.4 [template = constants.%.30] -// CHECK:STDOUT: %int.umod: init i32 = call %Mod.ref(%.loc4_20.5, %.loc4_23.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_19.1: %Convert.type.5 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.umod, %.loc4_19.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.umod [template = constants.%.31] -// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.umod, %.loc4_19.3 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.umod, %.loc4_19.5 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 5 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 3 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_20.4: = specific_function %.loc4_20.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %.loc4_20.4(%.loc4_20.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.5: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.6: %i32 = converted %.loc4_20.1, %.loc4_20.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_23.4: = specific_function %.loc4_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %.loc4_23.4(%.loc4_23.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.5: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.6: %i32 = converted %.loc4_23.1, %.loc4_23.5 [template = constants.%.29] +// CHECK:STDOUT: %int.umod: init %i32 = call %Mod.ref(%.loc4_20.6, %.loc4_23.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.6 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.umod, %.loc4_19.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc4_19.3: = specific_function %.loc4_19.2, @Convert.4(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc4_19.4: %i32 = value_of_initializer %int.umod [template = constants.%.30] +// CHECK:STDOUT: %.loc4_19.5: %i32 = converted %int.umod, %.loc4_19.4 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.3(%.loc4_19.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.7: Core.IntLiteral = converted %int.umod, %.loc4_19.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.7, %i32 [template = constants.%.35] // CHECK:STDOUT: %arr.var: ref %.35 = var arr // CHECK:STDOUT: %arr: ref %.35 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_13.1) [template = constants.%i32] // CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 2 [template = constants.%.34] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_13.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_13.3: type = converted %int.make_type_signed.loc5, %.loc5_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, %i32 [template = constants.%.35] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.35 [template = constants.%.36] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.3: type = converted %int.make_type_signed.loc7_19, %.loc7_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%.loc7_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.3: type = converted %int.make_type_signed.loc7_27, %.loc7_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%.loc7_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.3: type = converted %int.make_type_signed.loc7_35, %.loc7_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.umod"; +// CHECK:STDOUT: fn @Mod(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umod"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mod.ref: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %int.umod: init i32 = call %Mod.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: i32 = value_of_initializer %int.umod -// CHECK:STDOUT: %.loc8_19.2: i32 = converted %int.umod, %.loc8_19.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %int.umod: init %i32 = call %Mod.ref(%a.ref, %b.ref) +// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.umod +// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.umod, %.loc8_19.1 // CHECK:STDOUT: return %.loc8_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -210,33 +226,37 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: --- overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Mod.type: type = fn_type @Mod [template] // CHECK:STDOUT: %Mod: %Mod.type = struct_value () [template] // CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] // CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %.28: i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: i32 = int_value -1 [template] -// CHECK:STDOUT: %.33: i32 = int_value -2147483648 [template] -// CHECK:STDOUT: %.34: i32 = int_value 0 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.26: %i32 = int_value -2147483647 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: %i32 = int_value -1 [template] +// CHECK:STDOUT: %.32: %i32 = int_value -2147483648 [template] +// CHECK:STDOUT: %.33: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -255,205 +275,228 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4_11, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%.loc4_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.3: type = converted %int.make_type_signed.loc4_19, %.loc4_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed.loc4_27, %.loc4_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] -// CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_32.loc5_11, %.loc5_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_32.loc5_19 [template = i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_32.loc5_19, %.loc5_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_32.loc5_27 [template = i32] -// CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc5_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_11: init type = call constants.%Int(%.loc5_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_11.2: type = value_of_initializer %int.make_type_signed.loc5_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_11.3: type = converted %int.make_type_signed.loc5_11, %.loc5_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_19: init type = call constants.%Int(%.loc5_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.2: type = value_of_initializer %int.make_type_signed.loc5_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.3: type = converted %int.make_type_signed.loc5_19, %.loc5_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_27: init type = call constants.%Int(%.loc5_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.2: type = value_of_initializer %int.make_type_signed.loc5_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.3: type = converted %int.make_type_signed.loc5_27, %.loc5_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] -// CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_32.loc6_14, %.loc6_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc6_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_32.loc6_22 [template = i32] -// CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc6_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_14: init type = call constants.%Int(%.loc6_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_signed.loc6_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_signed.loc6_14, %.loc6_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_22: init type = call constants.%Int(%.loc6_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.2: type = value_of_initializer %int.make_type_signed.loc6_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22.3: type = converted %int.make_type_signed.loc6_22, %.loc6_22.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] -// CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_32.loc9, %.loc9_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] +// CHECK:STDOUT: %.loc9_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%.loc9_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_8.2: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_8.3: type = converted %int.make_type_signed.loc9, %.loc9_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.3: type = converted %int.make_type_signed.loc12, %.loc12_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed.loc15, %.loc15_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.umod"; +// CHECK:STDOUT: fn @Mod(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umod"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.usub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.unegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.unegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mod.ref.loc9: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc9_25.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc9_25.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_25.3: = bound_method %.loc9_25.1, %.loc9_25.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc9_25: init i32 = call %.loc9_25.3(%.loc9_25.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc9_25.4: i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%.27] -// CHECK:STDOUT: %.loc9_25.5: i32 = converted %.loc9_25.1, %.loc9_25.4 [template = constants.%.27] -// CHECK:STDOUT: %int.unegate.loc9_24: init i32 = call %Negate.ref.loc9_18(%.loc9_25.5) [template = constants.%.28] +// CHECK:STDOUT: %.loc9_25.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc9_25.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_25.3: = bound_method %.loc9_25.1, %.loc9_25.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc9_25.4: = specific_function %.loc9_25.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %.loc9_25.4(%.loc9_25.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc9_25.5: %i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%.25] +// CHECK:STDOUT: %.loc9_25.6: %i32 = converted %.loc9_25.1, %.loc9_25.5 [template = constants.%.25] +// CHECK:STDOUT: %int.unegate.loc9_24: init %i32 = call %Negate.ref.loc9_18(%.loc9_25.6) [template = constants.%.26] // CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc9_46.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc9_46.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_46.3: = bound_method %.loc9_46.1, %.loc9_46.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc9_46: init i32 = call %.loc9_46.3(%.loc9_46.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc9_46.4: i32 = value_of_initializer %int.convert_checked.loc9_46 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_46.5: i32 = converted %.loc9_46.1, %.loc9_46.4 [template = constants.%.31] -// CHECK:STDOUT: %int.unegate.loc9_45: init i32 = call %Negate.ref.loc9_39(%.loc9_46.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc9_24.1: i32 = value_of_initializer %int.unegate.loc9_24 [template = constants.%.28] -// CHECK:STDOUT: %.loc9_24.2: i32 = converted %int.unegate.loc9_24, %.loc9_24.1 [template = constants.%.28] -// CHECK:STDOUT: %.loc9_45.1: i32 = value_of_initializer %int.unegate.loc9_45 [template = constants.%.32] -// CHECK:STDOUT: %.loc9_45.2: i32 = converted %int.unegate.loc9_45, %.loc9_45.1 [template = constants.%.32] -// CHECK:STDOUT: %int.umod.loc9: init i32 = call %Mod.ref.loc9(%.loc9_24.2, %.loc9_45.2) [template = constants.%.28] -// CHECK:STDOUT: %.loc9_49.1: i32 = value_of_initializer %int.umod.loc9 [template = constants.%.28] -// CHECK:STDOUT: %.loc9_49.2: i32 = converted %int.umod.loc9, %.loc9_49.1 [template = constants.%.28] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc9_49.2 +// CHECK:STDOUT: %.loc9_46.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_46.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_46.3: = bound_method %.loc9_46.1, %.loc9_46.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc9_46.4: = specific_function %.loc9_46.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc9_46: init %i32 = call %.loc9_46.4(%.loc9_46.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc9_46.5: %i32 = value_of_initializer %int.convert_checked.loc9_46 [template = constants.%.30] +// CHECK:STDOUT: %.loc9_46.6: %i32 = converted %.loc9_46.1, %.loc9_46.5 [template = constants.%.30] +// CHECK:STDOUT: %int.unegate.loc9_45: init %i32 = call %Negate.ref.loc9_39(%.loc9_46.6) [template = constants.%.31] +// CHECK:STDOUT: %.loc9_24.1: %i32 = value_of_initializer %int.unegate.loc9_24 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_24.2: %i32 = converted %int.unegate.loc9_24, %.loc9_24.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_45.1: %i32 = value_of_initializer %int.unegate.loc9_45 [template = constants.%.31] +// CHECK:STDOUT: %.loc9_45.2: %i32 = converted %int.unegate.loc9_45, %.loc9_45.1 [template = constants.%.31] +// CHECK:STDOUT: %int.umod.loc9: init %i32 = call %Mod.ref.loc9(%.loc9_24.2, %.loc9_45.2) [template = constants.%.26] +// CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.umod.loc9 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int.umod.loc9, %.loc9_49.1 [template = constants.%.26] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc9_49.2 // CHECK:STDOUT: %Mod.ref.loc12: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %Sub.ref.loc12: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_29.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_29.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_29.3: = bound_method %.loc12_29.1, %.loc12_29.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc12_29: init i32 = call %.loc12_29.3(%.loc12_29.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_29.4: i32 = value_of_initializer %int.convert_checked.loc12_29 [template = constants.%.27] -// CHECK:STDOUT: %.loc12_29.5: i32 = converted %.loc12_29.1, %.loc12_29.4 [template = constants.%.27] -// CHECK:STDOUT: %int.unegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_29.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc12_43.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc12_28.1: i32 = value_of_initializer %int.unegate.loc12 [template = constants.%.28] -// CHECK:STDOUT: %.loc12_28.2: i32 = converted %int.unegate.loc12, %.loc12_28.1 [template = constants.%.28] -// CHECK:STDOUT: %.loc12_43.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_43.3: = bound_method %.loc12_43.1, %.loc12_43.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc12_43: init i32 = call %.loc12_43.3(%.loc12_43.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc12_43.4: i32 = value_of_initializer %int.convert_checked.loc12_43 [template = constants.%.31] -// CHECK:STDOUT: %.loc12_43.5: i32 = converted %.loc12_43.1, %.loc12_43.4 [template = constants.%.31] -// CHECK:STDOUT: %int.usub.loc12: init i32 = call %Sub.ref.loc12(%.loc12_28.2, %.loc12_43.5) [template = constants.%.33] -// CHECK:STDOUT: %.loc12_47.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc12_21.1: i32 = value_of_initializer %int.usub.loc12 [template = constants.%.33] -// CHECK:STDOUT: %.loc12_21.2: i32 = converted %int.usub.loc12, %.loc12_21.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc12_47.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_47.3: = bound_method %.loc12_47.1, %.loc12_47.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc12_47: init i32 = call %.loc12_47.3(%.loc12_47.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc12_47.4: i32 = value_of_initializer %int.convert_checked.loc12_47 [template = constants.%.31] -// CHECK:STDOUT: %.loc12_47.5: i32 = converted %.loc12_47.1, %.loc12_47.4 [template = constants.%.31] -// CHECK:STDOUT: %int.umod.loc12: init i32 = call %Mod.ref.loc12(%.loc12_21.2, %.loc12_47.5) [template = constants.%.34] -// CHECK:STDOUT: %.loc12_49.1: i32 = value_of_initializer %int.umod.loc12 [template = constants.%.34] -// CHECK:STDOUT: %.loc12_49.2: i32 = converted %int.umod.loc12, %.loc12_49.1 [template = constants.%.34] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc12_49.2 +// CHECK:STDOUT: %.loc12_29.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_29.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_29.3: = bound_method %.loc12_29.1, %.loc12_29.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_29.4: = specific_function %.loc12_29.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %.loc12_29.4(%.loc12_29.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_29.5: %i32 = value_of_initializer %int.convert_checked.loc12_29 [template = constants.%.25] +// CHECK:STDOUT: %.loc12_29.6: %i32 = converted %.loc12_29.1, %.loc12_29.5 [template = constants.%.25] +// CHECK:STDOUT: %int.unegate.loc12: init %i32 = call %Negate.ref.loc12(%.loc12_29.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc12_43.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_28.1: %i32 = value_of_initializer %int.unegate.loc12 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_28.2: %i32 = converted %int.unegate.loc12, %.loc12_28.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_43.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_43.3: = bound_method %.loc12_43.1, %.loc12_43.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc12_43.4: = specific_function %.loc12_43.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %.loc12_43.4(%.loc12_43.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc12_43.5: %i32 = value_of_initializer %int.convert_checked.loc12_43 [template = constants.%.30] +// CHECK:STDOUT: %.loc12_43.6: %i32 = converted %.loc12_43.1, %.loc12_43.5 [template = constants.%.30] +// CHECK:STDOUT: %int.usub.loc12: init %i32 = call %Sub.ref.loc12(%.loc12_28.2, %.loc12_43.6) [template = constants.%.32] +// CHECK:STDOUT: %.loc12_47.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_21.1: %i32 = value_of_initializer %int.usub.loc12 [template = constants.%.32] +// CHECK:STDOUT: %.loc12_21.2: %i32 = converted %int.usub.loc12, %.loc12_21.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc12_47.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_47.3: = bound_method %.loc12_47.1, %.loc12_47.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc12_47.4: = specific_function %.loc12_47.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc12_47: init %i32 = call %.loc12_47.4(%.loc12_47.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc12_47.5: %i32 = value_of_initializer %int.convert_checked.loc12_47 [template = constants.%.30] +// CHECK:STDOUT: %.loc12_47.6: %i32 = converted %.loc12_47.1, %.loc12_47.5 [template = constants.%.30] +// CHECK:STDOUT: %int.umod.loc12: init %i32 = call %Mod.ref.loc12(%.loc12_21.2, %.loc12_47.6) [template = constants.%.33] +// CHECK:STDOUT: %.loc12_49.1: %i32 = value_of_initializer %int.umod.loc12 [template = constants.%.33] +// CHECK:STDOUT: %.loc12_49.2: %i32 = converted %int.umod.loc12, %.loc12_49.1 [template = constants.%.33] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc12_49.2 // CHECK:STDOUT: %Mod.ref.loc15: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %Sub.ref.loc15: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc15_22: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc15_29.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc15_29.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_29.3: = bound_method %.loc15_29.1, %.loc15_29.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc15_29: init i32 = call %.loc15_29.3(%.loc15_29.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc15_29.4: i32 = value_of_initializer %int.convert_checked.loc15_29 [template = constants.%.27] -// CHECK:STDOUT: %.loc15_29.5: i32 = converted %.loc15_29.1, %.loc15_29.4 [template = constants.%.27] -// CHECK:STDOUT: %int.unegate.loc15_28: init i32 = call %Negate.ref.loc15_22(%.loc15_29.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc15_43.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc15_28.1: i32 = value_of_initializer %int.unegate.loc15_28 [template = constants.%.28] -// CHECK:STDOUT: %.loc15_28.2: i32 = converted %int.unegate.loc15_28, %.loc15_28.1 [template = constants.%.28] -// CHECK:STDOUT: %.loc15_43.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_43.3: = bound_method %.loc15_43.1, %.loc15_43.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc15_43: init i32 = call %.loc15_43.3(%.loc15_43.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc15_43.4: i32 = value_of_initializer %int.convert_checked.loc15_43 [template = constants.%.31] -// CHECK:STDOUT: %.loc15_43.5: i32 = converted %.loc15_43.1, %.loc15_43.4 [template = constants.%.31] -// CHECK:STDOUT: %int.usub.loc15: init i32 = call %Sub.ref.loc15(%.loc15_28.2, %.loc15_43.5) [template = constants.%.33] +// CHECK:STDOUT: %.loc15_29.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_29.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_29.3: = bound_method %.loc15_29.1, %.loc15_29.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc15_29.4: = specific_function %.loc15_29.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc15_29: init %i32 = call %.loc15_29.4(%.loc15_29.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc15_29.5: %i32 = value_of_initializer %int.convert_checked.loc15_29 [template = constants.%.25] +// CHECK:STDOUT: %.loc15_29.6: %i32 = converted %.loc15_29.1, %.loc15_29.5 [template = constants.%.25] +// CHECK:STDOUT: %int.unegate.loc15_28: init %i32 = call %Negate.ref.loc15_22(%.loc15_29.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc15_43.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc15_28.1: %i32 = value_of_initializer %int.unegate.loc15_28 [template = constants.%.26] +// CHECK:STDOUT: %.loc15_28.2: %i32 = converted %int.unegate.loc15_28, %.loc15_28.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc15_43.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_43.3: = bound_method %.loc15_43.1, %.loc15_43.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc15_43.4: = specific_function %.loc15_43.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc15_43: init %i32 = call %.loc15_43.4(%.loc15_43.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc15_43.5: %i32 = value_of_initializer %int.convert_checked.loc15_43 [template = constants.%.30] +// CHECK:STDOUT: %.loc15_43.6: %i32 = converted %.loc15_43.1, %.loc15_43.5 [template = constants.%.30] +// CHECK:STDOUT: %int.usub.loc15: init %i32 = call %Sub.ref.loc15(%.loc15_28.2, %.loc15_43.6) [template = constants.%.32] // CHECK:STDOUT: %Negate.ref.loc15_47: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc15_54.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc15_54.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_54.3: = bound_method %.loc15_54.1, %.loc15_54.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc15_54: init i32 = call %.loc15_54.3(%.loc15_54.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc15_54.4: i32 = value_of_initializer %int.convert_checked.loc15_54 [template = constants.%.31] -// CHECK:STDOUT: %.loc15_54.5: i32 = converted %.loc15_54.1, %.loc15_54.4 [template = constants.%.31] -// CHECK:STDOUT: %int.unegate.loc15_53: init i32 = call %Negate.ref.loc15_47(%.loc15_54.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc15_21.1: i32 = value_of_initializer %int.usub.loc15 [template = constants.%.33] -// CHECK:STDOUT: %.loc15_21.2: i32 = converted %int.usub.loc15, %.loc15_21.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc15_53.1: i32 = value_of_initializer %int.unegate.loc15_53 [template = constants.%.32] -// CHECK:STDOUT: %.loc15_53.2: i32 = converted %int.unegate.loc15_53, %.loc15_53.1 [template = constants.%.32] -// CHECK:STDOUT: %int.umod.loc15: init i32 = call %Mod.ref.loc15(%.loc15_21.2, %.loc15_53.2) [template = constants.%.33] -// CHECK:STDOUT: %.loc15_57.1: i32 = value_of_initializer %int.umod.loc15 [template = constants.%.33] -// CHECK:STDOUT: %.loc15_57.2: i32 = converted %int.umod.loc15, %.loc15_57.1 [template = constants.%.33] -// CHECK:STDOUT: %c: i32 = bind_name c, %.loc15_57.2 +// CHECK:STDOUT: %.loc15_54.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc15_54.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_54.3: = bound_method %.loc15_54.1, %.loc15_54.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc15_54.4: = specific_function %.loc15_54.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc15_54: init %i32 = call %.loc15_54.4(%.loc15_54.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc15_54.5: %i32 = value_of_initializer %int.convert_checked.loc15_54 [template = constants.%.30] +// CHECK:STDOUT: %.loc15_54.6: %i32 = converted %.loc15_54.1, %.loc15_54.5 [template = constants.%.30] +// CHECK:STDOUT: %int.unegate.loc15_53: init %i32 = call %Negate.ref.loc15_47(%.loc15_54.6) [template = constants.%.31] +// CHECK:STDOUT: %.loc15_21.1: %i32 = value_of_initializer %int.usub.loc15 [template = constants.%.32] +// CHECK:STDOUT: %.loc15_21.2: %i32 = converted %int.usub.loc15, %.loc15_21.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc15_53.1: %i32 = value_of_initializer %int.unegate.loc15_53 [template = constants.%.31] +// CHECK:STDOUT: %.loc15_53.2: %i32 = converted %int.unegate.loc15_53, %.loc15_53.1 [template = constants.%.31] +// CHECK:STDOUT: %int.umod.loc15: init %i32 = call %Mod.ref.loc15(%.loc15_21.2, %.loc15_53.2) [template = constants.%.32] +// CHECK:STDOUT: %.loc15_57.1: %i32 = value_of_initializer %int.umod.loc15 [template = constants.%.32] +// CHECK:STDOUT: %.loc15_57.2: %i32 = converted %int.umod.loc15, %.loc15_57.1 [template = constants.%.32] +// CHECK:STDOUT: %c: %i32 = bind_name c, %.loc15_57.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_div_by_zero.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Mod.type: type = fn_type @Mod [template] // CHECK:STDOUT: %Mod: %Mod.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 0 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -469,75 +512,84 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4_11, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%.loc4_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.3: type = converted %int.make_type_signed.loc4_19, %.loc4_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed.loc4_27, %.loc4_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_8.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] -// CHECK:STDOUT: %.loc17_8.2: type = converted %int.make_type_32.loc17, %.loc17_8.1 [template = i32] +// CHECK:STDOUT: %.loc12_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.3: type = converted %int.make_type_signed.loc12, %.loc12_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%.loc17_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_8.2: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_8.3: type = converted %int.make_type_signed.loc17, %.loc17_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.umod"; +// CHECK:STDOUT: fn @Mod(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umod"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mod.ref.loc12: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %.loc12_18.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_21.1: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc12_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_18.3: = bound_method %.loc12_18.1, %.loc12_18.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc12_18: init i32 = call %.loc12_18.3(%.loc12_18.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc12_18.4: i32 = value_of_initializer %int.convert_checked.loc12_18 [template = constants.%.28] -// CHECK:STDOUT: %.loc12_18.5: i32 = converted %.loc12_18.1, %.loc12_18.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc12_21.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_21.3: = bound_method %.loc12_21.1, %.loc12_21.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc12_21: init i32 = call %.loc12_21.3(%.loc12_21.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc12_21.4: i32 = value_of_initializer %int.convert_checked.loc12_21 [template = constants.%.30] -// CHECK:STDOUT: %.loc12_21.5: i32 = converted %.loc12_21.1, %.loc12_21.4 [template = constants.%.30] -// CHECK:STDOUT: %int.umod.loc12: init i32 = call %Mod.ref.loc12(%.loc12_18.5, %.loc12_21.5) [template = ] -// CHECK:STDOUT: %.loc12_23.1: i32 = value_of_initializer %int.umod.loc12 [template = ] -// CHECK:STDOUT: %.loc12_23.2: i32 = converted %int.umod.loc12, %.loc12_23.1 [template = ] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc12_23.2 +// CHECK:STDOUT: %.loc12_18.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_21.1: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_18.3: = bound_method %.loc12_18.1, %.loc12_18.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc12_18.4: = specific_function %.loc12_18.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc12_18: init %i32 = call %.loc12_18.4(%.loc12_18.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc12_18.5: %i32 = value_of_initializer %int.convert_checked.loc12_18 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_18.6: %i32 = converted %.loc12_18.1, %.loc12_18.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_21.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_21.3: = bound_method %.loc12_21.1, %.loc12_21.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_21.4: = specific_function %.loc12_21.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc12_21: init %i32 = call %.loc12_21.4(%.loc12_21.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc12_21.5: %i32 = value_of_initializer %int.convert_checked.loc12_21 [template = constants.%.29] +// CHECK:STDOUT: %.loc12_21.6: %i32 = converted %.loc12_21.1, %.loc12_21.5 [template = constants.%.29] +// CHECK:STDOUT: %int.umod.loc12: init %i32 = call %Mod.ref.loc12(%.loc12_18.6, %.loc12_21.6) [template = ] +// CHECK:STDOUT: %.loc12_23.1: %i32 = value_of_initializer %int.umod.loc12 [template = ] +// CHECK:STDOUT: %.loc12_23.2: %i32 = converted %int.umod.loc12, %.loc12_23.1 [template = ] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc12_23.2 // CHECK:STDOUT: %Mod.ref.loc17: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %.loc17_18.1: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc17_21.1: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc17_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc17_18.3: = bound_method %.loc17_18.1, %.loc17_18.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc17_18: init i32 = call %.loc17_18.3(%.loc17_18.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc17_18.4: i32 = value_of_initializer %int.convert_checked.loc17_18 [template = constants.%.30] -// CHECK:STDOUT: %.loc17_18.5: i32 = converted %.loc17_18.1, %.loc17_18.4 [template = constants.%.30] -// CHECK:STDOUT: %.loc17_21.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc17_21.3: = bound_method %.loc17_21.1, %.loc17_21.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc17_21: init i32 = call %.loc17_21.3(%.loc17_21.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc17_21.4: i32 = value_of_initializer %int.convert_checked.loc17_21 [template = constants.%.30] -// CHECK:STDOUT: %.loc17_21.5: i32 = converted %.loc17_21.1, %.loc17_21.4 [template = constants.%.30] -// CHECK:STDOUT: %int.umod.loc17: init i32 = call %Mod.ref.loc17(%.loc17_18.5, %.loc17_21.5) [template = ] -// CHECK:STDOUT: %.loc17_23.1: i32 = value_of_initializer %int.umod.loc17 [template = ] -// CHECK:STDOUT: %.loc17_23.2: i32 = converted %int.umod.loc17, %.loc17_23.1 [template = ] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc17_23.2 +// CHECK:STDOUT: %.loc17_18.1: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc17_21.1: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc17_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc17_18.3: = bound_method %.loc17_18.1, %.loc17_18.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc17_18.4: = specific_function %.loc17_18.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc17_18: init %i32 = call %.loc17_18.4(%.loc17_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc17_18.5: %i32 = value_of_initializer %int.convert_checked.loc17_18 [template = constants.%.29] +// CHECK:STDOUT: %.loc17_18.6: %i32 = converted %.loc17_18.1, %.loc17_18.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc17_21.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc17_21.3: = bound_method %.loc17_21.1, %.loc17_21.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc17_21.4: = specific_function %.loc17_21.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc17_21: init %i32 = call %.loc17_21.4(%.loc17_21.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc17_21.5: %i32 = value_of_initializer %int.convert_checked.loc17_21 [template = constants.%.29] +// CHECK:STDOUT: %.loc17_21.6: %i32 = converted %.loc17_21.1, %.loc17_21.5 [template = constants.%.29] +// CHECK:STDOUT: %int.umod.loc17: init %i32 = call %Mod.ref.loc17(%.loc17_18.6, %.loc17_21.6) [template = ] +// CHECK:STDOUT: %.loc17_23.1: %i32 = value_of_initializer %int.umod.loc17 [template = ] +// CHECK:STDOUT: %.loc17_23.2: %i32 = converted %int.umod.loc17, %.loc17_23.1 [template = ] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc17_23.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/umul.carbon b/toolchain/check/testdata/builtins/int/umul.carbon index 6f32948b514b..8b23a46c1294 100644 --- a/toolchain/check/testdata/builtins/int/umul.carbon +++ b/toolchain/check/testdata/builtins/int/umul.carbon @@ -31,28 +31,33 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: --- int_mul.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Mul.type: type = fn_type @Mul [template] // CHECK:STDOUT: %Mul: %Mul.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 3 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 6 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 3 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] -// CHECK:STDOUT: %.31: i32 = int_value 6 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.16 [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.15 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.4(%.1) [template] // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 6 [template] -// CHECK:STDOUT: %.35: type = array_type %.34, i32 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, %i32 [template] // CHECK:STDOUT: %.36: type = ptr_type %.35 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] @@ -60,7 +65,7 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -77,98 +82,109 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%.loc2_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.3: type = converted %int.make_type_signed.loc2_11, %.loc2_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%.loc2_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.3: type = converted %int.make_type_signed.loc2_19, %.loc2_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%.loc2_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.2: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.3: type = converted %int.make_type_signed.loc2_27, %.loc2_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, %Mul.decl [template = constants.%Mul] -// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init i32 = call %.loc4_20.3(%.loc4_20.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.4: i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.5: i32 = converted %.loc4_20.1, %.loc4_20.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init i32 = call %.loc4_23.3(%.loc4_23.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.4: i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.5: i32 = converted %.loc4_23.1, %.loc4_23.4 [template = constants.%.30] -// CHECK:STDOUT: %int.umul: init i32 = call %Mul.ref(%.loc4_20.5, %.loc4_23.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_19.1: %Convert.type.5 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.umul, %.loc4_19.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.umul [template = constants.%.31] -// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.umul, %.loc4_19.3 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.umul, %.loc4_19.5 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_20.4: = specific_function %.loc4_20.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %.loc4_20.4(%.loc4_20.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.5: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.6: %i32 = converted %.loc4_20.1, %.loc4_20.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_23.4: = specific_function %.loc4_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %.loc4_23.4(%.loc4_23.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.5: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.6: %i32 = converted %.loc4_23.1, %.loc4_23.5 [template = constants.%.29] +// CHECK:STDOUT: %int.umul: init %i32 = call %Mul.ref(%.loc4_20.6, %.loc4_23.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.6 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.umul, %.loc4_19.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc4_19.3: = specific_function %.loc4_19.2, @Convert.4(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc4_19.4: %i32 = value_of_initializer %int.umul [template = constants.%.30] +// CHECK:STDOUT: %.loc4_19.5: %i32 = converted %int.umul, %.loc4_19.4 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.3(%.loc4_19.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.7: Core.IntLiteral = converted %int.umul, %.loc4_19.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.7, %i32 [template = constants.%.35] // CHECK:STDOUT: %arr.var: ref %.35 = var arr // CHECK:STDOUT: %arr: ref %.35 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_13.1) [template = constants.%i32] // CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 6 [template = constants.%.34] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_13.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_13.3: type = converted %int.make_type_signed.loc5, %.loc5_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, %i32 [template = constants.%.35] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.35 [template = constants.%.36] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.3: type = converted %int.make_type_signed.loc7_19, %.loc7_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%.loc7_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.3: type = converted %int.make_type_signed.loc7_27, %.loc7_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%.loc7_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.3: type = converted %int.make_type_signed.loc7_35, %.loc7_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mul(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.umul"; +// CHECK:STDOUT: fn @Mul(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umul"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %int.umul: init i32 = call %Mul.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: i32 = value_of_initializer %int.umul -// CHECK:STDOUT: %.loc8_19.2: i32 = converted %int.umul, %.loc8_19.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %int.umul: init %i32 = call %Mul.ref(%a.ref, %b.ref) +// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.umul +// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.umul, %.loc8_19.1 // CHECK:STDOUT: return %.loc8_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -183,30 +199,35 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: --- overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Mul.type: type = fn_type @Mul [template] // CHECK:STDOUT: %Mul: %Mul.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32767 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 65536 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 32767 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 65536 [template] -// CHECK:STDOUT: %.31: i32 = int_value 2147418112 [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 32768 [template] -// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 32768 [template] -// CHECK:STDOUT: %.35: i32 = int_value -2147483648 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32767 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 65536 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 32767 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 65536 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 2147418112 [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 32768 [template] +// CHECK:STDOUT: %.32: = bound_method %.31, %Convert.14 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 32768 [template] +// CHECK:STDOUT: %.35: %i32 = int_value -2147483648 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -222,75 +243,84 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4_11, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%.loc4_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.3: type = converted %int.make_type_signed.loc4_19, %.loc4_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed.loc4_27, %.loc4_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] +// CHECK:STDOUT: %.loc6_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.3: type = converted %int.make_type_signed.loc6, %.loc6_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%.loc7_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.2: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.3: type = converted %int.make_type_signed.loc7, %.loc7_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mul(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.umul"; +// CHECK:STDOUT: fn @Mul(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umul"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mul.ref.loc6: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] -// CHECK:STDOUT: %.loc6_18.1: Core.IntLiteral = int_value 32767 [template = constants.%.1] -// CHECK:STDOUT: %.loc6_26.1: Core.IntLiteral = int_value 65536 [template = constants.%.2] -// CHECK:STDOUT: %.loc6_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_18.3: = bound_method %.loc6_18.1, %.loc6_18.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc6_18: init i32 = call %.loc6_18.3(%.loc6_18.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc6_18.4: i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_18.5: i32 = converted %.loc6_18.1, %.loc6_18.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_26.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_26.3: = bound_method %.loc6_26.1, %.loc6_26.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc6_26: init i32 = call %.loc6_26.3(%.loc6_26.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc6_26.4: i32 = value_of_initializer %int.convert_checked.loc6_26 [template = constants.%.30] -// CHECK:STDOUT: %.loc6_26.5: i32 = converted %.loc6_26.1, %.loc6_26.4 [template = constants.%.30] -// CHECK:STDOUT: %int.umul.loc6: init i32 = call %Mul.ref.loc6(%.loc6_18.5, %.loc6_26.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc6_34.1: i32 = value_of_initializer %int.umul.loc6 [template = constants.%.31] -// CHECK:STDOUT: %.loc6_34.2: i32 = converted %int.umul.loc6, %.loc6_34.1 [template = constants.%.31] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc6_34.2 +// CHECK:STDOUT: %.loc6_18.1: Core.IntLiteral = int_value 32767 [template = constants.%.2] +// CHECK:STDOUT: %.loc6_26.1: Core.IntLiteral = int_value 65536 [template = constants.%.3] +// CHECK:STDOUT: %.loc6_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_18.3: = bound_method %.loc6_18.1, %.loc6_18.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc6_18.4: = specific_function %.loc6_18.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %.loc6_18.4(%.loc6_18.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc6_18.5: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%.26] +// CHECK:STDOUT: %.loc6_18.6: %i32 = converted %.loc6_18.1, %.loc6_18.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc6_26.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_26.3: = bound_method %.loc6_26.1, %.loc6_26.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc6_26.4: = specific_function %.loc6_26.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc6_26: init %i32 = call %.loc6_26.4(%.loc6_26.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc6_26.5: %i32 = value_of_initializer %int.convert_checked.loc6_26 [template = constants.%.29] +// CHECK:STDOUT: %.loc6_26.6: %i32 = converted %.loc6_26.1, %.loc6_26.5 [template = constants.%.29] +// CHECK:STDOUT: %int.umul.loc6: init %i32 = call %Mul.ref.loc6(%.loc6_18.6, %.loc6_26.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc6_34.1: %i32 = value_of_initializer %int.umul.loc6 [template = constants.%.30] +// CHECK:STDOUT: %.loc6_34.2: %i32 = converted %int.umul.loc6, %.loc6_34.1 [template = constants.%.30] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc6_34.2 // CHECK:STDOUT: %Mul.ref.loc7: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] -// CHECK:STDOUT: %.loc7_18.1: Core.IntLiteral = int_value 32768 [template = constants.%.32] -// CHECK:STDOUT: %.loc7_26.1: Core.IntLiteral = int_value 65536 [template = constants.%.2] -// CHECK:STDOUT: %.loc7_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_18.3: = bound_method %.loc7_18.1, %.loc7_18.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc7_18: init i32 = call %.loc7_18.3(%.loc7_18.1) [template = constants.%.34] -// CHECK:STDOUT: %.loc7_18.4: i32 = value_of_initializer %int.convert_checked.loc7_18 [template = constants.%.34] -// CHECK:STDOUT: %.loc7_18.5: i32 = converted %.loc7_18.1, %.loc7_18.4 [template = constants.%.34] -// CHECK:STDOUT: %.loc7_26.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_26.3: = bound_method %.loc7_26.1, %.loc7_26.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc7_26: init i32 = call %.loc7_26.3(%.loc7_26.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc7_26.4: i32 = value_of_initializer %int.convert_checked.loc7_26 [template = constants.%.30] -// CHECK:STDOUT: %.loc7_26.5: i32 = converted %.loc7_26.1, %.loc7_26.4 [template = constants.%.30] -// CHECK:STDOUT: %int.umul.loc7: init i32 = call %Mul.ref.loc7(%.loc7_18.5, %.loc7_26.5) [template = constants.%.35] -// CHECK:STDOUT: %.loc7_34.1: i32 = value_of_initializer %int.umul.loc7 [template = constants.%.35] -// CHECK:STDOUT: %.loc7_34.2: i32 = converted %int.umul.loc7, %.loc7_34.1 [template = constants.%.35] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc7_34.2 +// CHECK:STDOUT: %.loc7_18.1: Core.IntLiteral = int_value 32768 [template = constants.%.31] +// CHECK:STDOUT: %.loc7_26.1: Core.IntLiteral = int_value 65536 [template = constants.%.3] +// CHECK:STDOUT: %.loc7_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_18.3: = bound_method %.loc7_18.1, %.loc7_18.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc7_18.4: = specific_function %.loc7_18.3, @Convert.2(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc7_18: init %i32 = call %.loc7_18.4(%.loc7_18.1) [template = constants.%.34] +// CHECK:STDOUT: %.loc7_18.5: %i32 = value_of_initializer %int.convert_checked.loc7_18 [template = constants.%.34] +// CHECK:STDOUT: %.loc7_18.6: %i32 = converted %.loc7_18.1, %.loc7_18.5 [template = constants.%.34] +// CHECK:STDOUT: %.loc7_26.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_26.3: = bound_method %.loc7_26.1, %.loc7_26.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc7_26.4: = specific_function %.loc7_26.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc7_26: init %i32 = call %.loc7_26.4(%.loc7_26.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc7_26.5: %i32 = value_of_initializer %int.convert_checked.loc7_26 [template = constants.%.29] +// CHECK:STDOUT: %.loc7_26.6: %i32 = converted %.loc7_26.1, %.loc7_26.5 [template = constants.%.29] +// CHECK:STDOUT: %int.umul.loc7: init %i32 = call %Mul.ref.loc7(%.loc7_18.6, %.loc7_26.6) [template = constants.%.35] +// CHECK:STDOUT: %.loc7_34.1: %i32 = value_of_initializer %int.umul.loc7 [template = constants.%.35] +// CHECK:STDOUT: %.loc7_34.2: %i32 = converted %int.umul.loc7, %.loc7_34.1 [template = constants.%.35] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc7_34.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/unegate.carbon b/toolchain/check/testdata/builtins/int/unegate.carbon index 0f945326e838..9bdf1e6b8e2d 100644 --- a/toolchain/check/testdata/builtins/int/unegate.carbon +++ b/toolchain/check/testdata/builtins/int/unegate.carbon @@ -115,36 +115,41 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: --- int_negate.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 123 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 123 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 123 [template] +// CHECK:STDOUT: %.26: %i32 = int_value -123 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 123 [template] -// CHECK:STDOUT: %.28: i32 = int_value -123 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.30: = bound_method %.27, %Convert.16 [template] -// CHECK:STDOUT: %.31: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.32: type = ptr_type %.31 [template] -// CHECK:STDOUT: %.33: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.34: = bound_method %.33, %Convert.15 [template] -// CHECK:STDOUT: %.35: i32 = int_value 1 [template] -// CHECK:STDOUT: %.36: i32 = int_value -1 [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.28: = bound_method %.25, %Convert.15 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.4(%.1) [template] +// CHECK:STDOUT: %.30: type = array_type %.2, %i32 [template] +// CHECK:STDOUT: %.31: type = ptr_type %.30 [template] +// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.14 [template] +// CHECK:STDOUT: %.34: = specific_function %.33, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.35: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.36: %i32 = int_value -1 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -162,118 +167,131 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %int.make_type_32.loc2_14 [template = i32] -// CHECK:STDOUT: %.loc2_14.2: type = converted %int.make_type_32.loc2_14, %.loc2_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_22.1: type = value_of_initializer %int.make_type_32.loc2_22 [template = i32] -// CHECK:STDOUT: %.loc2_22.2: type = converted %int.make_type_32.loc2_22, %.loc2_22.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_14: init type = call constants.%Int(%.loc2_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_14.2: type = value_of_initializer %int.make_type_signed.loc2_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_14.3: type = converted %int.make_type_signed.loc2_14, %.loc2_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_22: init type = call constants.%Int(%.loc2_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_22.2: type = value_of_initializer %int.make_type_signed.loc2_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_22.3: type = converted %int.make_type_signed.loc2_22, %.loc2_22.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %Negate.ref.loc4_16: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %Negate.ref.loc4_23: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc4_30.1: Core.IntLiteral = int_value 123 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_30.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_30.3: = bound_method %.loc4_30.1, %.loc4_30.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc4_30: init i32 = call %.loc4_30.3(%.loc4_30.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc4_30.4: i32 = value_of_initializer %int.convert_checked.loc4_30 [template = constants.%.27] -// CHECK:STDOUT: %.loc4_30.5: i32 = converted %.loc4_30.1, %.loc4_30.4 [template = constants.%.27] -// CHECK:STDOUT: %int.unegate.loc4_29: init i32 = call %Negate.ref.loc4_23(%.loc4_30.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc4_29.1: i32 = value_of_initializer %int.unegate.loc4_29 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_29.2: i32 = converted %int.unegate.loc4_29, %.loc4_29.1 [template = constants.%.28] -// CHECK:STDOUT: %int.unegate.loc4_22: init i32 = call %Negate.ref.loc4_16(%.loc4_29.2) [template = constants.%.27] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_22.1: %Convert.type.5 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc4_22.2: = bound_method %int.unegate.loc4_22, %.loc4_22.1 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_22.3: i32 = value_of_initializer %int.unegate.loc4_22 [template = constants.%.27] -// CHECK:STDOUT: %.loc4_22.4: i32 = converted %int.unegate.loc4_22, %.loc4_22.3 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc4_22: init Core.IntLiteral = call %.loc4_22.2(%.loc4_22.4) [template = constants.%.1] -// CHECK:STDOUT: %.loc4_22.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_22 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_22.6: Core.IntLiteral = converted %int.unegate.loc4_22, %.loc4_22.5 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_35: type = array_type %.loc4_22.6, i32 [template = constants.%.31] -// CHECK:STDOUT: %arr.var: ref %.31 = var arr -// CHECK:STDOUT: %arr: ref %.31 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 123 [template = constants.%.1] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_21: type = array_type %.loc5_18, i32 [template = constants.%.31] -// CHECK:STDOUT: %.loc5_22: type = ptr_type %.31 [template = constants.%.32] -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] +// CHECK:STDOUT: %.loc4_30.1: Core.IntLiteral = int_value 123 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_30.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_30.3: = bound_method %.loc4_30.1, %.loc4_30.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc4_30.4: = specific_function %.loc4_30.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc4_30: init %i32 = call %.loc4_30.4(%.loc4_30.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc4_30.5: %i32 = value_of_initializer %int.convert_checked.loc4_30 [template = constants.%.25] +// CHECK:STDOUT: %.loc4_30.6: %i32 = converted %.loc4_30.1, %.loc4_30.5 [template = constants.%.25] +// CHECK:STDOUT: %int.unegate.loc4_29: init %i32 = call %Negate.ref.loc4_23(%.loc4_30.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc4_29.1: %i32 = value_of_initializer %int.unegate.loc4_29 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_29.2: %i32 = converted %int.unegate.loc4_29, %.loc4_29.1 [template = constants.%.26] +// CHECK:STDOUT: %int.unegate.loc4_22: init %i32 = call %Negate.ref.loc4_16(%.loc4_29.2) [template = constants.%.25] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_22.1: %Convert.type.6 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_22.2: = bound_method %int.unegate.loc4_22, %.loc4_22.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_22.3: = specific_function %.loc4_22.2, @Convert.4(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_22.4: %i32 = value_of_initializer %int.unegate.loc4_22 [template = constants.%.25] +// CHECK:STDOUT: %.loc4_22.5: %i32 = converted %int.unegate.loc4_22, %.loc4_22.4 [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc4_22: init Core.IntLiteral = call %.loc4_22.3(%.loc4_22.5) [template = constants.%.2] +// CHECK:STDOUT: %.loc4_22.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_22 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_22.7: Core.IntLiteral = converted %int.unegate.loc4_22, %.loc4_22.6 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_35: type = array_type %.loc4_22.7, %i32 [template = constants.%.30] +// CHECK:STDOUT: %arr.var: ref %.30 = var arr +// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc5_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 123 [template = constants.%.2] +// CHECK:STDOUT: %.loc5_13.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_13.3: type = converted %int.make_type_signed.loc5, %.loc5_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_21: type = array_type %.loc5_18, %i32 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_22: type = ptr_type %.30 [template = constants.%.31] +// CHECK:STDOUT: %.loc7_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%.loc7_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.2: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.3: type = converted %int.make_type_signed.loc7, %.loc7_8.2 [template = constants.%i32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc9_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_19.1: type = value_of_initializer %int.make_type_32.loc9_19 [template = i32] -// CHECK:STDOUT: %.loc9_19.2: type = converted %int.make_type_32.loc9_19, %.loc9_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc9_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_27.1: type = value_of_initializer %int.make_type_32.loc9_27 [template = i32] -// CHECK:STDOUT: %.loc9_27.2: type = converted %int.make_type_32.loc9_27, %.loc9_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc9_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_35.1: type = value_of_initializer %int.make_type_32.loc9_35 [template = i32] -// CHECK:STDOUT: %.loc9_35.2: type = converted %int.make_type_32.loc9_35, %.loc9_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc9_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc9_19: init type = call constants.%Int(%.loc9_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_19.2: type = value_of_initializer %int.make_type_signed.loc9_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_19.3: type = converted %int.make_type_signed.loc9_19, %.loc9_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc9_27: init type = call constants.%Int(%.loc9_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_27.2: type = value_of_initializer %int.make_type_signed.loc9_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_27.3: type = converted %int.make_type_signed.loc9_27, %.loc9_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc9_35: init type = call constants.%Int(%.loc9_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_35.2: type = value_of_initializer %int.make_type_signed.loc9_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_35.3: type = converted %int.make_type_signed.loc9_35, %.loc9_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.unegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.unegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %int.unegate: init i32 = call %Negate.ref(%a.ref) -// CHECK:STDOUT: %.loc10_19.1: i32 = value_of_initializer %int.unegate -// CHECK:STDOUT: %.loc10_19.2: i32 = converted %int.unegate, %.loc10_19.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %int.unegate: init %i32 = call %Negate.ref(%a.ref) +// CHECK:STDOUT: %.loc10_19.1: %i32 = value_of_initializer %int.unegate +// CHECK:STDOUT: %.loc10_19.2: %i32 = converted %int.unegate, %.loc10_19.1 // CHECK:STDOUT: return %.loc10_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %.31 = name_ref arr, file.%arr -// CHECK:STDOUT: %.loc5: %.32 = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %.32 = bind_name arr_p, %.loc5 +// CHECK:STDOUT: %arr.ref: ref %.30 = name_ref arr, file.%arr +// CHECK:STDOUT: %.loc5: %.31 = addr_of %arr.ref +// CHECK:STDOUT: %arr_p: %.31 = bind_name arr_p, %.loc5 // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc7_21.1: Core.IntLiteral = int_value 1 [template = constants.%.33] -// CHECK:STDOUT: %.loc7_21.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_21.3: = bound_method %.loc7_21.1, %.loc7_21.2 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc7_21.3(%.loc7_21.1) [template = constants.%.35] -// CHECK:STDOUT: %.loc7_21.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.35] -// CHECK:STDOUT: %.loc7_21.5: i32 = converted %.loc7_21.1, %.loc7_21.4 [template = constants.%.35] -// CHECK:STDOUT: %int.unegate: init i32 = call %Negate.ref(%.loc7_21.5) [template = constants.%.36] -// CHECK:STDOUT: %.loc7_23.1: i32 = value_of_initializer %int.unegate [template = constants.%.36] -// CHECK:STDOUT: %.loc7_23.2: i32 = converted %int.unegate, %.loc7_23.1 [template = constants.%.36] -// CHECK:STDOUT: %n: i32 = bind_name n, %.loc7_23.2 +// CHECK:STDOUT: %.loc7_21.1: Core.IntLiteral = int_value 1 [template = constants.%.32] +// CHECK:STDOUT: %.loc7_21.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_21.3: = bound_method %.loc7_21.1, %.loc7_21.2 [template = constants.%.33] +// CHECK:STDOUT: %.loc7_21.4: = specific_function %.loc7_21.3, @Convert.2(constants.%.1) [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc7_21.4(%.loc7_21.1) [template = constants.%.35] +// CHECK:STDOUT: %.loc7_21.5: %i32 = value_of_initializer %int.convert_checked [template = constants.%.35] +// CHECK:STDOUT: %.loc7_21.6: %i32 = converted %.loc7_21.1, %.loc7_21.5 [template = constants.%.35] +// CHECK:STDOUT: %int.unegate: init %i32 = call %Negate.ref(%.loc7_21.6) [template = constants.%.36] +// CHECK:STDOUT: %.loc7_23.1: %i32 = value_of_initializer %int.unegate [template = constants.%.36] +// CHECK:STDOUT: %.loc7_23.2: %i32 = converted %int.unegate, %.loc7_23.1 [template = constants.%.36] +// CHECK:STDOUT: %n: %i32 = bind_name n, %.loc7_23.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_bad_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %TooFew.type: type = fn_type @TooFew [template] // CHECK:STDOUT: %TooFew: %TooFew.type = struct_value () [template] // CHECK:STDOUT: %TooMany.type: type = fn_type @TooMany [template] @@ -284,16 +302,18 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %BadReturnType: %BadReturnType.type = struct_value () [template] // CHECK:STDOUT: %JustRight.type: type = fn_type @JustRight [template] // CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] // CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] // CHECK:STDOUT: %RuntimeCallTooFew: %RuntimeCallTooFew.type = struct_value () [template] // CHECK:STDOUT: %RuntimeCallTooMany.type: type = fn_type @RuntimeCallTooMany [template] @@ -304,7 +324,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude @@ -329,253 +349,279 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_16.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_16.2: type = converted %int.make_type_32, %.loc8_16.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc8_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_16.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_16.3: type = converted %int.make_type_signed, %.loc8_16.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc13_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %int.make_type_32.loc13_15 [template = i32] -// CHECK:STDOUT: %.loc13_15.2: type = converted %int.make_type_32.loc13_15, %.loc13_15.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_32.loc13_23 [template = i32] -// CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_32.loc13_23, %.loc13_23.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_31: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_32.loc13_31 [template = i32] -// CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_32.loc13_31, %.loc13_31.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc13_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_15: init type = call constants.%Int(%.loc13_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_15.2: type = value_of_initializer %int.make_type_signed.loc13_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_15.3: type = converted %int.make_type_signed.loc13_15, %.loc13_15.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_23: init type = call constants.%Int(%.loc13_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_23.2: type = value_of_initializer %int.make_type_signed.loc13_23 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_23.3: type = converted %int.make_type_signed.loc13_23, %.loc13_23.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_31: init type = call constants.%Int(%.loc13_31.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.2: type = value_of_initializer %int.make_type_signed.loc13_31 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.3: type = converted %int.make_type_signed.loc13_31, %.loc13_31.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc18_21.2: type = converted %int.make_type_32, %.loc18_21.1 [template = i32] +// CHECK:STDOUT: %.loc18_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc18_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_21.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc18_21.3: type = converted %int.make_type_signed, %.loc18_21.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type, %.loc18_29.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param1 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc19_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_32.loc19_17 [template = i32] -// CHECK:STDOUT: %.loc19_17.2: type = converted %int.make_type_32.loc19_17, %.loc19_17.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc19_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_25.1: type = value_of_initializer %int.make_type_32.loc19_25 [template = i32] -// CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_32.loc19_25, %.loc19_25.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc19_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19_17: init type = call constants.%Int(%.loc19_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_17.2: type = value_of_initializer %int.make_type_signed.loc19_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_17.3: type = converted %int.make_type_signed.loc19_17, %.loc19_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19_25: init type = call constants.%Int(%.loc19_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_25.2: type = value_of_initializer %int.make_type_signed.loc19_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_25.3: type = converted %int.make_type_signed.loc19_25, %.loc19_25.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc25_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc25: init type = call constants.%Int(%.loc25_15.1) [template = constants.%i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %TooFew.call: init i32 = call %TooFew.ref() -// CHECK:STDOUT: %.loc25_15.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] -// CHECK:STDOUT: %.loc25_15.2: type = converted %int.make_type_32.loc25, %.loc25_15.1 [template = i32] +// CHECK:STDOUT: %TooFew.call: init %i32 = call %TooFew.ref() +// CHECK:STDOUT: %.loc25_15.2: type = value_of_initializer %int.make_type_signed.loc25 [template = constants.%i32] +// CHECK:STDOUT: %.loc25_15.3: type = converted %int.make_type_signed.loc25, %.loc25_15.2 [template = constants.%i32] // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var -// CHECK:STDOUT: %int.make_type_32.loc30: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc30_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc30: init type = call constants.%Int(%.loc30_16.1) [template = constants.%i32] // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, %TooMany.decl [template = constants.%TooMany] -// CHECK:STDOUT: %.loc30_29.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc30_32.1: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc30_29.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc30_29.3: = bound_method %.loc30_29.1, %.loc30_29.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc30_29: init i32 = call %.loc30_29.3(%.loc30_29.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc30_29.4: i32 = value_of_initializer %int.convert_checked.loc30_29 [template = constants.%.28] -// CHECK:STDOUT: %.loc30_29.5: i32 = converted %.loc30_29.1, %.loc30_29.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc30_32.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc30_32.3: = bound_method %.loc30_32.1, %.loc30_32.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc30_32: init i32 = call %.loc30_32.3(%.loc30_32.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc30_32.4: i32 = value_of_initializer %int.convert_checked.loc30_32 [template = constants.%.30] -// CHECK:STDOUT: %.loc30_32.5: i32 = converted %.loc30_32.1, %.loc30_32.4 [template = constants.%.30] -// CHECK:STDOUT: %TooMany.call: init i32 = call %TooMany.ref(%.loc30_29.5, %.loc30_32.5) -// CHECK:STDOUT: %.loc30_16.1: type = value_of_initializer %int.make_type_32.loc30 [template = i32] -// CHECK:STDOUT: %.loc30_16.2: type = converted %int.make_type_32.loc30, %.loc30_16.1 [template = i32] +// CHECK:STDOUT: %.loc30_29.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc30_32.1: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc30_29.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc30_29.3: = bound_method %.loc30_29.1, %.loc30_29.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc30_29.4: = specific_function %.loc30_29.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc30_29: init %i32 = call %.loc30_29.4(%.loc30_29.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc30_29.5: %i32 = value_of_initializer %int.convert_checked.loc30_29 [template = constants.%.26] +// CHECK:STDOUT: %.loc30_29.6: %i32 = converted %.loc30_29.1, %.loc30_29.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc30_32.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc30_32.3: = bound_method %.loc30_32.1, %.loc30_32.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc30_32.4: = specific_function %.loc30_32.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc30_32: init %i32 = call %.loc30_32.4(%.loc30_32.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc30_32.5: %i32 = value_of_initializer %int.convert_checked.loc30_32 [template = constants.%.29] +// CHECK:STDOUT: %.loc30_32.6: %i32 = converted %.loc30_32.1, %.loc30_32.5 [template = constants.%.29] +// CHECK:STDOUT: %TooMany.call: init %i32 = call %TooMany.ref(%.loc30_29.6, %.loc30_32.6) +// CHECK:STDOUT: %.loc30_16.2: type = value_of_initializer %int.make_type_signed.loc30 [template = constants.%i32] +// CHECK:STDOUT: %.loc30_16.3: type = converted %int.make_type_signed.loc30, %.loc30_16.2 [template = constants.%i32] // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var -// CHECK:STDOUT: %int.make_type_32.loc35: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc35_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc35: init type = call constants.%Int(%.loc35_23.1) [template = constants.%i32] // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %.loc35_42.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc35_42.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc35_42.3: = bound_method %.loc35_42.1, %.loc35_42.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc35: init i32 = call %.loc35_42.3(%.loc35_42.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc35_42.4: i32 = value_of_initializer %int.convert_checked.loc35 [template = constants.%.28] -// CHECK:STDOUT: %.loc35_42.5: i32 = converted %.loc35_42.1, %.loc35_42.4 [template = constants.%.28] -// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42.5) -// CHECK:STDOUT: %.loc35_23.1: type = value_of_initializer %int.make_type_32.loc35 [template = i32] -// CHECK:STDOUT: %.loc35_23.2: type = converted %int.make_type_32.loc35, %.loc35_23.1 [template = i32] +// CHECK:STDOUT: %.loc35_42.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc35_42.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc35_42.3: = bound_method %.loc35_42.1, %.loc35_42.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc35_42.4: = specific_function %.loc35_42.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc35: init %i32 = call %.loc35_42.4(%.loc35_42.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc35_42.5: %i32 = value_of_initializer %int.convert_checked.loc35 [template = constants.%.26] +// CHECK:STDOUT: %.loc35_42.6: %i32 = converted %.loc35_42.1, %.loc35_42.5 [template = constants.%.26] +// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42.6) +// CHECK:STDOUT: %.loc35_23.2: type = value_of_initializer %int.make_type_signed.loc35 [template = constants.%i32] +// CHECK:STDOUT: %.loc35_23.3: type = converted %int.make_type_signed.loc35, %.loc35_23.2 [template = constants.%i32] // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var -// CHECK:STDOUT: %int.make_type_32.loc44: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc44_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc44: init type = call constants.%Int(%.loc44_16.1) [template = constants.%i32] // CHECK:STDOUT: %JustRight.ref: %JustRight.type = name_ref JustRight, %JustRight.decl [template = constants.%JustRight] -// CHECK:STDOUT: %.loc44_31: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc44_34: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc44_16.1: type = value_of_initializer %int.make_type_32.loc44 [template = i32] -// CHECK:STDOUT: %.loc44_16.2: type = converted %int.make_type_32.loc44, %.loc44_16.1 [template = i32] -// CHECK:STDOUT: %.loc44_36: type = array_type , i32 [template = ] +// CHECK:STDOUT: %.loc44_31: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc44_34: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc44_16.2: type = value_of_initializer %int.make_type_signed.loc44 [template = constants.%i32] +// CHECK:STDOUT: %.loc44_16.3: type = converted %int.make_type_signed.loc44, %.loc44_16.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc44_36: type = array_type , %i32 [template = ] // CHECK:STDOUT: %bad_call.var: ref = var bad_call // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc46_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc46_25.1: type = value_of_initializer %int.make_type_32.loc46_25 [template = i32] -// CHECK:STDOUT: %.loc46_25.2: type = converted %int.make_type_32.loc46_25, %.loc46_25.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc46_33: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc46_33.1: type = value_of_initializer %int.make_type_32.loc46_33 [template = i32] -// CHECK:STDOUT: %.loc46_33.2: type = converted %int.make_type_32.loc46_33, %.loc46_33.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc46_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc46_25: init type = call constants.%Int(%.loc46_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc46_25.2: type = value_of_initializer %int.make_type_signed.loc46_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc46_25.3: type = converted %int.make_type_signed.loc46_25, %.loc46_25.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc46_33.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc46_33: init type = call constants.%Int(%.loc46_33.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc46_33.2: type = value_of_initializer %int.make_type_signed.loc46_33 [template = constants.%i32] +// CHECK:STDOUT: %.loc46_33.3: type = converted %int.make_type_signed.loc46_33, %.loc46_33.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %c.patt: i32 = binding_pattern c -// CHECK:STDOUT: %c.param_patt: i32 = value_param_pattern %c.patt, runtime_param2 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param3 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %c.patt: %i32 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %i32 = value_param_pattern %c.patt, runtime_param2 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc57_26: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc57_26.1: type = value_of_initializer %int.make_type_32.loc57_26 [template = i32] -// CHECK:STDOUT: %.loc57_26.2: type = converted %int.make_type_32.loc57_26, %.loc57_26.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc57_34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc57_34.1: type = value_of_initializer %int.make_type_32.loc57_34 [template = i32] -// CHECK:STDOUT: %.loc57_34.2: type = converted %int.make_type_32.loc57_34, %.loc57_34.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc57_42: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc57_42.1: type = value_of_initializer %int.make_type_32.loc57_42 [template = i32] -// CHECK:STDOUT: %.loc57_42.2: type = converted %int.make_type_32.loc57_42, %.loc57_42.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc57_50: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc57_50.1: type = value_of_initializer %int.make_type_32.loc57_50 [template = i32] -// CHECK:STDOUT: %.loc57_50.2: type = converted %int.make_type_32.loc57_50, %.loc57_50.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %c.param: i32 = value_param runtime_param2 -// CHECK:STDOUT: %c: i32 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param3 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc57_26.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc57_26: init type = call constants.%Int(%.loc57_26.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc57_26.2: type = value_of_initializer %int.make_type_signed.loc57_26 [template = constants.%i32] +// CHECK:STDOUT: %.loc57_26.3: type = converted %int.make_type_signed.loc57_26, %.loc57_26.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc57_34.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc57_34: init type = call constants.%Int(%.loc57_34.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc57_34.2: type = value_of_initializer %int.make_type_signed.loc57_34 [template = constants.%i32] +// CHECK:STDOUT: %.loc57_34.3: type = converted %int.make_type_signed.loc57_34, %.loc57_34.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc57_42.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc57_42: init type = call constants.%Int(%.loc57_42.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc57_42.2: type = value_of_initializer %int.make_type_signed.loc57_42 [template = constants.%i32] +// CHECK:STDOUT: %.loc57_42.3: type = converted %int.make_type_signed.loc57_42, %.loc57_42.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc57_50.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc57_50: init type = call constants.%Int(%.loc57_50.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc57_50.2: type = value_of_initializer %int.make_type_signed.loc57_50 [template = constants.%i32] +// CHECK:STDOUT: %.loc57_50.3: type = converted %int.make_type_signed.loc57_50, %.loc57_50.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %c.param: %i32 = value_param runtime_param2 +// CHECK:STDOUT: %c: %i32 = bind_name c, %c.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc68_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc68_32.1: type = value_of_initializer %int.make_type_32.loc68_32 [template = i32] -// CHECK:STDOUT: %.loc68_32.2: type = converted %int.make_type_32.loc68_32, %.loc68_32.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc68_40: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc68_40.1: type = value_of_initializer %int.make_type_32.loc68_40 [template = i32] -// CHECK:STDOUT: %.loc68_40.2: type = converted %int.make_type_32.loc68_40, %.loc68_40.1 [template = i32] +// CHECK:STDOUT: %.loc68_32.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc68_32: init type = call constants.%Int(%.loc68_32.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc68_32.2: type = value_of_initializer %int.make_type_signed.loc68_32 [template = constants.%i32] +// CHECK:STDOUT: %.loc68_32.3: type = converted %int.make_type_signed.loc68_32, %.loc68_32.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc68_40.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc68_40: init type = call constants.%Int(%.loc68_40.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc68_40.2: type = value_of_initializer %int.make_type_signed.loc68_40 [template = constants.%i32] +// CHECK:STDOUT: %.loc68_40.3: type = converted %int.make_type_signed.loc68_40, %.loc68_40.2 [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc68_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc68_48.2: type = converted %bool.make_type, %.loc68_48.1 [template = bool] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooFew() -> i32; +// CHECK:STDOUT: fn @TooFew() -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TooMany(%a.param_patt: i32, %b.param_patt: i32) -> i32; +// CHECK:STDOUT: fn @TooMany(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: i32) -> bool; +// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: %i32) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @JustRight(%a.param_patt: i32) -> i32 = "int.unegate"; +// CHECK:STDOUT: fn @JustRight(%a.param_patt: %i32) -> %i32 = "int.unegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: i32, %b.param_patt: i32, %c.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: %i32, %b.param_patt: %i32, %c.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %c.ref: i32 = name_ref c, %c +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %c.ref: %i32 = name_ref c, %c // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: i32, %b.param_patt: i32) -> bool { +// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] // CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %.28: i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: i32 = int_value -2147483648 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.26: %i32 = int_value -2147483647 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: %i32 = int_value -2147483648 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -592,100 +638,110 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer %int.make_type_32.loc4_14 [template = i32] -// CHECK:STDOUT: %.loc4_14.2: type = converted %int.make_type_32.loc4_14, %.loc4_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_22.1: type = value_of_initializer %int.make_type_32.loc4_22 [template = i32] -// CHECK:STDOUT: %.loc4_22.2: type = converted %int.make_type_32.loc4_22, %.loc4_22.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_14: init type = call constants.%Int(%.loc4_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_14.2: type = value_of_initializer %int.make_type_signed.loc4_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_14.3: type = converted %int.make_type_signed.loc4_14, %.loc4_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_22: init type = call constants.%Int(%.loc4_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_22.2: type = value_of_initializer %int.make_type_signed.loc4_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_22.3: type = converted %int.make_type_signed.loc4_22, %.loc4_22.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] -// CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_32.loc5_11, %.loc5_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_32.loc5_19 [template = i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_32.loc5_19, %.loc5_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_32.loc5_27 [template = i32] -// CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc5_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_11: init type = call constants.%Int(%.loc5_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_11.2: type = value_of_initializer %int.make_type_signed.loc5_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_11.3: type = converted %int.make_type_signed.loc5_11, %.loc5_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_19: init type = call constants.%Int(%.loc5_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.2: type = value_of_initializer %int.make_type_signed.loc5_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.3: type = converted %int.make_type_signed.loc5_19, %.loc5_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_27: init type = call constants.%Int(%.loc5_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.2: type = value_of_initializer %int.make_type_signed.loc5_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_27.3: type = converted %int.make_type_signed.loc5_27, %.loc5_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] -// CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_32.loc8, %.loc8_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_32.loc11, %.loc11_8.1 [template = i32] +// CHECK:STDOUT: %.loc8_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8.3: type = converted %int.make_type_signed.loc8, %.loc8_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_8.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_8.3: type = converted %int.make_type_signed.loc11, %.loc11_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: i32) -> i32 = "int.unegate"; +// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.unegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.usub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Negate.ref.loc8_14: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %Negate.ref.loc8_21: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc8_28.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc8_28.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_28.3: = bound_method %.loc8_28.1, %.loc8_28.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc8: init i32 = call %.loc8_28.3(%.loc8_28.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc8_28.4: i32 = value_of_initializer %int.convert_checked.loc8 [template = constants.%.27] -// CHECK:STDOUT: %.loc8_28.5: i32 = converted %.loc8_28.1, %.loc8_28.4 [template = constants.%.27] -// CHECK:STDOUT: %int.unegate.loc8_27: init i32 = call %Negate.ref.loc8_21(%.loc8_28.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc8_27.1: i32 = value_of_initializer %int.unegate.loc8_27 [template = constants.%.28] -// CHECK:STDOUT: %.loc8_27.2: i32 = converted %int.unegate.loc8_27, %.loc8_27.1 [template = constants.%.28] -// CHECK:STDOUT: %int.unegate.loc8_20: init i32 = call %Negate.ref.loc8_14(%.loc8_27.2) [template = constants.%.27] -// CHECK:STDOUT: %.loc8_40.1: i32 = value_of_initializer %int.unegate.loc8_20 [template = constants.%.27] -// CHECK:STDOUT: %.loc8_40.2: i32 = converted %int.unegate.loc8_20, %.loc8_40.1 [template = constants.%.27] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc8_40.2 +// CHECK:STDOUT: %.loc8_28.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc8_28.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_28.3: = bound_method %.loc8_28.1, %.loc8_28.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc8_28.4: = specific_function %.loc8_28.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %.loc8_28.4(%.loc8_28.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc8_28.5: %i32 = value_of_initializer %int.convert_checked.loc8 [template = constants.%.25] +// CHECK:STDOUT: %.loc8_28.6: %i32 = converted %.loc8_28.1, %.loc8_28.5 [template = constants.%.25] +// CHECK:STDOUT: %int.unegate.loc8_27: init %i32 = call %Negate.ref.loc8_21(%.loc8_28.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %int.unegate.loc8_27 [template = constants.%.26] +// CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int.unegate.loc8_27, %.loc8_27.1 [template = constants.%.26] +// CHECK:STDOUT: %int.unegate.loc8_20: init %i32 = call %Negate.ref.loc8_14(%.loc8_27.2) [template = constants.%.25] +// CHECK:STDOUT: %.loc8_40.1: %i32 = value_of_initializer %int.unegate.loc8_20 [template = constants.%.25] +// CHECK:STDOUT: %.loc8_40.2: %i32 = converted %int.unegate.loc8_20, %.loc8_40.1 [template = constants.%.25] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc8_40.2 // CHECK:STDOUT: %Negate.ref.loc11_14: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc11_25: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc11_32.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_32.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_32.3: = bound_method %.loc11_32.1, %.loc11_32.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc11_32: init i32 = call %.loc11_32.3(%.loc11_32.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc11_32.4: i32 = value_of_initializer %int.convert_checked.loc11_32 [template = constants.%.27] -// CHECK:STDOUT: %.loc11_32.5: i32 = converted %.loc11_32.1, %.loc11_32.4 [template = constants.%.27] -// CHECK:STDOUT: %int.unegate.loc11_31: init i32 = call %Negate.ref.loc11_25(%.loc11_32.5) [template = constants.%.28] -// CHECK:STDOUT: %.loc11_45.1: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_31.1: i32 = value_of_initializer %int.unegate.loc11_31 [template = constants.%.28] -// CHECK:STDOUT: %.loc11_31.2: i32 = converted %int.unegate.loc11_31, %.loc11_31.1 [template = constants.%.28] -// CHECK:STDOUT: %.loc11_45.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_45.3: = bound_method %.loc11_45.1, %.loc11_45.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_45: init i32 = call %.loc11_45.3(%.loc11_45.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_45.4: i32 = value_of_initializer %int.convert_checked.loc11_45 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_45.5: i32 = converted %.loc11_45.1, %.loc11_45.4 [template = constants.%.31] -// CHECK:STDOUT: %int.usub: init i32 = call %Sub.ref(%.loc11_31.2, %.loc11_45.5) [template = constants.%.32] -// CHECK:STDOUT: %.loc11_24.1: i32 = value_of_initializer %int.usub [template = constants.%.32] -// CHECK:STDOUT: %.loc11_24.2: i32 = converted %int.usub, %.loc11_24.1 [template = constants.%.32] -// CHECK:STDOUT: %int.unegate.loc11_20: init i32 = call %Negate.ref.loc11_14(%.loc11_24.2) [template = constants.%.32] -// CHECK:STDOUT: %.loc11_48.1: i32 = value_of_initializer %int.unegate.loc11_20 [template = constants.%.32] -// CHECK:STDOUT: %.loc11_48.2: i32 = converted %int.unegate.loc11_20, %.loc11_48.1 [template = constants.%.32] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc11_48.2 +// CHECK:STDOUT: %.loc11_32.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_32.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_32.3: = bound_method %.loc11_32.1, %.loc11_32.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc11_32.4: = specific_function %.loc11_32.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc11_32: init %i32 = call %.loc11_32.4(%.loc11_32.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc11_32.5: %i32 = value_of_initializer %int.convert_checked.loc11_32 [template = constants.%.25] +// CHECK:STDOUT: %.loc11_32.6: %i32 = converted %.loc11_32.1, %.loc11_32.5 [template = constants.%.25] +// CHECK:STDOUT: %int.unegate.loc11_31: init %i32 = call %Negate.ref.loc11_25(%.loc11_32.6) [template = constants.%.26] +// CHECK:STDOUT: %.loc11_45.1: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_31.1: %i32 = value_of_initializer %int.unegate.loc11_31 [template = constants.%.26] +// CHECK:STDOUT: %.loc11_31.2: %i32 = converted %int.unegate.loc11_31, %.loc11_31.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc11_45.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_45.3: = bound_method %.loc11_45.1, %.loc11_45.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_45.4: = specific_function %.loc11_45.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc11_45: init %i32 = call %.loc11_45.4(%.loc11_45.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc11_45.5: %i32 = value_of_initializer %int.convert_checked.loc11_45 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_45.6: %i32 = converted %.loc11_45.1, %.loc11_45.5 [template = constants.%.30] +// CHECK:STDOUT: %int.usub: init %i32 = call %Sub.ref(%.loc11_31.2, %.loc11_45.6) [template = constants.%.31] +// CHECK:STDOUT: %.loc11_24.1: %i32 = value_of_initializer %int.usub [template = constants.%.31] +// CHECK:STDOUT: %.loc11_24.2: %i32 = converted %int.usub, %.loc11_24.1 [template = constants.%.31] +// CHECK:STDOUT: %int.unegate.loc11_20: init %i32 = call %Negate.ref.loc11_14(%.loc11_24.2) [template = constants.%.31] +// CHECK:STDOUT: %.loc11_48.1: %i32 = value_of_initializer %int.unegate.loc11_20 [template = constants.%.31] +// CHECK:STDOUT: %.loc11_48.2: %i32 = converted %int.unegate.loc11_20, %.loc11_48.1 [template = constants.%.31] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc11_48.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/usub.carbon b/toolchain/check/testdata/builtins/int/usub.carbon index 6abef0a0da30..2a03481636b8 100644 --- a/toolchain/check/testdata/builtins/int/usub.carbon +++ b/toolchain/check/testdata/builtins/int/usub.carbon @@ -32,28 +32,33 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: --- int_sub.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] // CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 3 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 3 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.16 [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.15 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.4(%.1) [template] // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.35: type = array_type %.34, i32 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, %i32 [template] // CHECK:STDOUT: %.36: type = ptr_type %.35 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] @@ -61,7 +66,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -78,98 +83,109 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%.loc2_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.3: type = converted %int.make_type_signed.loc2_11, %.loc2_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%.loc2_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.3: type = converted %int.make_type_signed.loc2_19, %.loc2_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%.loc2_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.2: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.3: type = converted %int.make_type_signed.loc2_27, %.loc2_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, %Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init i32 = call %.loc4_20.3(%.loc4_20.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.4: i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.5: i32 = converted %.loc4_20.1, %.loc4_20.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init i32 = call %.loc4_23.3(%.loc4_23.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.4: i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_23.5: i32 = converted %.loc4_23.1, %.loc4_23.4 [template = constants.%.30] -// CHECK:STDOUT: %int.usub: init i32 = call %Sub.ref(%.loc4_20.5, %.loc4_23.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_19.1: %Convert.type.5 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.usub, %.loc4_19.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.usub [template = constants.%.31] -// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.usub, %.loc4_19.3 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.usub, %.loc4_19.5 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.6, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_20.4: = specific_function %.loc4_20.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %.loc4_20.4(%.loc4_20.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.5: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.6: %i32 = converted %.loc4_20.1, %.loc4_20.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_23.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_23.3: = bound_method %.loc4_23.1, %.loc4_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_23.4: = specific_function %.loc4_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %.loc4_23.4(%.loc4_23.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.5: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_23.6: %i32 = converted %.loc4_23.1, %.loc4_23.5 [template = constants.%.29] +// CHECK:STDOUT: %int.usub: init %i32 = call %Sub.ref(%.loc4_20.6, %.loc4_23.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.6 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.usub, %.loc4_19.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc4_19.3: = specific_function %.loc4_19.2, @Convert.4(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc4_19.4: %i32 = value_of_initializer %int.usub [template = constants.%.30] +// CHECK:STDOUT: %.loc4_19.5: %i32 = converted %int.usub, %.loc4_19.4 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.3(%.loc4_19.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.7: Core.IntLiteral = converted %int.usub, %.loc4_19.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_25: type = array_type %.loc4_19.7, %i32 [template = constants.%.35] // CHECK:STDOUT: %arr.var: ref %.35 = var arr // CHECK:STDOUT: %arr: ref %.35 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_13.1) [template = constants.%i32] // CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 1 [template = constants.%.34] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_13.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_13.3: type = converted %int.make_type_signed.loc5, %.loc5_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, %i32 [template = constants.%.35] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.35 [template = constants.%.36] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.3: type = converted %int.make_type_signed.loc7_19, %.loc7_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%.loc7_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.3: type = converted %int.make_type_signed.loc7_27, %.loc7_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%.loc7_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.3: type = converted %int.make_type_signed.loc7_35, %.loc7_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.usub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %int.usub: init i32 = call %Sub.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: i32 = value_of_initializer %int.usub -// CHECK:STDOUT: %.loc8_19.2: i32 = converted %int.usub, %.loc8_19.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %int.usub: init %i32 = call %Sub.ref(%a.ref, %b.ref) +// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.usub +// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.usub, %.loc8_19.1 // CHECK:STDOUT: return %.loc8_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -184,33 +200,39 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: --- overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] // CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 0 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %.31: i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 1 [template] -// CHECK:STDOUT: %.35: i32 = int_value -2147483648 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.30: %i32 = int_value -2147483647 [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.32: = bound_method %.31, %Convert.14 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.35: %i32 = int_value -2147483648 [template] // CHECK:STDOUT: %.36: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.37: = bound_method %.36, %Convert.15 [template] -// CHECK:STDOUT: %.38: i32 = int_value 2 [template] +// CHECK:STDOUT: %.37: = bound_method %.36, %Convert.14 [template] +// CHECK:STDOUT: %.38: = specific_function %.37, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.39: %i32 = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -227,115 +249,129 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_32.loc4_19 [template = i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_32.loc4_19, %.loc4_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32.loc4_27 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4_11, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%.loc4_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.3: type = converted %int.make_type_signed.loc4_19, %.loc4_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed.loc4_27, %.loc4_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] -// CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_32.loc8, %.loc8_8.1 [template = i32] +// CHECK:STDOUT: %.loc6_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.3: type = converted %int.make_type_signed.loc6, %.loc6_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%.loc7_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.2: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.3: type = converted %int.make_type_signed.loc7, %.loc7_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8.3: type = converted %int.make_type_signed.loc8, %.loc8_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.usub"; +// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Sub.ref.loc6: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %.loc6_18.1: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc6_21.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] -// CHECK:STDOUT: %.loc6_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_18.3: = bound_method %.loc6_18.1, %.loc6_18.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc6_18: init i32 = call %.loc6_18.3(%.loc6_18.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc6_18.4: i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_18.5: i32 = converted %.loc6_18.1, %.loc6_18.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_21.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_21.3: = bound_method %.loc6_21.1, %.loc6_21.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc6_21: init i32 = call %.loc6_21.3(%.loc6_21.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc6_21.4: i32 = value_of_initializer %int.convert_checked.loc6_21 [template = constants.%.30] -// CHECK:STDOUT: %.loc6_21.5: i32 = converted %.loc6_21.1, %.loc6_21.4 [template = constants.%.30] -// CHECK:STDOUT: %int.usub.loc6: init i32 = call %Sub.ref.loc6(%.loc6_18.5, %.loc6_21.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc6_32.1: i32 = value_of_initializer %int.usub.loc6 [template = constants.%.31] -// CHECK:STDOUT: %.loc6_32.2: i32 = converted %int.usub.loc6, %.loc6_32.1 [template = constants.%.31] -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc6_32.2 +// CHECK:STDOUT: %.loc6_18.1: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc6_21.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.3] +// CHECK:STDOUT: %.loc6_18.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_18.3: = bound_method %.loc6_18.1, %.loc6_18.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc6_18.4: = specific_function %.loc6_18.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %.loc6_18.4(%.loc6_18.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc6_18.5: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%.26] +// CHECK:STDOUT: %.loc6_18.6: %i32 = converted %.loc6_18.1, %.loc6_18.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc6_21.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_21.3: = bound_method %.loc6_21.1, %.loc6_21.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc6_21.4: = specific_function %.loc6_21.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc6_21: init %i32 = call %.loc6_21.4(%.loc6_21.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc6_21.5: %i32 = value_of_initializer %int.convert_checked.loc6_21 [template = constants.%.29] +// CHECK:STDOUT: %.loc6_21.6: %i32 = converted %.loc6_21.1, %.loc6_21.5 [template = constants.%.29] +// CHECK:STDOUT: %int.usub.loc6: init %i32 = call %Sub.ref.loc6(%.loc6_18.6, %.loc6_21.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc6_32.1: %i32 = value_of_initializer %int.usub.loc6 [template = constants.%.30] +// CHECK:STDOUT: %.loc6_32.2: %i32 = converted %int.usub.loc6, %.loc6_32.1 [template = constants.%.30] +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc6_32.2 // CHECK:STDOUT: %Sub.ref.loc7_14: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Sub.ref.loc7_18: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %.loc7_22.1: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc7_25.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] -// CHECK:STDOUT: %.loc7_22.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_22.3: = bound_method %.loc7_22.1, %.loc7_22.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc7_22: init i32 = call %.loc7_22.3(%.loc7_22.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc7_22.4: i32 = value_of_initializer %int.convert_checked.loc7_22 [template = constants.%.28] -// CHECK:STDOUT: %.loc7_22.5: i32 = converted %.loc7_22.1, %.loc7_22.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc7_25.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_25.3: = bound_method %.loc7_25.1, %.loc7_25.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc7_25: init i32 = call %.loc7_25.3(%.loc7_25.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc7_25.4: i32 = value_of_initializer %int.convert_checked.loc7_25 [template = constants.%.30] -// CHECK:STDOUT: %.loc7_25.5: i32 = converted %.loc7_25.1, %.loc7_25.4 [template = constants.%.30] -// CHECK:STDOUT: %int.usub.loc7_21: init i32 = call %Sub.ref.loc7_18(%.loc7_22.5, %.loc7_25.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc7_38.1: Core.IntLiteral = int_value 1 [template = constants.%.32] -// CHECK:STDOUT: %.loc7_21.1: i32 = value_of_initializer %int.usub.loc7_21 [template = constants.%.31] -// CHECK:STDOUT: %.loc7_21.2: i32 = converted %int.usub.loc7_21, %.loc7_21.1 [template = constants.%.31] -// CHECK:STDOUT: %.loc7_38.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_38.3: = bound_method %.loc7_38.1, %.loc7_38.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc7_38: init i32 = call %.loc7_38.3(%.loc7_38.1) [template = constants.%.34] -// CHECK:STDOUT: %.loc7_38.4: i32 = value_of_initializer %int.convert_checked.loc7_38 [template = constants.%.34] -// CHECK:STDOUT: %.loc7_38.5: i32 = converted %.loc7_38.1, %.loc7_38.4 [template = constants.%.34] -// CHECK:STDOUT: %int.usub.loc7_17: init i32 = call %Sub.ref.loc7_14(%.loc7_21.2, %.loc7_38.5) [template = constants.%.35] -// CHECK:STDOUT: %.loc7_40.1: i32 = value_of_initializer %int.usub.loc7_17 [template = constants.%.35] -// CHECK:STDOUT: %.loc7_40.2: i32 = converted %int.usub.loc7_17, %.loc7_40.1 [template = constants.%.35] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc7_40.2 +// CHECK:STDOUT: %.loc7_22.1: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc7_25.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.3] +// CHECK:STDOUT: %.loc7_22.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_22.3: = bound_method %.loc7_22.1, %.loc7_22.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc7_22.4: = specific_function %.loc7_22.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc7_22: init %i32 = call %.loc7_22.4(%.loc7_22.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc7_22.5: %i32 = value_of_initializer %int.convert_checked.loc7_22 [template = constants.%.26] +// CHECK:STDOUT: %.loc7_22.6: %i32 = converted %.loc7_22.1, %.loc7_22.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc7_25.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_25.3: = bound_method %.loc7_25.1, %.loc7_25.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc7_25.4: = specific_function %.loc7_25.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc7_25: init %i32 = call %.loc7_25.4(%.loc7_25.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc7_25.5: %i32 = value_of_initializer %int.convert_checked.loc7_25 [template = constants.%.29] +// CHECK:STDOUT: %.loc7_25.6: %i32 = converted %.loc7_25.1, %.loc7_25.5 [template = constants.%.29] +// CHECK:STDOUT: %int.usub.loc7_21: init %i32 = call %Sub.ref.loc7_18(%.loc7_22.6, %.loc7_25.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc7_38.1: Core.IntLiteral = int_value 1 [template = constants.%.31] +// CHECK:STDOUT: %.loc7_21.1: %i32 = value_of_initializer %int.usub.loc7_21 [template = constants.%.30] +// CHECK:STDOUT: %.loc7_21.2: %i32 = converted %int.usub.loc7_21, %.loc7_21.1 [template = constants.%.30] +// CHECK:STDOUT: %.loc7_38.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_38.3: = bound_method %.loc7_38.1, %.loc7_38.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc7_38.4: = specific_function %.loc7_38.3, @Convert.2(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc7_38: init %i32 = call %.loc7_38.4(%.loc7_38.1) [template = constants.%.34] +// CHECK:STDOUT: %.loc7_38.5: %i32 = value_of_initializer %int.convert_checked.loc7_38 [template = constants.%.34] +// CHECK:STDOUT: %.loc7_38.6: %i32 = converted %.loc7_38.1, %.loc7_38.5 [template = constants.%.34] +// CHECK:STDOUT: %int.usub.loc7_17: init %i32 = call %Sub.ref.loc7_14(%.loc7_21.2, %.loc7_38.6) [template = constants.%.35] +// CHECK:STDOUT: %.loc7_40.1: %i32 = value_of_initializer %int.usub.loc7_17 [template = constants.%.35] +// CHECK:STDOUT: %.loc7_40.2: %i32 = converted %int.usub.loc7_17, %.loc7_40.1 [template = constants.%.35] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc7_40.2 // CHECK:STDOUT: %Sub.ref.loc8_14: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Sub.ref.loc8_18: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %.loc8_22.1: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc8_25.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.2] -// CHECK:STDOUT: %.loc8_22.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_22.3: = bound_method %.loc8_22.1, %.loc8_22.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc8_22: init i32 = call %.loc8_22.3(%.loc8_22.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc8_22.4: i32 = value_of_initializer %int.convert_checked.loc8_22 [template = constants.%.28] -// CHECK:STDOUT: %.loc8_22.5: i32 = converted %.loc8_22.1, %.loc8_22.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc8_25.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_25.3: = bound_method %.loc8_25.1, %.loc8_25.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc8_25: init i32 = call %.loc8_25.3(%.loc8_25.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc8_25.4: i32 = value_of_initializer %int.convert_checked.loc8_25 [template = constants.%.30] -// CHECK:STDOUT: %.loc8_25.5: i32 = converted %.loc8_25.1, %.loc8_25.4 [template = constants.%.30] -// CHECK:STDOUT: %int.usub.loc8_21: init i32 = call %Sub.ref.loc8_18(%.loc8_22.5, %.loc8_25.5) [template = constants.%.31] +// CHECK:STDOUT: %.loc8_22.1: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc8_25.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.3] +// CHECK:STDOUT: %.loc8_22.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_22.3: = bound_method %.loc8_22.1, %.loc8_22.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc8_22.4: = specific_function %.loc8_22.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc8_22: init %i32 = call %.loc8_22.4(%.loc8_22.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc8_22.5: %i32 = value_of_initializer %int.convert_checked.loc8_22 [template = constants.%.26] +// CHECK:STDOUT: %.loc8_22.6: %i32 = converted %.loc8_22.1, %.loc8_22.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc8_25.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_25.3: = bound_method %.loc8_25.1, %.loc8_25.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc8_25.4: = specific_function %.loc8_25.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc8_25: init %i32 = call %.loc8_25.4(%.loc8_25.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc8_25.5: %i32 = value_of_initializer %int.convert_checked.loc8_25 [template = constants.%.29] +// CHECK:STDOUT: %.loc8_25.6: %i32 = converted %.loc8_25.1, %.loc8_25.5 [template = constants.%.29] +// CHECK:STDOUT: %int.usub.loc8_21: init %i32 = call %Sub.ref.loc8_18(%.loc8_22.6, %.loc8_25.6) [template = constants.%.30] // CHECK:STDOUT: %.loc8_38.1: Core.IntLiteral = int_value 2 [template = constants.%.36] -// CHECK:STDOUT: %.loc8_21.1: i32 = value_of_initializer %int.usub.loc8_21 [template = constants.%.31] -// CHECK:STDOUT: %.loc8_21.2: i32 = converted %int.usub.loc8_21, %.loc8_21.1 [template = constants.%.31] -// CHECK:STDOUT: %.loc8_38.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc8_21.1: %i32 = value_of_initializer %int.usub.loc8_21 [template = constants.%.30] +// CHECK:STDOUT: %.loc8_21.2: %i32 = converted %int.usub.loc8_21, %.loc8_21.1 [template = constants.%.30] +// CHECK:STDOUT: %.loc8_38.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] // CHECK:STDOUT: %.loc8_38.3: = bound_method %.loc8_38.1, %.loc8_38.2 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc8_38: init i32 = call %.loc8_38.3(%.loc8_38.1) [template = constants.%.38] -// CHECK:STDOUT: %.loc8_38.4: i32 = value_of_initializer %int.convert_checked.loc8_38 [template = constants.%.38] -// CHECK:STDOUT: %.loc8_38.5: i32 = converted %.loc8_38.1, %.loc8_38.4 [template = constants.%.38] -// CHECK:STDOUT: %int.usub.loc8_17: init i32 = call %Sub.ref.loc8_14(%.loc8_21.2, %.loc8_38.5) [template = constants.%.30] -// CHECK:STDOUT: %.loc8_40.1: i32 = value_of_initializer %int.usub.loc8_17 [template = constants.%.30] -// CHECK:STDOUT: %.loc8_40.2: i32 = converted %int.usub.loc8_17, %.loc8_40.1 [template = constants.%.30] -// CHECK:STDOUT: %c: i32 = bind_name c, %.loc8_40.2 +// CHECK:STDOUT: %.loc8_38.4: = specific_function %.loc8_38.3, @Convert.2(constants.%.1) [template = constants.%.38] +// CHECK:STDOUT: %int.convert_checked.loc8_38: init %i32 = call %.loc8_38.4(%.loc8_38.1) [template = constants.%.39] +// CHECK:STDOUT: %.loc8_38.5: %i32 = value_of_initializer %int.convert_checked.loc8_38 [template = constants.%.39] +// CHECK:STDOUT: %.loc8_38.6: %i32 = converted %.loc8_38.1, %.loc8_38.5 [template = constants.%.39] +// CHECK:STDOUT: %int.usub.loc8_17: init %i32 = call %Sub.ref.loc8_14(%.loc8_21.2, %.loc8_38.6) [template = constants.%.29] +// CHECK:STDOUT: %.loc8_40.1: %i32 = value_of_initializer %int.usub.loc8_17 [template = constants.%.29] +// CHECK:STDOUT: %.loc8_40.2: %i32 = converted %int.usub.loc8_17, %.loc8_40.1 [template = constants.%.29] +// CHECK:STDOUT: %c: %i32 = bind_name c, %.loc8_40.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/xor.carbon b/toolchain/check/testdata/builtins/int/xor.carbon index 0803ec32e40e..85c9f139c72a 100644 --- a/toolchain/check/testdata/builtins/int/xor.carbon +++ b/toolchain/check/testdata/builtins/int/xor.carbon @@ -22,28 +22,33 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: --- int_xor.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Xor.type: type = fn_type @Xor [template] // CHECK:STDOUT: %Xor: %Xor.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 10 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 10 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 12 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 10 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 6 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 12 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 10 [template] -// CHECK:STDOUT: %.31: i32 = int_value 6 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.16 [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.15 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.4(%.1) [template] // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 6 [template] -// CHECK:STDOUT: %.35: type = array_type %.34, i32 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, %i32 [template] // CHECK:STDOUT: %.36: type = ptr_type %.35 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] @@ -51,7 +56,7 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -68,98 +73,109 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Xor.decl: %Xor.type = fn_decl @Xor [template = constants.%Xor] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_32.loc2_11, %.loc2_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_32.loc2_19 [template = i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_32.loc2_19, %.loc2_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc2_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_32.loc2_27 [template = i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc2_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%.loc2_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.2: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_11.3: type = converted %int.make_type_signed.loc2_11, %.loc2_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%.loc2_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.2: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_19.3: type = converted %int.make_type_signed.loc2_19, %.loc2_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%.loc2_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.2: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc2_27.3: type = converted %int.make_type_signed.loc2_27, %.loc2_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %Xor.ref: %Xor.type = name_ref Xor, %Xor.decl [template = constants.%Xor] -// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 12 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_24.1: Core.IntLiteral = int_value 10 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init i32 = call %.loc4_20.3(%.loc4_20.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.4: i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_20.5: i32 = converted %.loc4_20.1, %.loc4_20.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc4_24.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_24.3: = bound_method %.loc4_24.1, %.loc4_24.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc4_24: init i32 = call %.loc4_24.3(%.loc4_24.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc4_24.4: i32 = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_24.5: i32 = converted %.loc4_24.1, %.loc4_24.4 [template = constants.%.30] -// CHECK:STDOUT: %int.xor: init i32 = call %Xor.ref(%.loc4_20.5, %.loc4_24.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_19.1: %Convert.type.5 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.xor, %.loc4_19.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.xor [template = constants.%.31] -// CHECK:STDOUT: %.loc4_19.4: i32 = converted %int.xor, %.loc4_19.3 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.2(%.loc4_19.4) [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = converted %int.xor, %.loc4_19.5 [template = constants.%.34] -// CHECK:STDOUT: %.loc4_27: type = array_type %.loc4_19.6, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc4_20.1: Core.IntLiteral = int_value 12 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_24.1: Core.IntLiteral = int_value 10 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_20.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_20.3: = bound_method %.loc4_20.1, %.loc4_20.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_20.4: = specific_function %.loc4_20.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %.loc4_20.4(%.loc4_20.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.5: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_20.6: %i32 = converted %.loc4_20.1, %.loc4_20.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc4_24.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_24.3: = bound_method %.loc4_24.1, %.loc4_24.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_24.4: = specific_function %.loc4_24.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc4_24: init %i32 = call %.loc4_24.4(%.loc4_24.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc4_24.5: %i32 = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%.29] +// CHECK:STDOUT: %.loc4_24.6: %i32 = converted %.loc4_24.1, %.loc4_24.5 [template = constants.%.29] +// CHECK:STDOUT: %int.xor: init %i32 = call %Xor.ref(%.loc4_20.6, %.loc4_24.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.6 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %int.xor, %.loc4_19.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc4_19.3: = specific_function %.loc4_19.2, @Convert.4(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc4_19.4: %i32 = value_of_initializer %int.xor [template = constants.%.30] +// CHECK:STDOUT: %.loc4_19.5: %i32 = converted %int.xor, %.loc4_19.4 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc4_19: init Core.IntLiteral = call %.loc4_19.3(%.loc4_19.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_19.7: Core.IntLiteral = converted %int.xor, %.loc4_19.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_27: type = array_type %.loc4_19.7, %i32 [template = constants.%.35] // CHECK:STDOUT: %arr.var: ref %.35 = var arr // CHECK:STDOUT: %arr: ref %.35 = bind_name arr, %arr.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_13.1) [template = constants.%i32] // CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 6 [template = constants.%.34] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_13.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_13.3: type = converted %int.make_type_signed.loc5, %.loc5_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, %i32 [template = constants.%.35] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.35 [template = constants.%.36] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_32.loc7_35 [template = i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_32.loc7_35, %.loc7_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19.3: type = converted %int.make_type_signed.loc7_19, %.loc7_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%.loc7_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.3: type = converted %int.make_type_signed.loc7_27, %.loc7_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%.loc7_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.2: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_35.3: type = converted %int.make_type_signed.loc7_35, %.loc7_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Xor(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.xor"; +// CHECK:STDOUT: fn @Xor(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.xor"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: i32, %b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Xor.ref: %Xor.type = name_ref Xor, file.%Xor.decl [template = constants.%Xor] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b -// CHECK:STDOUT: %int.xor: init i32 = call %Xor.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: i32 = value_of_initializer %int.xor -// CHECK:STDOUT: %.loc8_19.2: i32 = converted %int.xor, %.loc8_19.1 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %int.xor: init %i32 = call %Xor.ref(%a.ref, %b.ref) +// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.xor +// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.xor, %.loc8_19.1 // CHECK:STDOUT: return %.loc8_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/print.carbon b/toolchain/check/testdata/builtins/print.carbon index 0592defe4f3a..5f31ed2ec1b0 100644 --- a/toolchain/check/testdata/builtins/print.carbon +++ b/toolchain/check/testdata/builtins/print.carbon @@ -19,36 +19,40 @@ fn Main() { // CHECK:STDOUT: --- print.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Print.type.1: type = fn_type @Print.1 [template] // CHECK:STDOUT: %Print.1: %Print.type.1 = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] // CHECK:STDOUT: %Print.type.2: type = fn_type @Print.2 [template] // CHECK:STDOUT: %Print.2: %Print.type.2 = struct_value () [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.27: = bound_method %.26, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Print = %import_ref.51 +// CHECK:STDOUT: .Print = %import_ref.38 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.51: %Print.type.2 = import_ref Core//prelude, inst+51, loaded [template = constants.%Print.2] +// CHECK:STDOUT: %import_ref.38: %Print.type.2 = import_ref Core//prelude, inst+57, loaded [template = constants.%Print.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -59,39 +63,42 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Print.decl: %Print.type.1 = fn_decl @Print.1 [template = constants.%Print.1] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32, %.loc11_13.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %.loc11_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.3: type = converted %int.make_type_signed, %.loc11_13.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Print.1(%a.param_patt: i32) = "print.int"; +// CHECK:STDOUT: fn @Print.1(%a.param_patt: %i32) = "print.int"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Print.ref.loc14: %Print.type.1 = name_ref Print, file.%Print.decl [template = constants.%Print.1] -// CHECK:STDOUT: %.loc14_9.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc14_9.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_9.3: = bound_method %.loc14_9.1, %.loc14_9.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc14: init i32 = call %.loc14_9.3(%.loc14_9.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc14_9.4: i32 = value_of_initializer %int.convert_checked.loc14 [template = constants.%.27] -// CHECK:STDOUT: %.loc14_9.5: i32 = converted %.loc14_9.1, %.loc14_9.4 [template = constants.%.27] -// CHECK:STDOUT: %print.int.loc14: init %empty_tuple.type = call %Print.ref.loc14(%.loc14_9.5) +// CHECK:STDOUT: %.loc14_9.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_9.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_9.3: = bound_method %.loc14_9.1, %.loc14_9.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc14_9.4: = specific_function %.loc14_9.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %.loc14_9.4(%.loc14_9.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc14_9.5: %i32 = value_of_initializer %int.convert_checked.loc14 [template = constants.%.25] +// CHECK:STDOUT: %.loc14_9.6: %i32 = converted %.loc14_9.1, %.loc14_9.5 [template = constants.%.25] +// CHECK:STDOUT: %print.int.loc14: init %empty_tuple.type = call %Print.ref.loc14(%.loc14_9.6) // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Print.ref.loc16: %Print.type.2 = name_ref Print, imports.%import_ref.51 [template = constants.%Print.2] -// CHECK:STDOUT: %.loc16_14.1: Core.IntLiteral = int_value 2 [template = constants.%.28] -// CHECK:STDOUT: %.loc16_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_14.3: = bound_method %.loc16_14.1, %.loc16_14.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc16: init i32 = call %.loc16_14.3(%.loc16_14.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc16_14.4: i32 = value_of_initializer %int.convert_checked.loc16 [template = constants.%.30] -// CHECK:STDOUT: %.loc16_14.5: i32 = converted %.loc16_14.1, %.loc16_14.4 [template = constants.%.30] -// CHECK:STDOUT: %print.int.loc16: init %empty_tuple.type = call %Print.ref.loc16(%.loc16_14.5) +// CHECK:STDOUT: %Print.ref.loc16: %Print.type.2 = name_ref Print, imports.%import_ref.38 [template = constants.%Print.2] +// CHECK:STDOUT: %.loc16_14.1: Core.IntLiteral = int_value 2 [template = constants.%.26] +// CHECK:STDOUT: %.loc16_14.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc16_14.3: = bound_method %.loc16_14.1, %.loc16_14.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc16_14.4: = specific_function %.loc16_14.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %.loc16_14.4(%.loc16_14.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc16_14.5: %i32 = value_of_initializer %int.convert_checked.loc16 [template = constants.%.29] +// CHECK:STDOUT: %.loc16_14.6: %i32 = converted %.loc16_14.1, %.loc16_14.5 [template = constants.%.29] +// CHECK:STDOUT: %print.int.loc16: init %empty_tuple.type = call %Print.ref.loc16(%.loc16_14.6) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index e86a1443dd29..1a5060d280af 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -149,34 +149,38 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Circle: type = class_type @Circle [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Circle, i32 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 5 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Circle, %i32 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 5 [template] // CHECK:STDOUT: %SomeInternalFunction.type: type = fn_type @SomeInternalFunction [template] // CHECK:STDOUT: %SomeInternalFunction: %SomeInternalFunction.type = struct_value () [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] -// CHECK:STDOUT: %.29: type = struct_type {.radius: i32} [template] -// CHECK:STDOUT: %.30: = complete_type_witness %.29 [template] -// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.32: = bound_method %.31, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 0 [template] -// CHECK:STDOUT: %.35: type = struct_type {.radius: Core.IntLiteral} [template] -// CHECK:STDOUT: %struct: %Circle = struct_value (%.28) [template] +// CHECK:STDOUT: %.27: type = struct_type {.radius: %i32} [template] +// CHECK:STDOUT: %.28: = complete_type_witness %.27 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.34: type = struct_type {.radius: Core.IntLiteral} [template] +// CHECK:STDOUT: %struct: %Circle = struct_value (%.26) [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -195,29 +199,33 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Circle { -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_23.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_23.2: type = converted %int.make_type_32.loc5, %.loc5_23.1 [template = i32] -// CHECK:STDOUT: %.loc5_21: %.1 = field_decl radius, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_39.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_39.2: type = converted %int.make_type_32.loc6, %.loc6_39.1 [template = i32] -// CHECK:STDOUT: %.loc6_45: Core.IntLiteral = int_value 5 [template = constants.%.2] -// CHECK:STDOUT: %.loc6_46.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_46.2: = bound_method %.loc6_45, %.loc6_46.1 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc6_46.2(%.loc6_45) [template = constants.%.28] -// CHECK:STDOUT: %.loc6_46.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.28] -// CHECK:STDOUT: %.loc6_46.4: i32 = converted %.loc6_45, %.loc6_46.3 [template = constants.%.28] -// CHECK:STDOUT: %SOME_INTERNAL_CONSTANT: i32 = bind_name SOME_INTERNAL_CONSTANT, %.loc6_46.4 +// CHECK:STDOUT: %.loc5_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_23.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_23.3: type = converted %int.make_type_signed.loc5, %.loc5_23.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_21: %.2 = field_decl radius, element0 [template] +// CHECK:STDOUT: %.loc6_39.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_39.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_39.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_39.3: type = converted %int.make_type_signed.loc6, %.loc6_39.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_45: Core.IntLiteral = int_value 5 [template = constants.%.3] +// CHECK:STDOUT: %.loc6_46.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_46.2: = bound_method %.loc6_45, %.loc6_46.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc6_46.3: = specific_function %.loc6_46.2, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc6_46.3(%.loc6_45) [template = constants.%.26] +// CHECK:STDOUT: %.loc6_46.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.26] +// CHECK:STDOUT: %.loc6_46.5: %i32 = converted %.loc6_45, %.loc6_46.4 [template = constants.%.26] +// CHECK:STDOUT: %SOME_INTERNAL_CONSTANT: %i32 = bind_name SOME_INTERNAL_CONSTANT, %.loc6_46.5 // CHECK:STDOUT: %SomeInternalFunction.decl: %SomeInternalFunction.type = fn_decl @SomeInternalFunction [template = constants.%SomeInternalFunction] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_40.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_40.2: type = converted %int.make_type_32, %.loc8_40.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc8_40.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_40.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_40.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_40.3: type = converted %int.make_type_signed, %.loc8_40.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { // CHECK:STDOUT: %return.patt: %Circle = return_slot_pattern @@ -227,7 +235,7 @@ class A { // CHECK:STDOUT: %return.param: ref %Circle = out_param runtime_param0 // CHECK:STDOUT: %return: ref %Circle = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15: = complete_type_witness %.29 [template = constants.%.30] +// CHECK:STDOUT: %.loc15: = complete_type_witness %.27 [template = constants.%.28] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Circle @@ -237,29 +245,31 @@ class A { // CHECK:STDOUT: .Make = %Make.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SomeInternalFunction() -> i32 { +// CHECK:STDOUT: fn @SomeInternalFunction() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc9_12: Core.IntLiteral = int_value 0 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_13.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_13.2: = bound_method %.loc9_12, %.loc9_13.1 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc9_13.2(%.loc9_12) [template = constants.%.33] -// CHECK:STDOUT: %.loc9_13.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.33] -// CHECK:STDOUT: %.loc9_13.4: i32 = converted %.loc9_12, %.loc9_13.3 [template = constants.%.33] -// CHECK:STDOUT: return %.loc9_13.4 +// CHECK:STDOUT: %.loc9_12: Core.IntLiteral = int_value 0 [template = constants.%.29] +// CHECK:STDOUT: %.loc9_13.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_13.2: = bound_method %.loc9_12, %.loc9_13.1 [template = constants.%.30] +// CHECK:STDOUT: %.loc9_13.3: = specific_function %.loc9_13.2, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc9_13.3(%.loc9_12) [template = constants.%.32] +// CHECK:STDOUT: %.loc9_13.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.32] +// CHECK:STDOUT: %.loc9_13.5: %i32 = converted %.loc9_12, %.loc9_13.4 [template = constants.%.32] +// CHECK:STDOUT: return %.loc9_13.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Make() -> %return: %Circle { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc13_23: Core.IntLiteral = int_value 5 [template = constants.%.2] -// CHECK:STDOUT: %.loc13_24.1: %.35 = struct_literal (%.loc13_23) -// CHECK:STDOUT: %.loc13_24.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_24.3: = bound_method %.loc13_23, %.loc13_24.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc13_24.3(%.loc13_23) [template = constants.%.28] -// CHECK:STDOUT: %.loc13_24.4: init i32 = converted %.loc13_23, %int.convert_checked [template = constants.%.28] -// CHECK:STDOUT: %.loc13_24.5: ref i32 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc13_24.6: init i32 = initialize_from %.loc13_24.4 to %.loc13_24.5 [template = constants.%.28] -// CHECK:STDOUT: %.loc13_24.7: init %Circle = class_init (%.loc13_24.6), %return [template = constants.%struct] -// CHECK:STDOUT: %.loc13_25: init %Circle = converted %.loc13_24.1, %.loc13_24.7 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_23: Core.IntLiteral = int_value 5 [template = constants.%.3] +// CHECK:STDOUT: %.loc13_24.1: %.34 = struct_literal (%.loc13_23) +// CHECK:STDOUT: %.loc13_24.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_24.3: = bound_method %.loc13_23, %.loc13_24.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc13_24.4: = specific_function %.loc13_24.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc13_24.4(%.loc13_23) [template = constants.%.26] +// CHECK:STDOUT: %.loc13_24.5: init %i32 = converted %.loc13_23, %int.convert_checked [template = constants.%.26] +// CHECK:STDOUT: %.loc13_24.6: ref %i32 = class_element_access %return, element0 +// CHECK:STDOUT: %.loc13_24.7: init %i32 = initialize_from %.loc13_24.5 to %.loc13_24.6 [template = constants.%.26] +// CHECK:STDOUT: %.loc13_24.8: init %Circle = class_init (%.loc13_24.7), %return [template = constants.%struct] +// CHECK:STDOUT: %.loc13_25: init %Circle = converted %.loc13_24.1, %.loc13_24.8 [template = constants.%struct] // CHECK:STDOUT: return %.loc13_25 to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -273,15 +283,16 @@ class A { // CHECK:STDOUT: %.loc18_35.2: ref %Circle = temporary %.loc18_35.1, %Make.call // CHECK:STDOUT: %.loc18_35.3: %Circle = bind_value %.loc18_35.2 // CHECK:STDOUT: %circle: %Circle = bind_name circle, %.loc18_35.3 -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc26_15.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc26_15.2: type = converted %int.make_type_32, %.loc26_15.1 [template = i32] +// CHECK:STDOUT: %.loc26_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc26_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc26_15.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc26_15.3: type = converted %int.make_type_signed, %.loc26_15.2 [template = constants.%i32] // CHECK:STDOUT: %circle.ref.loc26: %Circle = name_ref circle, %circle // CHECK:STDOUT: %radius.ref.loc26: = name_ref radius, [template = ] -// CHECK:STDOUT: %radius: i32 = bind_name radius, +// CHECK:STDOUT: %radius: %i32 = bind_name radius, // CHECK:STDOUT: %circle.ref.loc34: %Circle = name_ref circle, %circle // CHECK:STDOUT: %radius.ref.loc34: = name_ref radius, [template = ] -// CHECK:STDOUT: %.loc34: Core.IntLiteral = int_value 5 [template = constants.%.2] +// CHECK:STDOUT: %.loc34: Core.IntLiteral = int_value 5 [template = constants.%.3] // CHECK:STDOUT: assign %radius.ref.loc34, // CHECK:STDOUT: %circle.ref.loc42: %Circle = name_ref circle, %circle // CHECK:STDOUT: %SOME_INTERNAL_CONSTANT.ref: = name_ref SOME_INTERNAL_CONSTANT, [template = ] @@ -294,18 +305,20 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %A, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.x: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %A, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.x: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -323,11 +336,12 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc5_20.2: type = converted %int.make_type_32, %.loc5_20.1 [template = i32] -// CHECK:STDOUT: %.loc5_18: %.1 = field_decl x, element0 [template] -// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc5_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc5_20.3: type = converted %int.make_type_signed, %.loc5_20.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_18: %.2 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -336,12 +350,13 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_10.2: type = converted %int.make_type_32, %.loc16_10.1 [template = i32] +// CHECK:STDOUT: %.loc16_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc16_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc16_10.3: type = converted %int.make_type_signed, %.loc16_10.2 [template = constants.%i32] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %x.ref: = name_ref x, [template = ] -// CHECK:STDOUT: %x: i32 = bind_name x, +// CHECK:STDOUT: %x: %i32 = bind_name x, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -349,29 +364,32 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Circle: type = class_type @Circle [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Circle, i32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Circle, %i32 [template] // CHECK:STDOUT: %GetRadius.type: type = fn_type @GetRadius [template] // CHECK:STDOUT: %GetRadius: %GetRadius.type = struct_value () [template] // CHECK:STDOUT: %SomeInternalFunction.type: type = fn_type @SomeInternalFunction [template] // CHECK:STDOUT: %SomeInternalFunction: %SomeInternalFunction.type = struct_value () [template] // CHECK:STDOUT: %Compute.type: type = fn_type @Compute [template] // CHECK:STDOUT: %Compute: %Compute.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = struct_type {.radius: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 0 [template] +// CHECK:STDOUT: %.3: type = struct_type {.radius: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -388,51 +406,55 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Circle { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_23.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc5_23.2: type = converted %int.make_type_32, %.loc5_23.1 [template = i32] -// CHECK:STDOUT: %.loc5_21: %.1 = field_decl radius, element0 [template] +// CHECK:STDOUT: %.loc5_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc5_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_23.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc5_23.3: type = converted %int.make_type_signed, %.loc5_23.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_21: %.2 = field_decl radius, element0 [template] // CHECK:STDOUT: %GetRadius.decl: %GetRadius.type = fn_decl @GetRadius [template = constants.%GetRadius] { // CHECK:STDOUT: %self.patt: %Circle = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Circle = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_33.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc7_33.2: type = converted %int.make_type_32, %.loc7_33.1 [template = i32] +// CHECK:STDOUT: %.loc7_33.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc7_33.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_33.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc7_33.3: type = converted %int.make_type_signed, %.loc7_33.2 [template = constants.%i32] // CHECK:STDOUT: %self.param: %Circle = value_param runtime_param0 // CHECK:STDOUT: %self: %Circle = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %SomeInternalFunction.decl: %SomeInternalFunction.type = fn_decl @SomeInternalFunction [template = constants.%SomeInternalFunction] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_40.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_40.2: type = converted %int.make_type_32, %.loc11_40.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_40.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_40.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_40.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_40.3: type = converted %int.make_type_signed, %.loc11_40.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Compute.decl: %Compute.type = fn_decl @Compute [template = constants.%Compute] { // CHECK:STDOUT: %self.patt: %Circle = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Circle = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_31.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_31.2: type = converted %int.make_type_32, %.loc15_31.1 [template = i32] +// CHECK:STDOUT: %.loc15_31.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_31.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_31.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_31.3: type = converted %int.make_type_signed, %.loc15_31.2 [template = constants.%i32] // CHECK:STDOUT: %self.param: %Circle = value_param runtime_param0 // CHECK:STDOUT: %self: %Circle = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc18: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc18: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Circle @@ -442,33 +464,34 @@ class A { // CHECK:STDOUT: .Compute = %Compute.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @GetRadius[%self.param_patt: %Circle]() -> i32 { +// CHECK:STDOUT: fn @GetRadius[%self.param_patt: %Circle]() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Circle = name_ref self, %self -// CHECK:STDOUT: %radius.ref: %.1 = name_ref radius, @Circle.%.loc5_21 [template = @Circle.%.loc5_21] -// CHECK:STDOUT: %.loc8_16.1: ref i32 = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc8_16.2: i32 = bind_value %.loc8_16.1 +// CHECK:STDOUT: %radius.ref: %.2 = name_ref radius, @Circle.%.loc5_21 [template = @Circle.%.loc5_21] +// CHECK:STDOUT: %.loc8_16.1: ref %i32 = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc8_16.2: %i32 = bind_value %.loc8_16.1 // CHECK:STDOUT: return %.loc8_16.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SomeInternalFunction() -> i32 { +// CHECK:STDOUT: fn @SomeInternalFunction() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_12: Core.IntLiteral = int_value 0 [template = constants.%.5] -// CHECK:STDOUT: %.loc12_13.1: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_13.2: = bound_method %.loc12_12, %.loc12_13.1 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_13.2(%.loc12_12) [template = constants.%.31] -// CHECK:STDOUT: %.loc12_13.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.31] -// CHECK:STDOUT: %.loc12_13.4: i32 = converted %.loc12_12, %.loc12_13.3 [template = constants.%.31] -// CHECK:STDOUT: return %.loc12_13.4 +// CHECK:STDOUT: %.loc12_12: Core.IntLiteral = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc12_13.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_13.2: = bound_method %.loc12_12, %.loc12_13.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_13.3: = specific_function %.loc12_13.2, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc12_13.3(%.loc12_12) [template = constants.%.29] +// CHECK:STDOUT: %.loc12_13.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.29] +// CHECK:STDOUT: %.loc12_13.5: %i32 = converted %.loc12_12, %.loc12_13.4 [template = constants.%.29] +// CHECK:STDOUT: return %.loc12_13.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Compute[%self.param_patt: %Circle]() -> i32 { +// CHECK:STDOUT: fn @Compute[%self.param_patt: %Circle]() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Circle = name_ref self, %self // CHECK:STDOUT: %SomeInternalFunction.ref: %SomeInternalFunction.type = name_ref SomeInternalFunction, @Circle.%SomeInternalFunction.decl [template = constants.%SomeInternalFunction] -// CHECK:STDOUT: %SomeInternalFunction.call: init i32 = call %SomeInternalFunction.ref() -// CHECK:STDOUT: %.loc16_39.1: i32 = value_of_initializer %SomeInternalFunction.call -// CHECK:STDOUT: %.loc16_39.2: i32 = converted %SomeInternalFunction.call, %.loc16_39.1 +// CHECK:STDOUT: %SomeInternalFunction.call: init %i32 = call %SomeInternalFunction.ref() +// CHECK:STDOUT: %.loc16_39.1: %i32 = value_of_initializer %SomeInternalFunction.call +// CHECK:STDOUT: %.loc16_39.2: %i32 = converted %SomeInternalFunction.call, %.loc16_39.1 // CHECK:STDOUT: return %.loc16_39.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -476,22 +499,25 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 5 [template] -// CHECK:STDOUT: %.28: type = struct_type {} [template] -// CHECK:STDOUT: %.29: = complete_type_witness %.28 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 5 [template] +// CHECK:STDOUT: %.26: type = struct_type {} [template] +// CHECK:STDOUT: %.27: = complete_type_witness %.26 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -506,23 +532,26 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_32, %.loc8_8.1 [template = i32] +// CHECK:STDOUT: %.loc8_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8.3: type = converted %int.make_type_signed, %.loc8_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_32, %.loc5_10.1 [template = i32] -// CHECK:STDOUT: %.loc5_16: Core.IntLiteral = int_value 5 [template = constants.%.1] -// CHECK:STDOUT: %.loc5_17.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc5_17.2: = bound_method %.loc5_16, %.loc5_17.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc5_17.2(%.loc5_16) [template = constants.%.27] -// CHECK:STDOUT: %.loc5_17.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc5_17.4: i32 = converted %.loc5_16, %.loc5_17.3 [template = constants.%.27] -// CHECK:STDOUT: %x: i32 = bind_name x, %.loc5_17.4 -// CHECK:STDOUT: %.loc6: = complete_type_witness %.28 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc5_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.3: type = converted %int.make_type_signed, %.loc5_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_16: Core.IntLiteral = int_value 5 [template = constants.%.2] +// CHECK:STDOUT: %.loc5_17.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc5_17.2: = bound_method %.loc5_16, %.loc5_17.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc5_17.3: = specific_function %.loc5_17.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc5_17.3(%.loc5_16) [template = constants.%.25] +// CHECK:STDOUT: %.loc5_17.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc5_17.5: %i32 = converted %.loc5_16, %.loc5_17.4 [template = constants.%.25] +// CHECK:STDOUT: %x: %i32 = bind_name x, %.loc5_17.5 +// CHECK:STDOUT: %.loc6: = complete_type_witness %.26 [template = constants.%.27] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -532,8 +561,8 @@ class A { // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %x.ref: i32 = name_ref x, @A.%x -// CHECK:STDOUT: %x: i32 = bind_name x, %x.ref +// CHECK:STDOUT: %x.ref: %i32 = name_ref x, @A.%x +// CHECK:STDOUT: %x: %i32 = bind_name x, %x.ref // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -541,22 +570,25 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 5 [template] -// CHECK:STDOUT: %.28: type = struct_type {} [template] -// CHECK:STDOUT: %.29: = complete_type_witness %.28 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 5 [template] +// CHECK:STDOUT: %.26: type = struct_type {} [template] +// CHECK:STDOUT: %.27: = complete_type_witness %.26 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -572,36 +604,42 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} -// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_8.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] -// CHECK:STDOUT: %.loc16_8.2: type = converted %int.make_type_32.loc16, %.loc16_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_8.1: type = value_of_initializer %int.make_type_32.loc23 [template = i32] -// CHECK:STDOUT: %.loc23_8.2: type = converted %int.make_type_32.loc23, %.loc23_8.1 [template = i32] +// CHECK:STDOUT: %.loc16_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%.loc16_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_8.2: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_8.3: type = converted %int.make_type_signed.loc16, %.loc16_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc23: init type = call constants.%Int(%.loc23_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_8.2: type = value_of_initializer %int.make_type_signed.loc23 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_8.3: type = converted %int.make_type_signed.loc23, %.loc23_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_20.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_20.2: type = converted %int.make_type_32.loc5, %.loc5_20.1 [template = i32] -// CHECK:STDOUT: %.loc5_26: Core.IntLiteral = int_value 5 [template = constants.%.1] -// CHECK:STDOUT: %.loc5_27.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc5_27.2: = bound_method %.loc5_26, %.loc5_27.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc5: init i32 = call %.loc5_27.2(%.loc5_26) [template = constants.%.27] -// CHECK:STDOUT: %.loc5_27.3: i32 = value_of_initializer %int.convert_checked.loc5 [template = constants.%.27] -// CHECK:STDOUT: %.loc5_27.4: i32 = converted %.loc5_26, %.loc5_27.3 [template = constants.%.27] -// CHECK:STDOUT: %x: i32 = bind_name x, %.loc5_27.4 -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_18.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_18.2: type = converted %int.make_type_32.loc6, %.loc6_18.1 [template = i32] -// CHECK:STDOUT: %.loc6_24: Core.IntLiteral = int_value 5 [template = constants.%.1] -// CHECK:STDOUT: %.loc6_25.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_25.2: = bound_method %.loc6_24, %.loc6_25.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc6: init i32 = call %.loc6_25.2(%.loc6_24) [template = constants.%.27] -// CHECK:STDOUT: %.loc6_25.3: i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%.27] -// CHECK:STDOUT: %.loc6_25.4: i32 = converted %.loc6_24, %.loc6_25.3 [template = constants.%.27] -// CHECK:STDOUT: %y: i32 = bind_name y, %.loc6_25.4 -// CHECK:STDOUT: %.loc7: = complete_type_witness %.28 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_20.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_20.3: type = converted %int.make_type_signed.loc5, %.loc5_20.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_26: Core.IntLiteral = int_value 5 [template = constants.%.2] +// CHECK:STDOUT: %.loc5_27.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc5_27.2: = bound_method %.loc5_26, %.loc5_27.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc5_27.3: = specific_function %.loc5_27.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %.loc5_27.3(%.loc5_26) [template = constants.%.25] +// CHECK:STDOUT: %.loc5_27.4: %i32 = value_of_initializer %int.convert_checked.loc5 [template = constants.%.25] +// CHECK:STDOUT: %.loc5_27.5: %i32 = converted %.loc5_26, %.loc5_27.4 [template = constants.%.25] +// CHECK:STDOUT: %x: %i32 = bind_name x, %.loc5_27.5 +// CHECK:STDOUT: %.loc6_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_18.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_18.3: type = converted %int.make_type_signed.loc6, %.loc6_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_24: Core.IntLiteral = int_value 5 [template = constants.%.2] +// CHECK:STDOUT: %.loc6_25.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_25.2: = bound_method %.loc6_24, %.loc6_25.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc6_25.3: = specific_function %.loc6_25.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %.loc6_25.3(%.loc6_24) [template = constants.%.25] +// CHECK:STDOUT: %.loc6_25.4: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%.25] +// CHECK:STDOUT: %.loc6_25.5: %i32 = converted %.loc6_24, %.loc6_25.4 [template = constants.%.25] +// CHECK:STDOUT: %y: %i32 = bind_name y, %.loc6_25.5 +// CHECK:STDOUT: %.loc7: = complete_type_witness %.26 [template = constants.%.27] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -613,10 +651,10 @@ class A { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %A.ref.loc16: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %x.ref: = name_ref x, [template = ] -// CHECK:STDOUT: %x: i32 = bind_name x, +// CHECK:STDOUT: %x: %i32 = bind_name x, // CHECK:STDOUT: %A.ref.loc23: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %y.ref: = name_ref y, [template = ] -// CHECK:STDOUT: %y: i32 = bind_name y, +// CHECK:STDOUT: %y: %i32 = bind_name y, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/adapt.carbon b/toolchain/check/testdata/class/adapt.carbon index 933361135f05..bc4fdd6dd3ad 100644 --- a/toolchain/check/testdata/class/adapt.carbon +++ b/toolchain/check/testdata/class/adapt.carbon @@ -49,19 +49,21 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %SomeClass: type = class_type @SomeClass [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %SomeClass, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %SomeClass, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %SomeClassAdapter: type = class_type @SomeClassAdapter [template] -// CHECK:STDOUT: %.5: = complete_type_witness %SomeClass [template] +// CHECK:STDOUT: %.6: = complete_type_witness %SomeClass [template] // CHECK:STDOUT: %StructAdapter: type = class_type @StructAdapter [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -81,15 +83,17 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @SomeClass { -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_32.loc5, %.loc5_10.1 [template = i32] -// CHECK:STDOUT: %.loc5_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_32.loc6, %.loc6_10.1 [template = i32] -// CHECK:STDOUT: %.loc6_8: %.1 = field_decl b, element1 [template] -// CHECK:STDOUT: %.loc7: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.3: type = converted %int.make_type_signed.loc5, %.loc5_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc6_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_10.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_10.3: type = converted %int.make_type_signed.loc6, %.loc6_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc7: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClass @@ -100,22 +104,24 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: class @SomeClassAdapter { // CHECK:STDOUT: %SomeClass.ref: type = name_ref SomeClass, file.%SomeClass.decl [template = constants.%SomeClass] // CHECK:STDOUT: adapt_decl %SomeClass -// CHECK:STDOUT: %.loc11: = complete_type_witness %SomeClass [template = constants.%.5] +// CHECK:STDOUT: %.loc11: = complete_type_witness %SomeClass [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClassAdapter // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @StructAdapter { -// CHECK:STDOUT: %int.make_type_32.loc14_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_14.1: type = value_of_initializer %int.make_type_32.loc14_14 [template = i32] -// CHECK:STDOUT: %.loc14_14.2: type = converted %int.make_type_32.loc14_14, %.loc14_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_23.1: type = value_of_initializer %int.make_type_32.loc14_23 [template = i32] -// CHECK:STDOUT: %.loc14_23.2: type = converted %int.make_type_32.loc14_23, %.loc14_23.1 [template = i32] -// CHECK:STDOUT: %.loc14_26: type = struct_type {.a: i32, .b: i32} [template = constants.%.2] -// CHECK:STDOUT: adapt_decl %.2 -// CHECK:STDOUT: %.loc15: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc14_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_14: init type = call constants.%Int(%.loc14_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_14.2: type = value_of_initializer %int.make_type_signed.loc14_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_14.3: type = converted %int.make_type_signed.loc14_14, %.loc14_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_23: init type = call constants.%Int(%.loc14_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_23.2: type = value_of_initializer %int.make_type_signed.loc14_23 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_23.3: type = converted %int.make_type_signed.loc14_23, %.loc14_23.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_26: type = struct_type {.a: %i32, .b: %i32} [template = constants.%.3] +// CHECK:STDOUT: adapt_decl %.3 +// CHECK:STDOUT: %.loc15: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%StructAdapter diff --git a/toolchain/check/testdata/class/base.carbon b/toolchain/check/testdata/class/base.carbon index 2f55f2021c77..781e22fbe219 100644 --- a/toolchain/check/testdata/class/base.carbon +++ b/toolchain/check/testdata/class/base.carbon @@ -30,41 +30,45 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Base: type = class_type @Base [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Base, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.b: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Base, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.b: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Derived, %Base [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, i32 [template] -// CHECK:STDOUT: %.7: type = struct_type {.base: %Base, .d: i32} [template] -// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, %Base [template] +// CHECK:STDOUT: %.7: type = unbound_element_type %Derived, %i32 [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %Base, .d: %i32} [template] +// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] -// CHECK:STDOUT: %.12: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %.13: type = struct_type {.b: Core.IntLiteral} [template] -// CHECK:STDOUT: %.14: Core.IntLiteral = int_value 7 [template] -// CHECK:STDOUT: %.15: type = struct_type {.base: %.13, .d: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.39: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.40: = bound_method %.12, %Convert.15 [template] -// CHECK:STDOUT: %.41: i32 = int_value 4 [template] -// CHECK:STDOUT: %struct.1: %Base = struct_value (%.41) [template] -// CHECK:STDOUT: %.42: = bound_method %.14, %Convert.15 [template] -// CHECK:STDOUT: %.43: i32 = int_value 7 [template] -// CHECK:STDOUT: %struct.2: %Derived = struct_value (%struct.1, %.43) [template] +// CHECK:STDOUT: %.13: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.14: type = struct_type {.b: Core.IntLiteral} [template] +// CHECK:STDOUT: %.15: Core.IntLiteral = int_value 7 [template] +// CHECK:STDOUT: %.16: type = struct_type {.base: %.14, .d: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.36: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.37: = bound_method %.13, %Convert.14 [template] +// CHECK:STDOUT: %.38: = specific_function %.37, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.39: %i32 = int_value 4 [template] +// CHECK:STDOUT: %struct.1: %Base = struct_value (%.39) [template] +// CHECK:STDOUT: %.40: = bound_method %.15, %Convert.14 [template] +// CHECK:STDOUT: %.41: = specific_function %.40, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.42: %i32 = int_value 7 [template] +// CHECK:STDOUT: %struct.2: %Derived = struct_value (%struct.1, %.42) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %Access.type: type = fn_type @Access [template] // CHECK:STDOUT: %Access: %Access.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -97,13 +101,15 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %int.make_type_32.loc25_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc25_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc25_35.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc25_27, %int.make_type_32.loc25_32) -// CHECK:STDOUT: %.loc25_35.2: type = value_of_initializer %int.make_type_32.loc25_27 [template = i32] -// CHECK:STDOUT: %.loc25_35.3: type = converted %int.make_type_32.loc25_27, %.loc25_35.2 [template = i32] -// CHECK:STDOUT: %.loc25_35.4: type = value_of_initializer %int.make_type_32.loc25_32 [template = i32] -// CHECK:STDOUT: %.loc25_35.5: type = converted %int.make_type_32.loc25_32, %.loc25_35.4 [template = i32] +// CHECK:STDOUT: %.loc25_27: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc25_27: init type = call constants.%Int(%.loc25_27) [template = constants.%i32] +// CHECK:STDOUT: %.loc25_32: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc25_32: init type = call constants.%Int(%.loc25_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc25_35.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc25_27, %int.make_type_signed.loc25_32) +// CHECK:STDOUT: %.loc25_35.2: type = value_of_initializer %int.make_type_signed.loc25_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc25_35.3: type = converted %int.make_type_signed.loc25_27, %.loc25_35.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc25_35.4: type = value_of_initializer %int.make_type_signed.loc25_32 [template = constants.%i32] +// CHECK:STDOUT: %.loc25_35.5: type = converted %int.make_type_signed.loc25_32, %.loc25_35.4 [template = constants.%i32] // CHECK:STDOUT: %.loc25_35.6: type = converted %.loc25_35.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param @@ -113,11 +119,12 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl b, element0 [template] -// CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl b, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -126,12 +133,13 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc16: %.5 = base_decl %Base, element0 [template] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc18_10.2: type = converted %int.make_type_32, %.loc18_10.1 [template = i32] -// CHECK:STDOUT: %.loc18_8: %.6 = field_decl d, element1 [template] -// CHECK:STDOUT: %.loc19: = complete_type_witness %.7 [template = constants.%.8] +// CHECK:STDOUT: %.loc16: %.6 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc18_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc18_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc18_10.3: type = converted %int.make_type_signed, %.loc18_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_8: %.7 = field_decl d, element1 [template] +// CHECK:STDOUT: %.loc19: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -142,48 +150,50 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Make() -> %return: %Derived { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc22_25: Core.IntLiteral = int_value 4 [template = constants.%.12] -// CHECK:STDOUT: %.loc22_26.1: %.13 = struct_literal (%.loc22_25) -// CHECK:STDOUT: %.loc22_34: Core.IntLiteral = int_value 7 [template = constants.%.14] -// CHECK:STDOUT: %.loc22_35.1: %.15 = struct_literal (%.loc22_26.1, %.loc22_34) -// CHECK:STDOUT: %.loc22_26.2: %Convert.type.2 = interface_witness_access constants.%.39, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc22_26.3: = bound_method %.loc22_25, %.loc22_26.2 [template = constants.%.40] -// CHECK:STDOUT: %int.convert_checked.loc22_26: init i32 = call %.loc22_26.3(%.loc22_25) [template = constants.%.41] -// CHECK:STDOUT: %.loc22_26.4: init i32 = converted %.loc22_25, %int.convert_checked.loc22_26 [template = constants.%.41] +// CHECK:STDOUT: %.loc22_25: Core.IntLiteral = int_value 4 [template = constants.%.13] +// CHECK:STDOUT: %.loc22_26.1: %.14 = struct_literal (%.loc22_25) +// CHECK:STDOUT: %.loc22_34: Core.IntLiteral = int_value 7 [template = constants.%.15] +// CHECK:STDOUT: %.loc22_35.1: %.16 = struct_literal (%.loc22_26.1, %.loc22_34) +// CHECK:STDOUT: %.loc22_26.2: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc22_26.3: = bound_method %.loc22_25, %.loc22_26.2 [template = constants.%.37] +// CHECK:STDOUT: %.loc22_26.4: = specific_function %.loc22_26.3, @Convert.2(constants.%.1) [template = constants.%.38] +// CHECK:STDOUT: %int.convert_checked.loc22_26: init %i32 = call %.loc22_26.4(%.loc22_25) [template = constants.%.39] +// CHECK:STDOUT: %.loc22_26.5: init %i32 = converted %.loc22_25, %int.convert_checked.loc22_26 [template = constants.%.39] // CHECK:STDOUT: %.loc22_35.2: ref %Base = class_element_access %return, element0 -// CHECK:STDOUT: %.loc22_26.5: ref i32 = class_element_access %.loc22_35.2, element0 -// CHECK:STDOUT: %.loc22_26.6: init i32 = initialize_from %.loc22_26.4 to %.loc22_26.5 [template = constants.%.41] -// CHECK:STDOUT: %.loc22_26.7: init %Base = class_init (%.loc22_26.6), %.loc22_35.2 [template = constants.%struct.1] -// CHECK:STDOUT: %.loc22_35.3: init %Base = converted %.loc22_26.1, %.loc22_26.7 [template = constants.%struct.1] -// CHECK:STDOUT: %.loc22_35.4: %Convert.type.2 = interface_witness_access constants.%.39, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc22_35.5: = bound_method %.loc22_34, %.loc22_35.4 [template = constants.%.42] -// CHECK:STDOUT: %int.convert_checked.loc22_35: init i32 = call %.loc22_35.5(%.loc22_34) [template = constants.%.43] -// CHECK:STDOUT: %.loc22_35.6: init i32 = converted %.loc22_34, %int.convert_checked.loc22_35 [template = constants.%.43] -// CHECK:STDOUT: %.loc22_35.7: ref i32 = class_element_access %return, element1 -// CHECK:STDOUT: %.loc22_35.8: init i32 = initialize_from %.loc22_35.6 to %.loc22_35.7 [template = constants.%.43] -// CHECK:STDOUT: %.loc22_35.9: init %Derived = class_init (%.loc22_35.3, %.loc22_35.8), %return [template = constants.%struct.2] -// CHECK:STDOUT: %.loc22_36: init %Derived = converted %.loc22_35.1, %.loc22_35.9 [template = constants.%struct.2] +// CHECK:STDOUT: %.loc22_26.6: ref %i32 = class_element_access %.loc22_35.2, element0 +// CHECK:STDOUT: %.loc22_26.7: init %i32 = initialize_from %.loc22_26.5 to %.loc22_26.6 [template = constants.%.39] +// CHECK:STDOUT: %.loc22_26.8: init %Base = class_init (%.loc22_26.7), %.loc22_35.2 [template = constants.%struct.1] +// CHECK:STDOUT: %.loc22_35.3: init %Base = converted %.loc22_26.1, %.loc22_26.8 [template = constants.%struct.1] +// CHECK:STDOUT: %.loc22_35.4: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc22_35.5: = bound_method %.loc22_34, %.loc22_35.4 [template = constants.%.40] +// CHECK:STDOUT: %.loc22_35.6: = specific_function %.loc22_35.5, @Convert.2(constants.%.1) [template = constants.%.41] +// CHECK:STDOUT: %int.convert_checked.loc22_35: init %i32 = call %.loc22_35.6(%.loc22_34) [template = constants.%.42] +// CHECK:STDOUT: %.loc22_35.7: init %i32 = converted %.loc22_34, %int.convert_checked.loc22_35 [template = constants.%.42] +// CHECK:STDOUT: %.loc22_35.8: ref %i32 = class_element_access %return, element1 +// CHECK:STDOUT: %.loc22_35.9: init %i32 = initialize_from %.loc22_35.7 to %.loc22_35.8 [template = constants.%.42] +// CHECK:STDOUT: %.loc22_35.10: init %Derived = class_init (%.loc22_35.3, %.loc22_35.9), %return [template = constants.%struct.2] +// CHECK:STDOUT: %.loc22_36: init %Derived = converted %.loc22_35.1, %.loc22_35.10 [template = constants.%struct.2] // CHECK:STDOUT: return %.loc22_36 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Access(%d.param_patt: %Derived) -> %return: %tuple.type.2 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref.loc26_11: %Derived = name_ref d, %d -// CHECK:STDOUT: %d.ref.loc26_12: %.6 = name_ref d, @Derived.%.loc18_8 [template = @Derived.%.loc18_8] -// CHECK:STDOUT: %.loc26_12.1: ref i32 = class_element_access %d.ref.loc26_11, element1 -// CHECK:STDOUT: %.loc26_12.2: i32 = bind_value %.loc26_12.1 +// CHECK:STDOUT: %d.ref.loc26_12: %.7 = name_ref d, @Derived.%.loc18_8 [template = @Derived.%.loc18_8] +// CHECK:STDOUT: %.loc26_12.1: ref %i32 = class_element_access %d.ref.loc26_11, element1 +// CHECK:STDOUT: %.loc26_12.2: %i32 = bind_value %.loc26_12.1 // CHECK:STDOUT: %d.ref.loc26_16: %Derived = name_ref d, %d -// CHECK:STDOUT: %base.ref: %.5 = name_ref base, @Derived.%.loc16 [template = @Derived.%.loc16] +// CHECK:STDOUT: %base.ref: %.6 = name_ref base, @Derived.%.loc16 [template = @Derived.%.loc16] // CHECK:STDOUT: %.loc26_17.1: ref %Base = class_element_access %d.ref.loc26_16, element0 // CHECK:STDOUT: %.loc26_17.2: %Base = bind_value %.loc26_17.1 -// CHECK:STDOUT: %b.ref: %.1 = name_ref b, @Base.%.loc12_8 [template = @Base.%.loc12_8] -// CHECK:STDOUT: %.loc26_22.1: ref i32 = class_element_access %.loc26_17.2, element0 -// CHECK:STDOUT: %.loc26_22.2: i32 = bind_value %.loc26_22.1 +// CHECK:STDOUT: %b.ref: %.2 = name_ref b, @Base.%.loc12_8 [template = @Base.%.loc12_8] +// CHECK:STDOUT: %.loc26_22.1: ref %i32 = class_element_access %.loc26_17.2, element0 +// CHECK:STDOUT: %.loc26_22.2: %i32 = bind_value %.loc26_22.1 // CHECK:STDOUT: %.loc26_24.1: %tuple.type.2 = tuple_literal (%.loc26_12.2, %.loc26_22.2) -// CHECK:STDOUT: %.loc26_24.2: ref i32 = tuple_access %return, element0 -// CHECK:STDOUT: %.loc26_24.3: init i32 = initialize_from %.loc26_12.2 to %.loc26_24.2 -// CHECK:STDOUT: %.loc26_24.4: ref i32 = tuple_access %return, element1 -// CHECK:STDOUT: %.loc26_24.5: init i32 = initialize_from %.loc26_22.2 to %.loc26_24.4 +// CHECK:STDOUT: %.loc26_24.2: ref %i32 = tuple_access %return, element0 +// CHECK:STDOUT: %.loc26_24.3: init %i32 = initialize_from %.loc26_12.2 to %.loc26_24.2 +// CHECK:STDOUT: %.loc26_24.4: ref %i32 = tuple_access %return, element1 +// CHECK:STDOUT: %.loc26_24.5: init %i32 = initialize_from %.loc26_22.2 to %.loc26_24.4 // CHECK:STDOUT: %.loc26_24.6: init %tuple.type.2 = tuple_init (%.loc26_24.3, %.loc26_24.5) to %return // CHECK:STDOUT: %.loc26_25: init %tuple.type.2 = converted %.loc26_24.1, %.loc26_24.6 // CHECK:STDOUT: return %.loc26_25 to %return diff --git a/toolchain/check/testdata/class/base_field.carbon b/toolchain/check/testdata/class/base_field.carbon index cdd0baef56a0..dbc271d75c83 100644 --- a/toolchain/check/testdata/class/base_field.carbon +++ b/toolchain/check/testdata/class/base_field.carbon @@ -29,25 +29,27 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Base: type = class_type @Base [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Base, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: i32, .c: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Base, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32, .b: %i32, .c: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Derived, %Base [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, i32 [template] -// CHECK:STDOUT: %.7: type = struct_type {.base: %Base, .d: i32, .e: i32} [template] -// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] -// CHECK:STDOUT: %.9: type = ptr_type %Derived [template] -// CHECK:STDOUT: %.10: type = ptr_type i32 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, %Base [template] +// CHECK:STDOUT: %.7: type = unbound_element_type %Derived, %i32 [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %Base, .d: %i32, .e: %i32} [template] +// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] +// CHECK:STDOUT: %.10: type = ptr_type %Derived [template] +// CHECK:STDOUT: %.11: type = ptr_type %i32 [template] // CHECK:STDOUT: %Access.type: type = fn_type @Access [template] // CHECK:STDOUT: %Access: %Access.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -64,38 +66,42 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} {} // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {} // CHECK:STDOUT: %Access.decl: %Access.type = fn_decl @Access [template = constants.%Access] { -// CHECK:STDOUT: %p.patt: %.9 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.9 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.10 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.10 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.10 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.10 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.11 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.11 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %.loc24_21: type = ptr_type %Derived [template = constants.%.9] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc24_30.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc24_30.2: type = converted %int.make_type_32, %.loc24_30.1 [template = i32] -// CHECK:STDOUT: %.loc24_30.3: type = ptr_type i32 [template = constants.%.10] -// CHECK:STDOUT: %p.param: %.9 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.9 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.10 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.10 = return_slot %return.param +// CHECK:STDOUT: %.loc24_21: type = ptr_type %Derived [template = constants.%.10] +// CHECK:STDOUT: %.loc24_27: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc24_27) [template = constants.%i32] +// CHECK:STDOUT: %.loc24_30.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc24_30.2: type = converted %int.make_type_signed, %.loc24_30.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc24_30.3: type = ptr_type %i32 [template = constants.%.11] +// CHECK:STDOUT: %p.param: %.10 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.10 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.11 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.11 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] -// CHECK:STDOUT: %.loc13_8: %.1 = field_decl b, element1 [template] -// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] -// CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_32.loc14, %.loc14_10.1 [template = i32] -// CHECK:STDOUT: %.loc14_8: %.1 = field_decl c, element2 [template] -// CHECK:STDOUT: %.loc15: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed.loc12, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc13_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.3: type = converted %int.make_type_signed.loc13, %.loc13_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc14_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%.loc14_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_10.2: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_10.3: type = converted %int.make_type_signed.loc14, %.loc14_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_8: %.2 = field_decl c, element2 [template] +// CHECK:STDOUT: %.loc15: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -106,16 +112,18 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc18: %.5 = base_decl %Base, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc20_10.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32] -// CHECK:STDOUT: %.loc20_10.2: type = converted %int.make_type_32.loc20, %.loc20_10.1 [template = i32] -// CHECK:STDOUT: %.loc20_8: %.6 = field_decl d, element1 [template] -// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_10.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] -// CHECK:STDOUT: %.loc21_10.2: type = converted %int.make_type_32.loc21, %.loc21_10.1 [template = i32] -// CHECK:STDOUT: %.loc21_8: %.6 = field_decl e, element2 [template] -// CHECK:STDOUT: %.loc22: = complete_type_witness %.7 [template = constants.%.8] +// CHECK:STDOUT: %.loc18: %.6 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc20_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%.loc20_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc20_10.2: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] +// CHECK:STDOUT: %.loc20_10.3: type = converted %int.make_type_signed.loc20, %.loc20_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc20_8: %.7 = field_decl d, element1 [template] +// CHECK:STDOUT: %.loc21_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%.loc21_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_10.2: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_10.3: type = converted %int.make_type_signed.loc21, %.loc21_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_8: %.7 = field_decl e, element2 [template] +// CHECK:STDOUT: %.loc22: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -125,15 +133,15 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: extend %Base.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Access(%p.param_patt: %.9) -> %.10 { +// CHECK:STDOUT: fn @Access(%p.param_patt: %.10) -> %.11 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.9 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.10 = name_ref p, %p // CHECK:STDOUT: %.loc25_12: ref %Derived = deref %p.ref -// CHECK:STDOUT: %c.ref: %.1 = name_ref c, @Base.%.loc14_8 [template = @Base.%.loc14_8] +// CHECK:STDOUT: %c.ref: %.2 = name_ref c, @Base.%.loc14_8 [template = @Base.%.loc14_8] // CHECK:STDOUT: %.loc25_15.1: ref %Base = class_element_access %.loc25_12, element0 // CHECK:STDOUT: %.loc25_15.2: ref %Base = converted %.loc25_12, %.loc25_15.1 -// CHECK:STDOUT: %.loc25_15.3: ref i32 = class_element_access %.loc25_15.2, element2 -// CHECK:STDOUT: %.loc25_10: %.10 = addr_of %.loc25_15.3 +// CHECK:STDOUT: %.loc25_15.3: ref %i32 = class_element_access %.loc25_15.2, element2 +// CHECK:STDOUT: %.loc25_10: %.11 = addr_of %.loc25_15.3 // CHECK:STDOUT: return %.loc25_10 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/base_method.carbon b/toolchain/check/testdata/class/base_method.carbon index 56a568d33607..921337824b94 100644 --- a/toolchain/check/testdata/class/base_method.carbon +++ b/toolchain/check/testdata/class/base_method.carbon @@ -30,34 +30,37 @@ fn Call(p: Derived*) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Base: type = class_type @Base [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Base, i32 [template] -// CHECK:STDOUT: %.2: type = ptr_type %Base [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Base, %i32 [template] +// CHECK:STDOUT: %.3: type = ptr_type %Base [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] -// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.30: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.31: = bound_method %.6, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 1 [template] +// CHECK:STDOUT: %.4: type = struct_type {.a: %i32} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.28: = bound_method %.7, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] -// CHECK:STDOUT: %.33: type = unbound_element_type %Derived, %Base [template] -// CHECK:STDOUT: %.34: type = struct_type {.base: %Base} [template] -// CHECK:STDOUT: %.35: = complete_type_witness %.34 [template] -// CHECK:STDOUT: %.36: type = ptr_type %Derived [template] +// CHECK:STDOUT: %.31: type = unbound_element_type %Derived, %Base [template] +// CHECK:STDOUT: %.32: type = struct_type {.base: %Base} [template] +// CHECK:STDOUT: %.33: = complete_type_witness %.32 [template] +// CHECK:STDOUT: %.34: type = ptr_type %Derived [template] // CHECK:STDOUT: %Call.type: type = fn_type @Call [template] // CHECK:STDOUT: %Call: %Call.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -74,43 +77,44 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %self.patt: %.2 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %.2 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %self.patt: %.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.3 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc17_11: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Base [template = constants.%Base] -// CHECK:STDOUT: %.loc17_26: type = ptr_type %Base [template = constants.%.2] -// CHECK:STDOUT: %self.param.loc17: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %self.loc17: %.2 = bind_name self, %self.param.loc17 +// CHECK:STDOUT: %.loc17_26: type = ptr_type %Base [template = constants.%.3] +// CHECK:STDOUT: %self.param.loc17: %.3 = value_param runtime_param0 +// CHECK:STDOUT: %self.loc17: %.3 = bind_name self, %self.param.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {} // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { -// CHECK:STDOUT: %p.patt: %.36 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.36 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %p.patt: %.34 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.34 = value_param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %.loc25: type = ptr_type %Derived [template = constants.%.36] -// CHECK:STDOUT: %p.param: %.36 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.36 = bind_name p, %p.param +// CHECK:STDOUT: %.loc25: type = ptr_type %Derived [template = constants.%.34] +// CHECK:STDOUT: %p.param: %.34 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.34 = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %self.patt: %.2 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %.2 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %self.patt: %.3 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.3 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc17_11: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, constants.%Base [template = constants.%Base] -// CHECK:STDOUT: %.loc14: type = ptr_type %Base [template = constants.%.2] -// CHECK:STDOUT: %self.param.loc14: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %self.loc14: %.2 = bind_name self, %self.param.loc14 +// CHECK:STDOUT: %.loc14: type = ptr_type %Base [template = constants.%.3] +// CHECK:STDOUT: %self.param.loc14: %.3 = value_param runtime_param0 +// CHECK:STDOUT: %self.loc14: %.3 = bind_name self, %self.param.loc14 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc15: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -120,8 +124,8 @@ fn Call(p: Derived*) { // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc22: %.33 = base_decl %Base, element0 [template] -// CHECK:STDOUT: %.loc23: = complete_type_witness %.34 [template = constants.%.35] +// CHECK:STDOUT: %.loc22: %.31 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc23: = complete_type_witness %.32 [template = constants.%.33] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -129,32 +133,33 @@ fn Call(p: Derived*) { // CHECK:STDOUT: extend %Base.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[addr %self.param_patt: %.2]() { +// CHECK:STDOUT: fn @F[addr %self.param_patt: %.3]() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %.2 = name_ref self, %self.loc17 +// CHECK:STDOUT: %self.ref: %.3 = name_ref self, %self.loc17 // CHECK:STDOUT: %.loc18_4: ref %Base = deref %self.ref -// CHECK:STDOUT: %a.ref: %.1 = name_ref a, @Base.%.loc12_8 [template = @Base.%.loc12_8] -// CHECK:STDOUT: %.loc18_10: ref i32 = class_element_access %.loc18_4, element0 -// CHECK:STDOUT: %.loc18_15: Core.IntLiteral = int_value 1 [template = constants.%.6] -// CHECK:STDOUT: %.loc18_13.1: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_13.2: = bound_method %.loc18_15, %.loc18_13.1 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc18_13.2(%.loc18_15) [template = constants.%.32] -// CHECK:STDOUT: %.loc18_13.3: init i32 = converted %.loc18_15, %int.convert_checked [template = constants.%.32] -// CHECK:STDOUT: assign %.loc18_10, %.loc18_13.3 +// CHECK:STDOUT: %a.ref: %.2 = name_ref a, @Base.%.loc12_8 [template = @Base.%.loc12_8] +// CHECK:STDOUT: %.loc18_10: ref %i32 = class_element_access %.loc18_4, element0 +// CHECK:STDOUT: %.loc18_15: Core.IntLiteral = int_value 1 [template = constants.%.7] +// CHECK:STDOUT: %.loc18_13.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_13.2: = bound_method %.loc18_15, %.loc18_13.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc18_13.3: = specific_function %.loc18_13.2, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc18_13.3(%.loc18_15) [template = constants.%.30] +// CHECK:STDOUT: %.loc18_13.4: init %i32 = converted %.loc18_15, %int.convert_checked [template = constants.%.30] +// CHECK:STDOUT: assign %.loc18_10, %.loc18_13.4 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Call(%p.param_patt: %.36) { +// CHECK:STDOUT: fn @Call(%p.param_patt: %.34) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.36 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.34 = name_ref p, %p // CHECK:STDOUT: %.loc26_4.1: ref %Derived = deref %p.ref // CHECK:STDOUT: %F.ref: %F.type = name_ref F, @Base.%F.decl [template = constants.%F] // CHECK:STDOUT: %.loc26_7: = bound_method %.loc26_4.1, %F.ref -// CHECK:STDOUT: %.loc26_4.2: %.36 = addr_of %.loc26_4.1 +// CHECK:STDOUT: %.loc26_4.2: %.34 = addr_of %.loc26_4.1 // CHECK:STDOUT: %.loc26_4.3: ref %Derived = deref %.loc26_4.2 // CHECK:STDOUT: %.loc26_4.4: ref %Base = class_element_access %.loc26_4.3, element0 -// CHECK:STDOUT: %.loc26_4.5: %.2 = addr_of %.loc26_4.4 -// CHECK:STDOUT: %.loc26_4.6: %.2 = converted %.loc26_4.2, %.loc26_4.5 +// CHECK:STDOUT: %.loc26_4.5: %.3 = addr_of %.loc26_4.4 +// CHECK:STDOUT: %.loc26_4.6: %.3 = converted %.loc26_4.2, %.loc26_4.5 // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %.loc26_7(%.loc26_4.6) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/base_method_qualified.carbon b/toolchain/check/testdata/class/base_method_qualified.carbon index 7fe4ce988940..0727ee83bb2e 100644 --- a/toolchain/check/testdata/class/base_method_qualified.carbon +++ b/toolchain/check/testdata/class/base_method_qualified.carbon @@ -43,24 +43,26 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %Base: type = class_type @Base [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %G.type.1: type = fn_type @G.1 [template] // CHECK:STDOUT: %G.1: %G.type.1 = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %Derived, %Base [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %Derived, %Base [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %G.type.2: type = fn_type @G.2 [template] // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [template] -// CHECK:STDOUT: %.5: type = struct_type {.base: %Base} [template] -// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] +// CHECK:STDOUT: %.6: type = struct_type {.base: %Base} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: %Call.type: type = fn_type @Call [template] // CHECK:STDOUT: %Call: %Call.type = struct_value () [template] -// CHECK:STDOUT: %.9: type = ptr_type %Derived [template] +// CHECK:STDOUT: %.10: type = ptr_type %Derived [template] // CHECK:STDOUT: %CallIndirect.type: type = fn_type @CallIndirect [template] // CHECK:STDOUT: %CallIndirect: %CallIndirect.type = struct_value () [template] // CHECK:STDOUT: %PassDerivedToBase.type: type = fn_type @PassDerivedToBase [template] @@ -71,7 +73,7 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -94,70 +96,74 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { // CHECK:STDOUT: %a.patt: %Derived = binding_pattern a // CHECK:STDOUT: %a.param_patt: %Derived = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc25_24.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc25_24.2: type = converted %int.make_type_32, %.loc25_24.1 [template = i32] +// CHECK:STDOUT: %.loc25_24.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc25_24.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc25_24.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc25_24.3: type = converted %int.make_type_signed, %.loc25_24.2 [template = constants.%i32] // CHECK:STDOUT: %a.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %a: %Derived = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallIndirect.decl: %CallIndirect.type = fn_decl @CallIndirect [template = constants.%CallIndirect] { -// CHECK:STDOUT: %p.patt: %.9 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.9 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.10 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.10 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] -// CHECK:STDOUT: %.loc29_27: type = ptr_type %Derived [template = constants.%.9] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc29_33.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc29_33.2: type = converted %int.make_type_32, %.loc29_33.1 [template = i32] -// CHECK:STDOUT: %p.param: %.9 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.9 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc29_27: type = ptr_type %Derived [template = constants.%.10] +// CHECK:STDOUT: %.loc29_33.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc29_33.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc29_33.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc29_33.3: type = converted %int.make_type_signed, %.loc29_33.2 [template = constants.%i32] +// CHECK:STDOUT: %p.param: %.10 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.10 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %PassDerivedToBase.decl: %PassDerivedToBase.type = fn_decl @PassDerivedToBase [template = constants.%PassDerivedToBase] { // CHECK:STDOUT: %a.patt: %Derived = binding_pattern a // CHECK:STDOUT: %a.param_patt: %Derived = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc33_37.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc33_37.2: type = converted %int.make_type_32, %.loc33_37.1 [template = i32] +// CHECK:STDOUT: %.loc33_37.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc33_37.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc33_37.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc33_37.3: type = converted %int.make_type_signed, %.loc33_37.2 [template = constants.%i32] // CHECK:STDOUT: %a.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %a: %Derived = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %PassDerivedToBaseIndirect.decl: %PassDerivedToBaseIndirect.type = fn_decl @PassDerivedToBaseIndirect [template = constants.%PassDerivedToBaseIndirect] { -// CHECK:STDOUT: %p.patt: %.9 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.9 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.10 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.10 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] -// CHECK:STDOUT: %.loc37_40: type = ptr_type %Derived [template = constants.%.9] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc37_46.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc37_46.2: type = converted %int.make_type_32, %.loc37_46.1 [template = i32] -// CHECK:STDOUT: %p.param: %.9 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.9 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc37_40: type = ptr_type %Derived [template = constants.%.10] +// CHECK:STDOUT: %.loc37_46.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc37_46.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc37_46.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc37_46.3: type = converted %int.make_type_signed, %.loc37_46.2 [template = constants.%i32] +// CHECK:STDOUT: %p.param: %.10 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.10 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc19: %.4 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc19: %.5 = base_decl %Base, element0 [template] // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %self.patt: %Derived = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Derived = value_param_pattern %self.patt, runtime_param0 @@ -174,7 +180,7 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %self.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %self: %Derived = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc23: = complete_type_witness %.5 [template = constants.%.6] +// CHECK:STDOUT: %.loc23: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -188,34 +194,36 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { // CHECK:STDOUT: %self.patt: %Base = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Base = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [template = constants.%Base] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_25.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_25.2: type = converted %int.make_type_32, %.loc14_25.1 [template = i32] +// CHECK:STDOUT: %.loc14_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_25.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_25.3: type = converted %int.make_type_signed, %.loc14_25.2 [template = constants.%i32] // CHECK:STDOUT: %self.param: %Base = value_param runtime_param0 // CHECK:STDOUT: %self: %Base = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type.1 = fn_decl @G.1 [template = constants.%G.1] { // CHECK:STDOUT: %self.patt: %Derived = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Derived = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_28.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_28.2: type = converted %int.make_type_32, %.loc15_28.1 [template = i32] +// CHECK:STDOUT: %.loc15_28.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_28.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_28.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_28.3: type = converted %int.make_type_signed, %.loc15_28.2 [template = constants.%i32] // CHECK:STDOUT: %self.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %self: %Derived = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc16: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc16: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -223,15 +231,15 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.1[%self.param_patt: %Base]() -> i32; +// CHECK:STDOUT: fn @F.1[%self.param_patt: %Base]() -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G.1[%self.param_patt: %Derived]() -> i32; +// CHECK:STDOUT: fn @G.1[%self.param_patt: %Derived]() -> %i32; // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2[%self.param_patt: %Derived](); // CHECK:STDOUT: // CHECK:STDOUT: fn @G.2[%self.param_patt: %Derived](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Call(%a.param_patt: %Derived) -> i32 { +// CHECK:STDOUT: fn @Call(%a.param_patt: %Derived) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %Derived = name_ref a, %a // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] @@ -240,15 +248,15 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %.loc26_10.1: ref %Base = class_element_access %a.ref, element0 // CHECK:STDOUT: %.loc26_10.2: ref %Base = converted %a.ref, %.loc26_10.1 // CHECK:STDOUT: %.loc26_10.3: %Base = bind_value %.loc26_10.2 -// CHECK:STDOUT: %F.call: init i32 = call %.loc26_11(%.loc26_10.3) -// CHECK:STDOUT: %.loc26_22.1: i32 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc26_22.2: i32 = converted %F.call, %.loc26_22.1 +// CHECK:STDOUT: %F.call: init %i32 = call %.loc26_11(%.loc26_10.3) +// CHECK:STDOUT: %.loc26_22.1: %i32 = value_of_initializer %F.call +// CHECK:STDOUT: %.loc26_22.2: %i32 = converted %F.call, %.loc26_22.1 // CHECK:STDOUT: return %.loc26_22.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallIndirect(%p.param_patt: %.9) -> i32 { +// CHECK:STDOUT: fn @CallIndirect(%p.param_patt: %.10) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.9 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.10 = name_ref p, %p // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %F.ref: %F.type.1 = name_ref F, @Base.%F.decl [template = constants.%F.1] // CHECK:STDOUT: %.loc30_11.1: ref %Derived = deref %p.ref @@ -256,35 +264,35 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %.loc30_11.3: ref %Base = class_element_access %.loc30_11.1, element0 // CHECK:STDOUT: %.loc30_11.4: ref %Base = converted %.loc30_11.1, %.loc30_11.3 // CHECK:STDOUT: %.loc30_11.5: %Base = bind_value %.loc30_11.4 -// CHECK:STDOUT: %F.call: init i32 = call %.loc30_11.2(%.loc30_11.5) -// CHECK:STDOUT: %.loc30_23.1: i32 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc30_23.2: i32 = converted %F.call, %.loc30_23.1 +// CHECK:STDOUT: %F.call: init %i32 = call %.loc30_11.2(%.loc30_11.5) +// CHECK:STDOUT: %.loc30_23.1: %i32 = value_of_initializer %F.call +// CHECK:STDOUT: %.loc30_23.2: %i32 = converted %F.call, %.loc30_23.1 // CHECK:STDOUT: return %.loc30_23.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @PassDerivedToBase(%a.param_patt: %Derived) -> i32 { +// CHECK:STDOUT: fn @PassDerivedToBase(%a.param_patt: %Derived) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %Derived = name_ref a, %a // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %G.ref: %G.type.1 = name_ref G, @Base.%G.decl [template = constants.%G.1] // CHECK:STDOUT: %.loc34_11: = bound_method %a.ref, %G.ref -// CHECK:STDOUT: %G.call: init i32 = call %.loc34_11(%a.ref) -// CHECK:STDOUT: %.loc34_22.1: i32 = value_of_initializer %G.call -// CHECK:STDOUT: %.loc34_22.2: i32 = converted %G.call, %.loc34_22.1 +// CHECK:STDOUT: %G.call: init %i32 = call %.loc34_11(%a.ref) +// CHECK:STDOUT: %.loc34_22.1: %i32 = value_of_initializer %G.call +// CHECK:STDOUT: %.loc34_22.2: %i32 = converted %G.call, %.loc34_22.1 // CHECK:STDOUT: return %.loc34_22.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @PassDerivedToBaseIndirect(%p.param_patt: %.9) -> i32 { +// CHECK:STDOUT: fn @PassDerivedToBaseIndirect(%p.param_patt: %.10) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.9 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.10 = name_ref p, %p // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %G.ref: %G.type.1 = name_ref G, @Base.%G.decl [template = constants.%G.1] // CHECK:STDOUT: %.loc38_11.1: ref %Derived = deref %p.ref // CHECK:STDOUT: %.loc38_11.2: = bound_method %.loc38_11.1, %G.ref // CHECK:STDOUT: %.loc38_11.3: %Derived = bind_value %.loc38_11.1 -// CHECK:STDOUT: %G.call: init i32 = call %.loc38_11.2(%.loc38_11.3) -// CHECK:STDOUT: %.loc38_23.1: i32 = value_of_initializer %G.call -// CHECK:STDOUT: %.loc38_23.2: i32 = converted %G.call, %.loc38_23.1 +// CHECK:STDOUT: %G.call: init %i32 = call %.loc38_11.2(%.loc38_11.3) +// CHECK:STDOUT: %.loc38_23.1: %i32 = value_of_initializer %G.call +// CHECK:STDOUT: %.loc38_23.2: %i32 = converted %G.call, %.loc38_23.1 // CHECK:STDOUT: return %.loc38_23.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index 152d3e80ccf8..36f4eabc2b01 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -30,29 +30,32 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Class, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.k: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Class, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.k: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 4 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -68,74 +71,82 @@ fn Run() -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc21_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_15.1: type = value_of_initializer %int.make_type_32.loc21_15 [template = i32] -// CHECK:STDOUT: %.loc21_15.2: type = converted %int.make_type_32.loc21_15, %.loc21_15.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc21_23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_23.1: type = value_of_initializer %int.make_type_32.loc21_23 [template = i32] -// CHECK:STDOUT: %.loc21_23.2: type = converted %int.make_type_32.loc21_23, %.loc21_23.1 [template = i32] -// CHECK:STDOUT: %n.param.loc21: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n.loc21: i32 = bind_name n, %n.param.loc21 -// CHECK:STDOUT: %return.param.loc21: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param.loc21 +// CHECK:STDOUT: %.loc21_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21_15: init type = call constants.%Int(%.loc21_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_15.2: type = value_of_initializer %int.make_type_signed.loc21_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_15.3: type = converted %int.make_type_signed.loc21_15, %.loc21_15.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21_23: init type = call constants.%Int(%.loc21_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_23.2: type = value_of_initializer %int.make_type_signed.loc21_23 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_23.3: type = converted %int.make_type_signed.loc21_23, %.loc21_23.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param.loc21: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n.loc21: %i32 = bind_name n, %n.param.loc21 +// CHECK:STDOUT: %return.param.loc21: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param.loc21 // CHECK:STDOUT: } // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc25_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc25_13.2: type = converted %int.make_type_32, %.loc25_13.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc25_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc25_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc25_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc25_13.3: type = converted %int.make_type_signed, %.loc25_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc12_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_32.loc12_11 [template = i32] -// CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_32.loc12_11, %.loc12_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc12_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %int.make_type_32.loc12_19 [template = i32] -// CHECK:STDOUT: %.loc12_19.2: type = converted %int.make_type_32.loc12_19, %.loc12_19.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc12_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_11: init type = call constants.%Int(%.loc12_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_11.2: type = value_of_initializer %int.make_type_signed.loc12_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_11.3: type = converted %int.make_type_signed.loc12_11, %.loc12_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_19: init type = call constants.%Int(%.loc12_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_19.2: type = value_of_initializer %int.make_type_signed.loc12_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_19.3: type = converted %int.make_type_signed.loc12_19, %.loc12_19.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc16_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_11.1: type = value_of_initializer %int.make_type_32.loc16_11 [template = i32] -// CHECK:STDOUT: %.loc16_11.2: type = converted %int.make_type_32.loc16_11, %.loc16_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc16_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32.loc16_19 [template = i32] -// CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_32.loc16_19, %.loc16_19.1 [template = i32] -// CHECK:STDOUT: %n.param.loc16: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n.loc16: i32 = bind_name n, %n.param.loc16 -// CHECK:STDOUT: %return.param.loc16: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %.loc16_16: ref i32 = return_slot %return.param.loc16 +// CHECK:STDOUT: %.loc16_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16_11: init type = call constants.%Int(%.loc16_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_11.2: type = value_of_initializer %int.make_type_signed.loc16_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_11.3: type = converted %int.make_type_signed.loc16_11, %.loc16_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16_19: init type = call constants.%Int(%.loc16_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_19.2: type = value_of_initializer %int.make_type_signed.loc16_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_19.3: type = converted %int.make_type_signed.loc16_19, %.loc16_19.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param.loc16: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n.loc16: %i32 = bind_name n, %n.param.loc16 +// CHECK:STDOUT: %return.param.loc16: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %.loc16_16: ref %i32 = return_slot %return.param.loc16 // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc18_10.2: type = converted %int.make_type_32, %.loc18_10.1 [template = i32] -// CHECK:STDOUT: %.loc18_8: %.1 = field_decl k, element0 [template] -// CHECK:STDOUT: %.loc19: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc18_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc18_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc18_10.3: type = converted %int.make_type_signed, %.loc18_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_8: %.2 = field_decl k, element0 [template] +// CHECK:STDOUT: %.loc19: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -144,31 +155,32 @@ fn Run() -> i32 { // CHECK:STDOUT: .k = %.loc18_8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @F(%n.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n +// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%n.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @G(%n.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n.loc21 +// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n.loc21 // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Run() -> i32 { +// CHECK:STDOUT: fn @Run() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %F.ref: %F.type = name_ref F, @Class.%F.decl [template = constants.%F] -// CHECK:STDOUT: %.loc26_18.1: Core.IntLiteral = int_value 4 [template = constants.%.5] -// CHECK:STDOUT: %.loc26_18.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc26_18.3: = bound_method %.loc26_18.1, %.loc26_18.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc26_18.3(%.loc26_18.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc26_18.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.31] -// CHECK:STDOUT: %.loc26_18.5: i32 = converted %.loc26_18.1, %.loc26_18.4 [template = constants.%.31] -// CHECK:STDOUT: %F.call: init i32 = call %F.ref(%.loc26_18.5) -// CHECK:STDOUT: %.loc26_20.1: i32 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc26_20.2: i32 = converted %F.call, %.loc26_20.1 +// CHECK:STDOUT: %.loc26_18.1: Core.IntLiteral = int_value 4 [template = constants.%.6] +// CHECK:STDOUT: %.loc26_18.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc26_18.3: = bound_method %.loc26_18.1, %.loc26_18.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc26_18.4: = specific_function %.loc26_18.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc26_18.4(%.loc26_18.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc26_18.5: %i32 = value_of_initializer %int.convert_checked [template = constants.%.29] +// CHECK:STDOUT: %.loc26_18.6: %i32 = converted %.loc26_18.1, %.loc26_18.5 [template = constants.%.29] +// CHECK:STDOUT: %F.call: init %i32 = call %F.ref(%.loc26_18.6) +// CHECK:STDOUT: %.loc26_20.1: %i32 = value_of_initializer %F.call +// CHECK:STDOUT: %.loc26_20.2: %i32 = converted %F.call, %.loc26_20.1 // CHECK:STDOUT: return %.loc26_20.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/complete_in_member_fn.carbon b/toolchain/check/testdata/class/complete_in_member_fn.carbon index 8a6c5f4f18b0..e2ff6d641475 100644 --- a/toolchain/check/testdata/class/complete_in_member_fn.carbon +++ b/toolchain/check/testdata/class/complete_in_member_fn.carbon @@ -18,18 +18,20 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %C, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %C, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -48,23 +50,25 @@ class C { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %c.patt: %C = binding_pattern c // CHECK:STDOUT: %c.param_patt: %C = value_param_pattern %c.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_17.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_17.2: type = converted %int.make_type_32, %.loc12_17.1 [template = i32] +// CHECK:STDOUT: %.loc12_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_17.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_17.3: type = converted %int.make_type_signed, %.loc12_17.2 [template = constants.%i32] // CHECK:STDOUT: %c.param: %C = value_param runtime_param0 // CHECK:STDOUT: %c: %C = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_32, %.loc14_10.1 [template = i32] -// CHECK:STDOUT: %.loc14_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %.loc15: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc14_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_10.3: type = converted %int.make_type_signed, %.loc14_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc15: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -72,12 +76,12 @@ class C { // CHECK:STDOUT: .a = %.loc14_8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%c.param_patt: %C) -> i32 { +// CHECK:STDOUT: fn @F(%c.param_patt: %C) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c -// CHECK:STDOUT: %a.ref: %.1 = name_ref a, @C.%.loc14_8 [template = @C.%.loc14_8] -// CHECK:STDOUT: %.loc12_31.1: ref i32 = class_element_access %c.ref, element0 -// CHECK:STDOUT: %.loc12_31.2: i32 = bind_value %.loc12_31.1 +// CHECK:STDOUT: %a.ref: %.2 = name_ref a, @C.%.loc14_8 [template = @C.%.loc14_8] +// CHECK:STDOUT: %.loc12_31.1: ref %i32 = class_element_access %c.ref, element0 +// CHECK:STDOUT: %.loc12_31.2: %i32 = bind_value %.loc12_31.1 // CHECK:STDOUT: return %.loc12_31.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/compound_field.carbon b/toolchain/check/testdata/class/compound_field.carbon index 1c2b760a362d..ab87712b84ac 100644 --- a/toolchain/check/testdata/class/compound_field.carbon +++ b/toolchain/check/testdata/class/compound_field.carbon @@ -41,22 +41,24 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Base: type = class_type @Base [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Base, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: i32, .c: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Base, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32, .b: %i32, .c: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Derived, %Base [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, i32 [template] -// CHECK:STDOUT: %.7: type = struct_type {.base: %Base, .d: i32, .e: i32} [template] -// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, %Base [template] +// CHECK:STDOUT: %.7: type = unbound_element_type %Derived, %i32 [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %Base, .d: %i32, .e: %i32} [template] +// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] // CHECK:STDOUT: %AccessDerived.type: type = fn_type @AccessDerived [template] // CHECK:STDOUT: %AccessDerived: %AccessDerived.type = struct_value () [template] // CHECK:STDOUT: %AccessBase.type: type = fn_type @AccessBase [template] // CHECK:STDOUT: %AccessBase: %AccessBase.type = struct_value () [template] -// CHECK:STDOUT: %.12: type = ptr_type %Derived [template] -// CHECK:STDOUT: %.13: type = ptr_type i32 [template] +// CHECK:STDOUT: %.13: type = ptr_type %Derived [template] +// CHECK:STDOUT: %.14: type = ptr_type %i32 [template] // CHECK:STDOUT: %AccessDerivedIndirect.type: type = fn_type @AccessDerivedIndirect [template] // CHECK:STDOUT: %AccessDerivedIndirect: %AccessDerivedIndirect.type = struct_value () [template] // CHECK:STDOUT: %AccessBaseIndirect.type: type = fn_type @AccessBaseIndirect [template] @@ -65,7 +67,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -87,83 +89,90 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: %AccessDerived.decl: %AccessDerived.type = fn_decl @AccessDerived [template = constants.%AccessDerived] { // CHECK:STDOUT: %d.patt: %Derived = binding_pattern d // CHECK:STDOUT: %d.param_patt: %Derived = value_param_pattern %d.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref.loc24: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc24_33.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc24_33.2: type = converted %int.make_type_32, %.loc24_33.1 [template = i32] +// CHECK:STDOUT: %.loc24_33.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc24_33.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc24_33.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc24_33.3: type = converted %int.make_type_signed, %.loc24_33.2 [template = constants.%i32] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %AccessBase.decl: %AccessBase.type = fn_decl @AccessBase [template = constants.%AccessBase] { // CHECK:STDOUT: %d.patt: %Derived = binding_pattern d // CHECK:STDOUT: %d.param_patt: %Derived = value_param_pattern %d.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc28_30.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc28_30.2: type = converted %int.make_type_32, %.loc28_30.1 [template = i32] +// CHECK:STDOUT: %.loc28_30.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc28_30.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc28_30.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc28_30.3: type = converted %int.make_type_signed, %.loc28_30.2 [template = constants.%i32] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %AccessDerivedIndirect.decl: %AccessDerivedIndirect.type = fn_decl @AccessDerivedIndirect [template = constants.%AccessDerivedIndirect] { -// CHECK:STDOUT: %p.patt: %.12 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.12 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.13 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.13 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.13 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.13 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.14 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.14 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref.loc32: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %.loc32_36: type = ptr_type %Derived [template = constants.%.12] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc32_45.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc32_45.2: type = converted %int.make_type_32, %.loc32_45.1 [template = i32] -// CHECK:STDOUT: %.loc32_45.3: type = ptr_type i32 [template = constants.%.13] -// CHECK:STDOUT: %p.param: %.12 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.12 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.13 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.13 = return_slot %return.param +// CHECK:STDOUT: %.loc32_36: type = ptr_type %Derived [template = constants.%.13] +// CHECK:STDOUT: %.loc32_42: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc32_42) [template = constants.%i32] +// CHECK:STDOUT: %.loc32_45.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc32_45.2: type = converted %int.make_type_signed, %.loc32_45.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc32_45.3: type = ptr_type %i32 [template = constants.%.14] +// CHECK:STDOUT: %p.param: %.13 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.13 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.14 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.14 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %AccessBaseIndirect.decl: %AccessBaseIndirect.type = fn_decl @AccessBaseIndirect [template = constants.%AccessBaseIndirect] { -// CHECK:STDOUT: %p.patt: %.12 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.12 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.13 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.13 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.13 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.13 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.14 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.14 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %.loc36_33: type = ptr_type %Derived [template = constants.%.12] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc36_42.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc36_42.2: type = converted %int.make_type_32, %.loc36_42.1 [template = i32] -// CHECK:STDOUT: %.loc36_42.3: type = ptr_type i32 [template = constants.%.13] -// CHECK:STDOUT: %p.param: %.12 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.12 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.13 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.13 = return_slot %return.param +// CHECK:STDOUT: %.loc36_33: type = ptr_type %Derived [template = constants.%.13] +// CHECK:STDOUT: %.loc36_39: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc36_39) [template = constants.%i32] +// CHECK:STDOUT: %.loc36_42.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc36_42.2: type = converted %int.make_type_signed, %.loc36_42.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc36_42.3: type = ptr_type %i32 [template = constants.%.14] +// CHECK:STDOUT: %p.param: %.13 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.13 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.14 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.14 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] -// CHECK:STDOUT: %.loc13_8: %.1 = field_decl b, element1 [template] -// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] -// CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_32.loc14, %.loc14_10.1 [template = i32] -// CHECK:STDOUT: %.loc14_8: %.1 = field_decl c, element2 [template] -// CHECK:STDOUT: %.loc15: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed.loc12, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc13_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.3: type = converted %int.make_type_signed.loc13, %.loc13_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc14_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%.loc14_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_10.2: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_10.3: type = converted %int.make_type_signed.loc14, %.loc14_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_8: %.2 = field_decl c, element2 [template] +// CHECK:STDOUT: %.loc15: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -174,16 +183,18 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc18: %.5 = base_decl %Base, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc20_10.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32] -// CHECK:STDOUT: %.loc20_10.2: type = converted %int.make_type_32.loc20, %.loc20_10.1 [template = i32] -// CHECK:STDOUT: %.loc20_8: %.6 = field_decl d, element1 [template] -// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_10.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] -// CHECK:STDOUT: %.loc21_10.2: type = converted %int.make_type_32.loc21, %.loc21_10.1 [template = i32] -// CHECK:STDOUT: %.loc21_8: %.6 = field_decl e, element2 [template] -// CHECK:STDOUT: %.loc22: = complete_type_witness %.7 [template = constants.%.8] +// CHECK:STDOUT: %.loc18: %.6 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc20_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%.loc20_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc20_10.2: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] +// CHECK:STDOUT: %.loc20_10.3: type = converted %int.make_type_signed.loc20, %.loc20_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc20_8: %.7 = field_decl d, element1 [template] +// CHECK:STDOUT: %.loc21_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%.loc21_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_10.2: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_10.3: type = converted %int.make_type_signed.loc21, %.loc21_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_8: %.7 = field_decl e, element2 [template] +// CHECK:STDOUT: %.loc22: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -193,49 +204,49 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: extend %Base.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessDerived(%d.param_patt: %Derived) -> i32 { +// CHECK:STDOUT: fn @AccessDerived(%d.param_patt: %Derived) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref.loc25_10: %Derived = name_ref d, %d // CHECK:STDOUT: %Derived.ref.loc25: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %d.ref.loc25_20: %.6 = name_ref d, @Derived.%.loc20_8 [template = @Derived.%.loc20_8] -// CHECK:STDOUT: %.loc25_11.1: ref i32 = class_element_access %d.ref.loc25_10, element1 -// CHECK:STDOUT: %.loc25_11.2: i32 = bind_value %.loc25_11.1 +// CHECK:STDOUT: %d.ref.loc25_20: %.7 = name_ref d, @Derived.%.loc20_8 [template = @Derived.%.loc20_8] +// CHECK:STDOUT: %.loc25_11.1: ref %i32 = class_element_access %d.ref.loc25_10, element1 +// CHECK:STDOUT: %.loc25_11.2: %i32 = bind_value %.loc25_11.1 // CHECK:STDOUT: return %.loc25_11.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessBase(%d.param_patt: %Derived) -> i32 { +// CHECK:STDOUT: fn @AccessBase(%d.param_patt: %Derived) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %b.ref: %.1 = name_ref b, @Base.%.loc13_8 [template = @Base.%.loc13_8] +// CHECK:STDOUT: %b.ref: %.2 = name_ref b, @Base.%.loc13_8 [template = @Base.%.loc13_8] // CHECK:STDOUT: %.loc29_11.1: ref %Base = class_element_access %d.ref, element0 // CHECK:STDOUT: %.loc29_11.2: ref %Base = converted %d.ref, %.loc29_11.1 -// CHECK:STDOUT: %.loc29_11.3: ref i32 = class_element_access %.loc29_11.2, element1 -// CHECK:STDOUT: %.loc29_11.4: i32 = bind_value %.loc29_11.3 +// CHECK:STDOUT: %.loc29_11.3: ref %i32 = class_element_access %.loc29_11.2, element1 +// CHECK:STDOUT: %.loc29_11.4: %i32 = bind_value %.loc29_11.3 // CHECK:STDOUT: return %.loc29_11.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessDerivedIndirect(%p.param_patt: %.12) -> %.13 { +// CHECK:STDOUT: fn @AccessDerivedIndirect(%p.param_patt: %.13) -> %.14 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.12 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.13 = name_ref p, %p // CHECK:STDOUT: %Derived.ref.loc33: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %d.ref: %.6 = name_ref d, @Derived.%.loc20_8 [template = @Derived.%.loc20_8] +// CHECK:STDOUT: %d.ref: %.7 = name_ref d, @Derived.%.loc20_8 [template = @Derived.%.loc20_8] // CHECK:STDOUT: %.loc33_12.1: ref %Derived = deref %p.ref -// CHECK:STDOUT: %.loc33_12.2: ref i32 = class_element_access %.loc33_12.1, element1 -// CHECK:STDOUT: %.loc33_10: %.13 = addr_of %.loc33_12.2 +// CHECK:STDOUT: %.loc33_12.2: ref %i32 = class_element_access %.loc33_12.1, element1 +// CHECK:STDOUT: %.loc33_10: %.14 = addr_of %.loc33_12.2 // CHECK:STDOUT: return %.loc33_10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessBaseIndirect(%p.param_patt: %.12) -> %.13 { +// CHECK:STDOUT: fn @AccessBaseIndirect(%p.param_patt: %.13) -> %.14 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.12 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.13 = name_ref p, %p // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %b.ref: %.1 = name_ref b, @Base.%.loc13_8 [template = @Base.%.loc13_8] +// CHECK:STDOUT: %b.ref: %.2 = name_ref b, @Base.%.loc13_8 [template = @Base.%.loc13_8] // CHECK:STDOUT: %.loc37_12.1: ref %Derived = deref %p.ref // CHECK:STDOUT: %.loc37_12.2: ref %Base = class_element_access %.loc37_12.1, element0 // CHECK:STDOUT: %.loc37_12.3: ref %Base = converted %.loc37_12.1, %.loc37_12.2 -// CHECK:STDOUT: %.loc37_12.4: ref i32 = class_element_access %.loc37_12.3, element1 -// CHECK:STDOUT: %.loc37_10: %.13 = addr_of %.loc37_12.4 +// CHECK:STDOUT: %.loc37_12.4: ref %i32 = class_element_access %.loc37_12.3, element1 +// CHECK:STDOUT: %.loc37_10: %.14 = addr_of %.loc37_12.4 // CHECK:STDOUT: return %.loc37_10 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/derived_to_base.carbon b/toolchain/check/testdata/class/derived_to_base.carbon index bb3dd2bc3580..ca6e53ccd8a8 100644 --- a/toolchain/check/testdata/class/derived_to_base.carbon +++ b/toolchain/check/testdata/class/derived_to_base.carbon @@ -42,26 +42,28 @@ fn ConvertInit() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %A, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %A, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %B, %A [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %B, i32 [template] -// CHECK:STDOUT: %.7: type = struct_type {.base: %A, .b: i32} [template] -// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %B, %A [template] +// CHECK:STDOUT: %.7: type = unbound_element_type %B, %i32 [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %A, .b: %i32} [template] +// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %.12: type = unbound_element_type %C, %B [template] -// CHECK:STDOUT: %.13: type = unbound_element_type %C, i32 [template] -// CHECK:STDOUT: %.14: type = struct_type {.base: %B, .c: i32} [template] -// CHECK:STDOUT: %.15: = complete_type_witness %.14 [template] -// CHECK:STDOUT: %.16: type = ptr_type %C [template] -// CHECK:STDOUT: %.17: type = ptr_type %B [template] +// CHECK:STDOUT: %.13: type = unbound_element_type %C, %B [template] +// CHECK:STDOUT: %.14: type = unbound_element_type %C, %i32 [template] +// CHECK:STDOUT: %.15: type = struct_type {.base: %B, .c: %i32} [template] +// CHECK:STDOUT: %.16: = complete_type_witness %.15 [template] +// CHECK:STDOUT: %.17: type = ptr_type %C [template] +// CHECK:STDOUT: %.18: type = ptr_type %B [template] // CHECK:STDOUT: %ConvertCToB.type: type = fn_type @ConvertCToB [template] // CHECK:STDOUT: %ConvertCToB: %ConvertCToB.type = struct_value () [template] -// CHECK:STDOUT: %.21: type = ptr_type %A [template] +// CHECK:STDOUT: %.22: type = ptr_type %A [template] // CHECK:STDOUT: %ConvertBToA.type: type = fn_type @ConvertBToA [template] // CHECK:STDOUT: %ConvertBToA: %ConvertBToA.type = struct_value () [template] // CHECK:STDOUT: %ConvertCToA.type: type = fn_type @ConvertCToA [template] @@ -72,30 +74,33 @@ fn ConvertInit() { // CHECK:STDOUT: %ConvertRef: %ConvertRef.type = struct_value () [template] // CHECK:STDOUT: %ConvertInit.type: type = fn_type @ConvertInit [template] // CHECK:STDOUT: %ConvertInit: %ConvertInit.type = struct_value () [template] -// CHECK:STDOUT: %.22: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.23: type = struct_type {.a: Core.IntLiteral} [template] -// CHECK:STDOUT: %.24: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.25: type = struct_type {.base: %.23, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.27: type = struct_type {.base: %.25, .c: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.51: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.52: = bound_method %.22, %Convert.15 [template] -// CHECK:STDOUT: %.53: i32 = int_value 1 [template] -// CHECK:STDOUT: %struct.1: %A = struct_value (%.53) [template] -// CHECK:STDOUT: %.54: = bound_method %.24, %Convert.15 [template] -// CHECK:STDOUT: %.55: i32 = int_value 2 [template] -// CHECK:STDOUT: %struct.2: %B = struct_value (%struct.1, %.55) [template] -// CHECK:STDOUT: %.56: = bound_method %.26, %Convert.15 [template] -// CHECK:STDOUT: %.57: i32 = int_value 3 [template] +// CHECK:STDOUT: %.23: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.24: type = struct_type {.a: Core.IntLiteral} [template] +// CHECK:STDOUT: %.25: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.26: type = struct_type {.base: %.24, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.28: type = struct_type {.base: %.26, .c: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.48: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.49: = bound_method %.23, %Convert.14 [template] +// CHECK:STDOUT: %.50: = specific_function %.49, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.51: %i32 = int_value 1 [template] +// CHECK:STDOUT: %struct.1: %A = struct_value (%.51) [template] +// CHECK:STDOUT: %.52: = bound_method %.25, %Convert.14 [template] +// CHECK:STDOUT: %.53: = specific_function %.52, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.54: %i32 = int_value 2 [template] +// CHECK:STDOUT: %struct.2: %B = struct_value (%struct.1, %.54) [template] +// CHECK:STDOUT: %.55: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.56: = specific_function %.55, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.57: %i32 = int_value 3 [template] // CHECK:STDOUT: %struct.3: %C = struct_value (%struct.2, %.57) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -120,49 +125,49 @@ fn ConvertInit() { // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %ConvertCToB.decl: %ConvertCToB.type = fn_decl @ConvertCToB [template = constants.%ConvertCToB] { -// CHECK:STDOUT: %p.patt: %.16 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.16 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.17 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.17 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc25_20: type = ptr_type %C [template = constants.%.16] -// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc25_27: type = ptr_type %B [template = constants.%.17] -// CHECK:STDOUT: %p.param: %.16 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.16 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.17 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.17 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %ConvertBToA.decl: %ConvertBToA.type = fn_decl @ConvertBToA [template = constants.%ConvertBToA] { // CHECK:STDOUT: %p.patt: %.17 = binding_pattern p // CHECK:STDOUT: %p.param_patt: %.17 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.21 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.21 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc26_20: type = ptr_type %B [template = constants.%.17] -// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc26_27: type = ptr_type %A [template = constants.%.21] -// CHECK:STDOUT: %p.param: %.17 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.17 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.21 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.21 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %ConvertCToA.decl: %ConvertCToA.type = fn_decl @ConvertCToA [template = constants.%ConvertCToA] { -// CHECK:STDOUT: %p.patt: %.16 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.16 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.21 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.21 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %.18 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.18 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc27_20: type = ptr_type %C [template = constants.%.16] +// CHECK:STDOUT: %.loc25_20: type = ptr_type %C [template = constants.%.17] +// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] +// CHECK:STDOUT: %.loc25_27: type = ptr_type %B [template = constants.%.18] +// CHECK:STDOUT: %p.param: %.17 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.17 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.18 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.18 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %ConvertBToA.decl: %ConvertBToA.type = fn_decl @ConvertBToA [template = constants.%ConvertBToA] { +// CHECK:STDOUT: %p.patt: %.18 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.18 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.22 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.22 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] +// CHECK:STDOUT: %.loc26_20: type = ptr_type %B [template = constants.%.18] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc27_27: type = ptr_type %A [template = constants.%.21] -// CHECK:STDOUT: %p.param: %.16 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.16 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.21 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.21 = return_slot %return.param +// CHECK:STDOUT: %.loc26_27: type = ptr_type %A [template = constants.%.22] +// CHECK:STDOUT: %p.param: %.18 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.18 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.22 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.22 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %ConvertCToA.decl: %ConvertCToA.type = fn_decl @ConvertCToA [template = constants.%ConvertCToA] { +// CHECK:STDOUT: %p.patt: %.17 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.17 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.22 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.22 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %.loc27_20: type = ptr_type %C [template = constants.%.17] +// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] +// CHECK:STDOUT: %.loc27_27: type = ptr_type %A [template = constants.%.22] +// CHECK:STDOUT: %p.param: %.17 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.17 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.22 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.22 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertValue.decl: %ConvertValue.type = fn_decl @ConvertValue [template = constants.%ConvertValue] { // CHECK:STDOUT: %c.patt: %C = binding_pattern c @@ -173,29 +178,30 @@ fn ConvertInit() { // CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertRef.decl: %ConvertRef.type = fn_decl @ConvertRef [template = constants.%ConvertRef] { -// CHECK:STDOUT: %c.patt: %.16 = binding_pattern c -// CHECK:STDOUT: %c.param_patt: %.16 = value_param_pattern %c.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.21 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.21 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %c.patt: %.17 = binding_pattern c +// CHECK:STDOUT: %c.param_patt: %.17 = value_param_pattern %c.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.22 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.22 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc33_19: type = ptr_type %C [template = constants.%.16] +// CHECK:STDOUT: %.loc33_19: type = ptr_type %C [template = constants.%.17] // CHECK:STDOUT: %A.ref.loc33: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc33_26: type = ptr_type %A [template = constants.%.21] -// CHECK:STDOUT: %c.param: %.16 = value_param runtime_param0 -// CHECK:STDOUT: %c: %.16 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref %.21 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.21 = return_slot %return.param +// CHECK:STDOUT: %.loc33_26: type = ptr_type %A [template = constants.%.22] +// CHECK:STDOUT: %c.param: %.17 = value_param runtime_param0 +// CHECK:STDOUT: %c: %.17 = bind_name c, %c.param +// CHECK:STDOUT: %return.param: ref %.22 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.22 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertInit.decl: %ConvertInit.type = fn_decl @ConvertInit [template = constants.%ConvertInit] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -204,12 +210,13 @@ fn ConvertInit() { // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc16: %.5 = base_decl %A, element0 [template] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc17_10.2: type = converted %int.make_type_32, %.loc17_10.1 [template = i32] -// CHECK:STDOUT: %.loc17_8: %.6 = field_decl b, element1 [template] -// CHECK:STDOUT: %.loc18: = complete_type_witness %.7 [template = constants.%.8] +// CHECK:STDOUT: %.loc16: %.6 = base_decl %A, element0 [template] +// CHECK:STDOUT: %.loc17_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc17_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc17_10.3: type = converted %int.make_type_signed, %.loc17_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_8: %.7 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc18: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -220,12 +227,13 @@ fn ConvertInit() { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc21: %.12 = base_decl %B, element0 [template] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc22_10.2: type = converted %int.make_type_32, %.loc22_10.1 [template = i32] -// CHECK:STDOUT: %.loc22_8: %.13 = field_decl c, element1 [template] -// CHECK:STDOUT: %.loc23: = complete_type_witness %.14 [template = constants.%.15] +// CHECK:STDOUT: %.loc21: %.13 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc22_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc22_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc22_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc22_10.3: type = converted %int.make_type_signed, %.loc22_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc22_8: %.14 = field_decl c, element1 [template] +// CHECK:STDOUT: %.loc23: = complete_type_witness %.15 [template = constants.%.16] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -234,34 +242,34 @@ fn ConvertInit() { // CHECK:STDOUT: extend %B.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertCToB(%p.param_patt: %.16) -> %.17 { +// CHECK:STDOUT: fn @ConvertCToB(%p.param_patt: %.17) -> %.18 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.16 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.17 = name_ref p, %p // CHECK:STDOUT: %.loc25_39.1: ref %C = deref %p.ref // CHECK:STDOUT: %.loc25_39.2: ref %B = class_element_access %.loc25_39.1, element0 -// CHECK:STDOUT: %.loc25_39.3: %.17 = addr_of %.loc25_39.2 -// CHECK:STDOUT: %.loc25_39.4: %.17 = converted %p.ref, %.loc25_39.3 +// CHECK:STDOUT: %.loc25_39.3: %.18 = addr_of %.loc25_39.2 +// CHECK:STDOUT: %.loc25_39.4: %.18 = converted %p.ref, %.loc25_39.3 // CHECK:STDOUT: return %.loc25_39.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertBToA(%p.param_patt: %.17) -> %.21 { +// CHECK:STDOUT: fn @ConvertBToA(%p.param_patt: %.18) -> %.22 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.17 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.18 = name_ref p, %p // CHECK:STDOUT: %.loc26_39.1: ref %B = deref %p.ref // CHECK:STDOUT: %.loc26_39.2: ref %A = class_element_access %.loc26_39.1, element0 -// CHECK:STDOUT: %.loc26_39.3: %.21 = addr_of %.loc26_39.2 -// CHECK:STDOUT: %.loc26_39.4: %.21 = converted %p.ref, %.loc26_39.3 +// CHECK:STDOUT: %.loc26_39.3: %.22 = addr_of %.loc26_39.2 +// CHECK:STDOUT: %.loc26_39.4: %.22 = converted %p.ref, %.loc26_39.3 // CHECK:STDOUT: return %.loc26_39.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertCToA(%p.param_patt: %.16) -> %.21 { +// CHECK:STDOUT: fn @ConvertCToA(%p.param_patt: %.17) -> %.22 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.16 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.17 = name_ref p, %p // CHECK:STDOUT: %.loc27_39.1: ref %C = deref %p.ref // CHECK:STDOUT: %.loc27_39.2: ref %B = class_element_access %.loc27_39.1, element0 // CHECK:STDOUT: %.loc27_39.3: ref %A = class_element_access %.loc27_39.2, element0 -// CHECK:STDOUT: %.loc27_39.4: %.21 = addr_of %.loc27_39.3 -// CHECK:STDOUT: %.loc27_39.5: %.21 = converted %p.ref, %.loc27_39.4 +// CHECK:STDOUT: %.loc27_39.4: %.22 = addr_of %.loc27_39.3 +// CHECK:STDOUT: %.loc27_39.5: %.22 = converted %p.ref, %.loc27_39.4 // CHECK:STDOUT: return %.loc27_39.5 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -277,56 +285,59 @@ fn ConvertInit() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertRef(%c.param_patt: %.16) -> %.21 { +// CHECK:STDOUT: fn @ConvertRef(%c.param_patt: %.17) -> %.22 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %c.ref: %.16 = name_ref c, %c +// CHECK:STDOUT: %c.ref: %.17 = name_ref c, %c // CHECK:STDOUT: %.loc34_12: ref %C = deref %c.ref // CHECK:STDOUT: %A.ref.loc34: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc34_15.1: ref %B = class_element_access %.loc34_12, element0 // CHECK:STDOUT: %.loc34_15.2: ref %A = class_element_access %.loc34_15.1, element0 // CHECK:STDOUT: %.loc34_15.3: ref %A = converted %.loc34_12, %.loc34_15.2 -// CHECK:STDOUT: %.loc34_10: %.21 = addr_of %.loc34_15.3 +// CHECK:STDOUT: %.loc34_10: %.22 = addr_of %.loc34_15.3 // CHECK:STDOUT: return %.loc34_10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @ConvertInit() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc38_38: Core.IntLiteral = int_value 1 [template = constants.%.22] -// CHECK:STDOUT: %.loc38_39.1: %.23 = struct_literal (%.loc38_38) -// CHECK:STDOUT: %.loc38_47: Core.IntLiteral = int_value 2 [template = constants.%.24] -// CHECK:STDOUT: %.loc38_48.1: %.25 = struct_literal (%.loc38_39.1, %.loc38_47) -// CHECK:STDOUT: %.loc38_56: Core.IntLiteral = int_value 3 [template = constants.%.26] -// CHECK:STDOUT: %.loc38_57.1: %.27 = struct_literal (%.loc38_48.1, %.loc38_56) +// CHECK:STDOUT: %.loc38_38: Core.IntLiteral = int_value 1 [template = constants.%.23] +// CHECK:STDOUT: %.loc38_39.1: %.24 = struct_literal (%.loc38_38) +// CHECK:STDOUT: %.loc38_47: Core.IntLiteral = int_value 2 [template = constants.%.25] +// CHECK:STDOUT: %.loc38_48.1: %.26 = struct_literal (%.loc38_39.1, %.loc38_47) +// CHECK:STDOUT: %.loc38_56: Core.IntLiteral = int_value 3 [template = constants.%.27] +// CHECK:STDOUT: %.loc38_57.1: %.28 = struct_literal (%.loc38_48.1, %.loc38_56) // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc38_39.2: %Convert.type.2 = interface_witness_access constants.%.51, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc38_39.3: = bound_method %.loc38_38, %.loc38_39.2 [template = constants.%.52] -// CHECK:STDOUT: %int.convert_checked.loc38_39: init i32 = call %.loc38_39.3(%.loc38_38) [template = constants.%.53] -// CHECK:STDOUT: %.loc38_39.4: init i32 = converted %.loc38_38, %int.convert_checked.loc38_39 [template = constants.%.53] +// CHECK:STDOUT: %.loc38_39.2: %Convert.type.2 = interface_witness_access constants.%.48, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc38_39.3: = bound_method %.loc38_38, %.loc38_39.2 [template = constants.%.49] +// CHECK:STDOUT: %.loc38_39.4: = specific_function %.loc38_39.3, @Convert.2(constants.%.1) [template = constants.%.50] +// CHECK:STDOUT: %int.convert_checked.loc38_39: init %i32 = call %.loc38_39.4(%.loc38_38) [template = constants.%.51] +// CHECK:STDOUT: %.loc38_39.5: init %i32 = converted %.loc38_38, %int.convert_checked.loc38_39 [template = constants.%.51] // CHECK:STDOUT: %.loc38_57.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc38_57.3: ref %B = class_element_access %.loc38_57.2, element0 // CHECK:STDOUT: %.loc38_48.2: ref %A = class_element_access %.loc38_57.3, element0 -// CHECK:STDOUT: %.loc38_39.5: ref i32 = class_element_access %.loc38_48.2, element0 -// CHECK:STDOUT: %.loc38_39.6: init i32 = initialize_from %.loc38_39.4 to %.loc38_39.5 [template = constants.%.53] -// CHECK:STDOUT: %.loc38_39.7: init %A = class_init (%.loc38_39.6), %.loc38_48.2 [template = constants.%struct.1] -// CHECK:STDOUT: %.loc38_48.3: init %A = converted %.loc38_39.1, %.loc38_39.7 [template = constants.%struct.1] -// CHECK:STDOUT: %.loc38_48.4: %Convert.type.2 = interface_witness_access constants.%.51, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc38_48.5: = bound_method %.loc38_47, %.loc38_48.4 [template = constants.%.54] -// CHECK:STDOUT: %int.convert_checked.loc38_48: init i32 = call %.loc38_48.5(%.loc38_47) [template = constants.%.55] -// CHECK:STDOUT: %.loc38_48.6: init i32 = converted %.loc38_47, %int.convert_checked.loc38_48 [template = constants.%.55] -// CHECK:STDOUT: %.loc38_48.7: ref i32 = class_element_access %.loc38_57.3, element1 -// CHECK:STDOUT: %.loc38_48.8: init i32 = initialize_from %.loc38_48.6 to %.loc38_48.7 [template = constants.%.55] -// CHECK:STDOUT: %.loc38_48.9: init %B = class_init (%.loc38_48.3, %.loc38_48.8), %.loc38_57.3 [template = constants.%struct.2] -// CHECK:STDOUT: %.loc38_57.4: init %B = converted %.loc38_48.1, %.loc38_48.9 [template = constants.%struct.2] -// CHECK:STDOUT: %.loc38_57.5: %Convert.type.2 = interface_witness_access constants.%.51, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc38_57.6: = bound_method %.loc38_56, %.loc38_57.5 [template = constants.%.56] -// CHECK:STDOUT: %int.convert_checked.loc38_57: init i32 = call %.loc38_57.6(%.loc38_56) [template = constants.%.57] -// CHECK:STDOUT: %.loc38_57.7: init i32 = converted %.loc38_56, %int.convert_checked.loc38_57 [template = constants.%.57] -// CHECK:STDOUT: %.loc38_57.8: ref i32 = class_element_access %.loc38_57.2, element1 -// CHECK:STDOUT: %.loc38_57.9: init i32 = initialize_from %.loc38_57.7 to %.loc38_57.8 [template = constants.%.57] -// CHECK:STDOUT: %.loc38_57.10: init %C = class_init (%.loc38_57.4, %.loc38_57.9), %.loc38_57.2 [template = constants.%struct.3] -// CHECK:STDOUT: %.loc38_57.11: ref %C = temporary %.loc38_57.2, %.loc38_57.10 -// CHECK:STDOUT: %.loc38_59: ref %C = converted %.loc38_57.1, %.loc38_57.11 +// CHECK:STDOUT: %.loc38_39.6: ref %i32 = class_element_access %.loc38_48.2, element0 +// CHECK:STDOUT: %.loc38_39.7: init %i32 = initialize_from %.loc38_39.5 to %.loc38_39.6 [template = constants.%.51] +// CHECK:STDOUT: %.loc38_39.8: init %A = class_init (%.loc38_39.7), %.loc38_48.2 [template = constants.%struct.1] +// CHECK:STDOUT: %.loc38_48.3: init %A = converted %.loc38_39.1, %.loc38_39.8 [template = constants.%struct.1] +// CHECK:STDOUT: %.loc38_48.4: %Convert.type.2 = interface_witness_access constants.%.48, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc38_48.5: = bound_method %.loc38_47, %.loc38_48.4 [template = constants.%.52] +// CHECK:STDOUT: %.loc38_48.6: = specific_function %.loc38_48.5, @Convert.2(constants.%.1) [template = constants.%.53] +// CHECK:STDOUT: %int.convert_checked.loc38_48: init %i32 = call %.loc38_48.6(%.loc38_47) [template = constants.%.54] +// CHECK:STDOUT: %.loc38_48.7: init %i32 = converted %.loc38_47, %int.convert_checked.loc38_48 [template = constants.%.54] +// CHECK:STDOUT: %.loc38_48.8: ref %i32 = class_element_access %.loc38_57.3, element1 +// CHECK:STDOUT: %.loc38_48.9: init %i32 = initialize_from %.loc38_48.7 to %.loc38_48.8 [template = constants.%.54] +// CHECK:STDOUT: %.loc38_48.10: init %B = class_init (%.loc38_48.3, %.loc38_48.9), %.loc38_57.3 [template = constants.%struct.2] +// CHECK:STDOUT: %.loc38_57.4: init %B = converted %.loc38_48.1, %.loc38_48.10 [template = constants.%struct.2] +// CHECK:STDOUT: %.loc38_57.5: %Convert.type.2 = interface_witness_access constants.%.48, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc38_57.6: = bound_method %.loc38_56, %.loc38_57.5 [template = constants.%.55] +// CHECK:STDOUT: %.loc38_57.7: = specific_function %.loc38_57.6, @Convert.2(constants.%.1) [template = constants.%.56] +// CHECK:STDOUT: %int.convert_checked.loc38_57: init %i32 = call %.loc38_57.7(%.loc38_56) [template = constants.%.57] +// CHECK:STDOUT: %.loc38_57.8: init %i32 = converted %.loc38_56, %int.convert_checked.loc38_57 [template = constants.%.57] +// CHECK:STDOUT: %.loc38_57.9: ref %i32 = class_element_access %.loc38_57.2, element1 +// CHECK:STDOUT: %.loc38_57.10: init %i32 = initialize_from %.loc38_57.8 to %.loc38_57.9 [template = constants.%.57] +// CHECK:STDOUT: %.loc38_57.11: init %C = class_init (%.loc38_57.4, %.loc38_57.10), %.loc38_57.2 [template = constants.%struct.3] +// CHECK:STDOUT: %.loc38_57.12: ref %C = temporary %.loc38_57.2, %.loc38_57.11 +// CHECK:STDOUT: %.loc38_59: ref %C = converted %.loc38_57.1, %.loc38_57.12 // CHECK:STDOUT: %.loc38_63.1: ref %B = class_element_access %.loc38_59, element0 // CHECK:STDOUT: %.loc38_63.2: ref %A = class_element_access %.loc38_63.1, element0 // CHECK:STDOUT: %.loc38_63.3: ref %A = converted %.loc38_59, %.loc38_63.2 diff --git a/toolchain/check/testdata/class/extend_adapt.carbon b/toolchain/check/testdata/class/extend_adapt.carbon index 63e867dce508..a245a56183ba 100644 --- a/toolchain/check/testdata/class/extend_adapt.carbon +++ b/toolchain/check/testdata/class/extend_adapt.carbon @@ -142,17 +142,19 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %SomeClassAdapter: type = class_type @SomeClassAdapter [template] // CHECK:STDOUT: %SomeClass: type = class_type @SomeClass [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %SomeClass, i32 [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %SomeClass, %i32 [template] // CHECK:STDOUT: %StaticMemberFunction.type: type = fn_type @StaticMemberFunction [template] // CHECK:STDOUT: %StaticMemberFunction: %StaticMemberFunction.type = struct_value () [template] // CHECK:STDOUT: %AdapterMethod.type: type = fn_type @AdapterMethod [template] // CHECK:STDOUT: %AdapterMethod: %AdapterMethod.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] -// CHECK:STDOUT: %.5: = complete_type_witness %SomeClass [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.6: = complete_type_witness %SomeClass [template] // CHECK:STDOUT: %TestStaticMemberFunction.type: type = fn_type @TestStaticMemberFunction [template] // CHECK:STDOUT: %TestStaticMemberFunction: %TestStaticMemberFunction.type = struct_value () [template] // CHECK:STDOUT: %TestAdapterMethod.type: type = fn_type @TestAdapterMethod [template] @@ -161,7 +163,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -200,7 +202,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: class @SomeClassAdapter { // CHECK:STDOUT: %SomeClass.ref: type = name_ref SomeClass, file.%SomeClass.decl [template = constants.%SomeClass] // CHECK:STDOUT: adapt_decl %SomeClass -// CHECK:STDOUT: %.loc17: = complete_type_witness %SomeClass [template = constants.%.5] +// CHECK:STDOUT: %.loc17: = complete_type_witness %SomeClass [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClassAdapter @@ -208,14 +210,16 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @SomeClass { -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_10.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_10.2: type = converted %int.make_type_32.loc7, %.loc7_10.1 [template = i32] -// CHECK:STDOUT: %.loc7_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] -// CHECK:STDOUT: %.loc8_10.2: type = converted %int.make_type_32.loc8, %.loc8_10.1 [template = i32] -// CHECK:STDOUT: %.loc8_8: %.1 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc7_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%.loc7_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_10.2: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_10.3: type = converted %int.make_type_signed.loc7, %.loc7_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc8_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_10.2: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_10.3: type = converted %int.make_type_signed.loc8, %.loc8_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8: %.2 = field_decl b, element1 [template] // CHECK:STDOUT: %StaticMemberFunction.decl: %StaticMemberFunction.type = fn_decl @StaticMemberFunction [template = constants.%StaticMemberFunction] {} {} // CHECK:STDOUT: %AdapterMethod.decl: %AdapterMethod.type = fn_decl @AdapterMethod [template = constants.%AdapterMethod] { // CHECK:STDOUT: %self.patt: %SomeClassAdapter = binding_pattern self @@ -225,7 +229,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %self.param: %SomeClassAdapter = value_param runtime_param0 // CHECK:STDOUT: %self: %SomeClassAdapter = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClass @@ -341,20 +345,22 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %SomeClass: type = class_type @SomeClass [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %SomeClass, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %SomeClass, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %SomeClassAdapter: type = class_type @SomeClassAdapter [template] -// CHECK:STDOUT: %.5: = complete_type_witness %SomeClass [template] +// CHECK:STDOUT: %.6: = complete_type_witness %SomeClass [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -374,30 +380,33 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a // CHECK:STDOUT: %a.param_patt: %SomeClassAdapter = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl [template = constants.%SomeClassAdapter] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_30.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_30.2: type = converted %int.make_type_32, %.loc13_30.1 [template = i32] +// CHECK:STDOUT: %.loc13_30.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_30.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_30.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_30.3: type = converted %int.make_type_signed, %.loc13_30.2 [template = constants.%i32] // CHECK:STDOUT: %a.param: %SomeClassAdapter = value_param runtime_param0 // CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @SomeClass { -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_32.loc5, %.loc5_10.1 [template = i32] -// CHECK:STDOUT: %.loc5_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_32.loc6, %.loc6_10.1 [template = i32] -// CHECK:STDOUT: %.loc6_8: %.1 = field_decl b, element1 [template] -// CHECK:STDOUT: %.loc7: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.3: type = converted %int.make_type_signed.loc5, %.loc5_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc6_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_10.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_10.3: type = converted %int.make_type_signed.loc6, %.loc6_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc7: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClass @@ -408,19 +417,19 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: class @SomeClassAdapter { // CHECK:STDOUT: %SomeClass.ref: type = name_ref SomeClass, file.%SomeClass.decl [template = constants.%SomeClass] // CHECK:STDOUT: adapt_decl %SomeClass -// CHECK:STDOUT: %.loc11: = complete_type_witness %SomeClass [template = constants.%.5] +// CHECK:STDOUT: %.loc11: = complete_type_witness %SomeClass [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClassAdapter // CHECK:STDOUT: extend %SomeClass.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%a.param_patt: %SomeClassAdapter) -> i32 { +// CHECK:STDOUT: fn @F(%a.param_patt: %SomeClassAdapter) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a -// CHECK:STDOUT: %b.ref: %.1 = name_ref b, @SomeClass.%.loc6_8 [template = @SomeClass.%.loc6_8] +// CHECK:STDOUT: %b.ref: %.2 = name_ref b, @SomeClass.%.loc6_8 [template = @SomeClass.%.loc6_8] // CHECK:STDOUT: %.loc21_11.1: %SomeClass = converted %a.ref, [template = ] -// CHECK:STDOUT: %.loc21_11.2: i32 = class_element_access , element1 [template = ] +// CHECK:STDOUT: %.loc21_11.2: %i32 = class_element_access , element1 [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -428,17 +437,19 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %StructAdapter: type = class_type @StructAdapter [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.2 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -455,37 +466,40 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %a.patt: %StructAdapter = binding_pattern a // CHECK:STDOUT: %a.param_patt: %StructAdapter = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %StructAdapter.ref: type = name_ref StructAdapter, file.%StructAdapter.decl [template = constants.%StructAdapter] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_27.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_27.2: type = converted %int.make_type_32, %.loc8_27.1 [template = i32] +// CHECK:STDOUT: %.loc8_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_27.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_27.3: type = converted %int.make_type_signed, %.loc8_27.2 [template = constants.%i32] // CHECK:STDOUT: %a.param: %StructAdapter = value_param runtime_param0 // CHECK:STDOUT: %a: %StructAdapter = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @StructAdapter { -// CHECK:STDOUT: %int.make_type_32.loc5_21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_21.1: type = value_of_initializer %int.make_type_32.loc5_21 [template = i32] -// CHECK:STDOUT: %.loc5_21.2: type = converted %int.make_type_32.loc5_21, %.loc5_21.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_30: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_30.1: type = value_of_initializer %int.make_type_32.loc5_30 [template = i32] -// CHECK:STDOUT: %.loc5_30.2: type = converted %int.make_type_32.loc5_30, %.loc5_30.1 [template = i32] -// CHECK:STDOUT: %.loc5_33: type = struct_type {.a: i32, .b: i32} [template = constants.%.1] -// CHECK:STDOUT: adapt_decl %.1 -// CHECK:STDOUT: %.loc6: = complete_type_witness %.1 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_21: init type = call constants.%Int(%.loc5_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_21.2: type = value_of_initializer %int.make_type_signed.loc5_21 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_21.3: type = converted %int.make_type_signed.loc5_21, %.loc5_21.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_30.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_30: init type = call constants.%Int(%.loc5_30.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_30.2: type = value_of_initializer %int.make_type_signed.loc5_30 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_30.3: type = converted %int.make_type_signed.loc5_30, %.loc5_30.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_33: type = struct_type {.a: %i32, .b: %i32} [template = constants.%.2] +// CHECK:STDOUT: adapt_decl %.2 +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%StructAdapter // CHECK:STDOUT: extend %.loc5_33 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%a.param_patt: %StructAdapter) -> i32 { +// CHECK:STDOUT: fn @F(%a.param_patt: %StructAdapter) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %StructAdapter = name_ref a, %a // CHECK:STDOUT: %b.ref: = name_ref b, [template = ] @@ -496,19 +510,21 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %TupleAdapter: type = class_type @TupleAdapter [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.2: = complete_type_witness %tuple.type.2 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %.3: = complete_type_witness %tuple.type.2 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -525,41 +541,44 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %a.patt: %TupleAdapter = binding_pattern a // CHECK:STDOUT: %a.param_patt: %TupleAdapter = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %TupleAdapter.ref: type = name_ref TupleAdapter, file.%TupleAdapter.decl [template = constants.%TupleAdapter] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_26.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_26.2: type = converted %int.make_type_32, %.loc8_26.1 [template = i32] +// CHECK:STDOUT: %.loc8_26.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_26.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_26.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_26.3: type = converted %int.make_type_signed, %.loc8_26.2 [template = constants.%i32] // CHECK:STDOUT: %a.param: %TupleAdapter = value_param runtime_param0 // CHECK:STDOUT: %a: %TupleAdapter = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @TupleAdapter { -// CHECK:STDOUT: %int.make_type_32.loc5_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_25: %tuple.type.1 = tuple_literal (%int.make_type_32.loc5_17, %int.make_type_32.loc5_22) -// CHECK:STDOUT: %.loc5_26.1: type = value_of_initializer %int.make_type_32.loc5_17 [template = i32] -// CHECK:STDOUT: %.loc5_26.2: type = converted %int.make_type_32.loc5_17, %.loc5_26.1 [template = i32] -// CHECK:STDOUT: %.loc5_26.3: type = value_of_initializer %int.make_type_32.loc5_22 [template = i32] -// CHECK:STDOUT: %.loc5_26.4: type = converted %int.make_type_32.loc5_22, %.loc5_26.3 [template = i32] +// CHECK:STDOUT: %.loc5_17: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_17: init type = call constants.%Int(%.loc5_17) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_22: init type = call constants.%Int(%.loc5_22) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_25: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc5_17, %int.make_type_signed.loc5_22) +// CHECK:STDOUT: %.loc5_26.1: type = value_of_initializer %int.make_type_signed.loc5_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_26.2: type = converted %int.make_type_signed.loc5_17, %.loc5_26.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_26.3: type = value_of_initializer %int.make_type_signed.loc5_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_26.4: type = converted %int.make_type_signed.loc5_22, %.loc5_26.3 [template = constants.%i32] // CHECK:STDOUT: %.loc5_26.5: type = converted %.loc5_25, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: adapt_decl %tuple.type.2 -// CHECK:STDOUT: %.loc6: = complete_type_witness %tuple.type.2 [template = constants.%.2] +// CHECK:STDOUT: %.loc6: = complete_type_witness %tuple.type.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%TupleAdapter // CHECK:STDOUT: extend %.loc5_26.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%a.param_patt: %TupleAdapter) -> i32 { +// CHECK:STDOUT: fn @F(%a.param_patt: %TupleAdapter) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %TupleAdapter = name_ref a, %a -// CHECK:STDOUT: %.loc14: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc14: Core.IntLiteral = int_value 1 [template = constants.%.4] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -572,10 +591,10 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %MakeInt: %MakeInt.type = struct_value () [template] // CHECK:STDOUT: %IntAdapter: type = class_type @IntAdapter [template] // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %.2: type = int_type signed, %.1 [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } @@ -583,7 +602,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .IntLiteral = %import_ref.1 -// CHECK:STDOUT: .Int32 = %import_ref.2 +// CHECK:STDOUT: .Int = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -618,28 +637,29 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %a.patt: %IntAdapter = binding_pattern a // CHECK:STDOUT: %a.param_patt: %IntAdapter = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %IntAdapter.ref: type = name_ref IntAdapter, file.%IntAdapter.decl [template = constants.%IntAdapter] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_24.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc10_24.2: type = converted %int.make_type_32, %.loc10_24.1 [template = i32] +// CHECK:STDOUT: %.loc10_24.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc10_24.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_24.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc10_24.3: type = converted %int.make_type_signed, %.loc10_24.2 [template = constants.%i32] // CHECK:STDOUT: %a.param: %IntAdapter = value_param runtime_param0 // CHECK:STDOUT: %a: %IntAdapter = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @IntAdapter { // CHECK:STDOUT: %MakeInt.ref: %MakeInt.type = name_ref MakeInt, file.%MakeInt.decl [template = constants.%MakeInt] // CHECK:STDOUT: %.loc7_24: Core.IntLiteral = int_value 32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_signed: init type = call %MakeInt.ref(%.loc7_24) [template = constants.%.2] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed [template = constants.%.2] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed, %.loc7_27.1 [template = constants.%.2] -// CHECK:STDOUT: adapt_decl %.2 -// CHECK:STDOUT: %.loc8: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call %MakeInt.ref(%.loc7_24) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: adapt_decl %i32 +// CHECK:STDOUT: %.loc8: = complete_type_witness %i32 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%IntAdapter @@ -648,7 +668,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @MakeInt(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%a.param_patt: %IntAdapter) -> i32 { +// CHECK:STDOUT: fn @F(%a.param_patt: %IntAdapter) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %IntAdapter = name_ref a, %a // CHECK:STDOUT: %foo.ref: = name_ref foo, [template = ] diff --git a/toolchain/check/testdata/class/fail_abstract.carbon b/toolchain/check/testdata/class/fail_abstract.carbon index fadb840bc77e..584b23d677b0 100644 --- a/toolchain/check/testdata/class/fail_abstract.carbon +++ b/toolchain/check/testdata/class/fail_abstract.carbon @@ -440,22 +440,24 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %.4: type = unbound_element_type %Derived, %Abstract [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Derived, i32 [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %Abstract, .d: i32} [template] -// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.5 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, %i32 [template] +// CHECK:STDOUT: %.7: type = struct_type {.base: %Abstract, .d: %i32} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] -// CHECK:STDOUT: %.11: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.12: type = struct_type {.a: Core.IntLiteral} [template] -// CHECK:STDOUT: %.13: Core.IntLiteral = int_value 7 [template] -// CHECK:STDOUT: %.14: type = struct_type {.base: %.12, .d: Core.IntLiteral} [template] +// CHECK:STDOUT: %.12: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.13: type = struct_type {.a: Core.IntLiteral} [template] +// CHECK:STDOUT: %.14: Core.IntLiteral = int_value 7 [template] +// CHECK:STDOUT: %.15: type = struct_type {.base: %.13, .d: Core.IntLiteral} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -491,11 +493,12 @@ fn CallReturnAbstract() { // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %.loc8: %.4 = base_decl %Abstract, element0 [template] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc10_10.2: type = converted %int.make_type_32, %.loc10_10.1 [template = i32] -// CHECK:STDOUT: %.loc10_8: %.5 = field_decl d, element1 [template] -// CHECK:STDOUT: %.loc11: = complete_type_witness %.6 [template = constants.%.7] +// CHECK:STDOUT: %.loc10_10.1: Core.IntLiteral = int_value 32 [template = constants.%.5] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc10_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc10_10.3: type = converted %int.make_type_signed, %.loc10_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8: %.6 = field_decl d, element1 [template] +// CHECK:STDOUT: %.loc11: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -506,10 +509,10 @@ fn CallReturnAbstract() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Make() -> %return: %Derived { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc22_25: Core.IntLiteral = int_value 1 [template = constants.%.11] -// CHECK:STDOUT: %.loc22_26: %.12 = struct_literal (%.loc22_25) -// CHECK:STDOUT: %.loc22_34: Core.IntLiteral = int_value 7 [template = constants.%.13] -// CHECK:STDOUT: %.loc22_35: %.14 = struct_literal (%.loc22_26, %.loc22_34) +// CHECK:STDOUT: %.loc22_25: Core.IntLiteral = int_value 1 [template = constants.%.12] +// CHECK:STDOUT: %.loc22_26: %.13 = struct_literal (%.loc22_25) +// CHECK:STDOUT: %.loc22_34: Core.IntLiteral = int_value 7 [template = constants.%.14] +// CHECK:STDOUT: %.loc22_35: %.15 = struct_literal (%.loc22_26, %.loc22_34) // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -521,18 +524,20 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %.4: type = unbound_element_type %Derived, %Abstract [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Derived, i32 [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %Abstract, .d: i32} [template] -// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.5 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, %i32 [template] +// CHECK:STDOUT: %.7: type = struct_type {.base: %Abstract, .d: %i32} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] // CHECK:STDOUT: %Return.type: type = fn_type @Return [template] // CHECK:STDOUT: %Return: %Return.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -573,11 +578,12 @@ fn CallReturnAbstract() { // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %.loc8: %.4 = base_decl %Abstract, element0 [template] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc10_10.2: type = converted %int.make_type_32, %.loc10_10.1 [template = i32] -// CHECK:STDOUT: %.loc10_8: %.5 = field_decl d, element1 [template] -// CHECK:STDOUT: %.loc11: = complete_type_witness %.6 [template = constants.%.7] +// CHECK:STDOUT: %.loc10_10.1: Core.IntLiteral = int_value 32 [template = constants.%.5] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc10_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc10_10.3: type = converted %int.make_type_signed, %.loc10_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8: %.6 = field_decl d, element1 [template] +// CHECK:STDOUT: %.loc11: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -596,23 +602,25 @@ fn CallReturnAbstract() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Abstract: type = class_type @Abstract [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Abstract, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Abstract, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Derived, %Abstract [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, i32 [template] -// CHECK:STDOUT: %.7: type = struct_type {.base: %Abstract, .d: i32} [template] -// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, %Abstract [template] +// CHECK:STDOUT: %.7: type = unbound_element_type %Derived, %i32 [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %Abstract, .d: %i32} [template] +// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] // CHECK:STDOUT: %Access.type: type = fn_type @Access [template] // CHECK:STDOUT: %Access: %Access.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -631,26 +639,28 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %Access.decl: %Access.type = fn_decl @Access [template = constants.%Access] { // CHECK:STDOUT: %d.patt: %Derived = binding_pattern d // CHECK:STDOUT: %d.param_patt: %Derived = value_param_pattern %d.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_26.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_26.2: type = converted %int.make_type_32, %.loc14_26.1 [template = i32] +// CHECK:STDOUT: %.loc14_26.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_26.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_26.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_26.3: type = converted %int.make_type_signed, %.loc14_26.2 [template = constants.%i32] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Abstract { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_32, %.loc5_10.1 [template = i32] -// CHECK:STDOUT: %.loc5_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc5_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.3: type = converted %int.make_type_signed, %.loc5_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Abstract @@ -659,12 +669,13 @@ fn CallReturnAbstract() { // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] -// CHECK:STDOUT: %.loc9: %.5 = base_decl %Abstract, element0 [template] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_10.2: type = converted %int.make_type_32, %.loc11_10.1 [template = i32] -// CHECK:STDOUT: %.loc11_8: %.6 = field_decl d, element1 [template] -// CHECK:STDOUT: %.loc12: = complete_type_witness %.7 [template = constants.%.8] +// CHECK:STDOUT: %.loc9: %.6 = base_decl %Abstract, element0 [template] +// CHECK:STDOUT: %.loc11_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_10.3: type = converted %int.make_type_signed, %.loc11_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_8: %.7 = field_decl d, element1 [template] +// CHECK:STDOUT: %.loc12: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -673,10 +684,10 @@ fn CallReturnAbstract() { // CHECK:STDOUT: extend %Abstract.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Access(%d.param_patt: %Derived) -> i32 { +// CHECK:STDOUT: fn @Access(%d.param_patt: %Derived) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d -// CHECK:STDOUT: %base.ref: %.5 = name_ref base, @Derived.%.loc9 [template = @Derived.%.loc9] +// CHECK:STDOUT: %base.ref: %.6 = name_ref base, @Derived.%.loc9 [template = @Derived.%.loc9] // CHECK:STDOUT: %.loc15: ref %Abstract = class_element_access %d.ref, element0 // CHECK:STDOUT: %a.ref: = name_ref a, [template = ] // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon index 8a641b7ba11e..79301649031a 100644 --- a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon +++ b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon @@ -81,14 +81,16 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %AdaptWithBase: type = class_type @AdaptWithBase [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %AdaptWithBase, %Base [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.3 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %AdaptWithBase, %Base [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -113,12 +115,13 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @AdaptWithBase { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_12.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc10_12.2: type = converted %int.make_type_32, %.loc10_12.1 [template = i32] -// CHECK:STDOUT: adapt_decl i32 +// CHECK:STDOUT: %.loc10_9: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc10_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_12.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc10_12.2: type = converted %int.make_type_signed, %.loc10_12.1 [template = constants.%i32] +// CHECK:STDOUT: adapt_decl %i32 // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc15: %.4 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc15: %.5 = base_decl %Base, element0 [template] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptWithBase @@ -130,16 +133,18 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %AdaptWithField: type = class_type @AdaptWithField [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %AdaptWithField, i32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %AdaptWithField, %i32 [template] // CHECK:STDOUT: %AdaptWithFields: type = class_type @AdaptWithFields [template] -// CHECK:STDOUT: %.2: type = unbound_element_type %AdaptWithFields, i32 [template] +// CHECK:STDOUT: %.3: type = unbound_element_type %AdaptWithFields, %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -157,14 +162,16 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @AdaptWithField { -// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_12.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] -// CHECK:STDOUT: %.loc8_12.2: type = converted %int.make_type_32.loc8, %.loc8_12.1 [template = i32] -// CHECK:STDOUT: adapt_decl i32 -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] -// CHECK:STDOUT: %.loc13_8: %.1 = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc8_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_12.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_12.2: type = converted %int.make_type_signed.loc8, %.loc8_12.1 [template = constants.%i32] +// CHECK:STDOUT: adapt_decl %i32 +// CHECK:STDOUT: %.loc13_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.3: type = converted %int.make_type_signed.loc13, %.loc13_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8: %.2 = field_decl n, element0 [template] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptWithField @@ -172,22 +179,26 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @AdaptWithFields { -// CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc20_12.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32] -// CHECK:STDOUT: %.loc20_12.2: type = converted %int.make_type_32.loc20, %.loc20_12.1 [template = i32] -// CHECK:STDOUT: adapt_decl i32 -// CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc25_10.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] -// CHECK:STDOUT: %.loc25_10.2: type = converted %int.make_type_32.loc25, %.loc25_10.1 [template = i32] -// CHECK:STDOUT: %.loc25_8: %.2 = field_decl a, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc26: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc26_10.1: type = value_of_initializer %int.make_type_32.loc26 [template = i32] -// CHECK:STDOUT: %.loc26_10.2: type = converted %int.make_type_32.loc26, %.loc26_10.1 [template = i32] -// CHECK:STDOUT: %.loc26_8: %.2 = field_decl b, element1 [template] -// CHECK:STDOUT: %int.make_type_32.loc27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc27_10.1: type = value_of_initializer %int.make_type_32.loc27 [template = i32] -// CHECK:STDOUT: %.loc27_10.2: type = converted %int.make_type_32.loc27, %.loc27_10.1 [template = i32] -// CHECK:STDOUT: %.loc27_8: %.2 = field_decl c, element2 [template] +// CHECK:STDOUT: %.loc20_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%.loc20_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc20_12.1: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] +// CHECK:STDOUT: %.loc20_12.2: type = converted %int.make_type_signed.loc20, %.loc20_12.1 [template = constants.%i32] +// CHECK:STDOUT: adapt_decl %i32 +// CHECK:STDOUT: %.loc25_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc25: init type = call constants.%Int(%.loc25_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc25_10.2: type = value_of_initializer %int.make_type_signed.loc25 [template = constants.%i32] +// CHECK:STDOUT: %.loc25_10.3: type = converted %int.make_type_signed.loc25, %.loc25_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc25_8: %.3 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc26_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc26: init type = call constants.%Int(%.loc26_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc26_10.2: type = value_of_initializer %int.make_type_signed.loc26 [template = constants.%i32] +// CHECK:STDOUT: %.loc26_10.3: type = converted %int.make_type_signed.loc26, %.loc26_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc26_8: %.3 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc27_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc27: init type = call constants.%Int(%.loc27_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc27_10.2: type = value_of_initializer %int.make_type_signed.loc27 [template = constants.%i32] +// CHECK:STDOUT: %.loc27_10.3: type = converted %int.make_type_signed.loc27, %.loc27_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc27_8: %.3 = field_decl c, element2 [template] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptWithFields @@ -204,14 +215,16 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %AdaptWithBaseAndFields: type = class_type @AdaptWithBaseAndFields [template] // CHECK:STDOUT: %.4: type = unbound_element_type %AdaptWithBaseAndFields, %Base [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %AdaptWithBaseAndFields, i32 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.5 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %AdaptWithBaseAndFields, %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -238,10 +251,11 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: class @AdaptWithBaseAndFields { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc7: %.4 = base_decl %Base, element0 [template] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_10.2: type = converted %int.make_type_32, %.loc8_10.1 [template = i32] -// CHECK:STDOUT: %.loc8_8: %.5 = field_decl n, element1 [template] +// CHECK:STDOUT: %.loc8_10.1: Core.IntLiteral = int_value 32 [template = constants.%.5] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_10.3: type = converted %int.make_type_signed, %.loc8_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8: %.6 = field_decl n, element1 [template] // CHECK:STDOUT: %.loc15_10: %.1 = struct_literal () // CHECK:STDOUT: %.loc15_11: type = converted %.loc15_10, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: adapt_decl %.1 diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index 620753ce7c43..3189bf60ac05 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -183,15 +183,17 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %DeriveFromError: type = class_type @DeriveFromError [template] // CHECK:STDOUT: %.1: type = ptr_type %DeriveFromError [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.2 [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseError.type: type = fn_type @AccessMemberWithInvalidBaseError [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseError: %AccessMemberWithInvalidBaseError.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -208,18 +210,19 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %AccessMemberWithInvalidBaseError.decl: %AccessMemberWithInvalidBaseError.type = fn_decl @AccessMemberWithInvalidBaseError [template = constants.%AccessMemberWithInvalidBaseError] { // CHECK:STDOUT: %p.patt: %.1 = binding_pattern p // CHECK:STDOUT: %p.param_patt: %.1 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromError.ref: type = name_ref DeriveFromError, file.%DeriveFromError.decl [template = constants.%DeriveFromError] // CHECK:STDOUT: %.loc13_55: type = ptr_type %DeriveFromError [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_61.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_61.2: type = converted %int.make_type_32, %.loc13_61.1 [template = i32] +// CHECK:STDOUT: %.loc13_61.1: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_61.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_61.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_61.3: type = converted %int.make_type_signed, %.loc13_61.2 [template = constants.%i32] // CHECK:STDOUT: %p.param: %.1 = value_param runtime_param0 // CHECK:STDOUT: %p: %.1 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -234,7 +237,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: has_error // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseError(%p.param_patt: %.1) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseError(%p.param_patt: %.1) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.1 = name_ref p, %p // CHECK:STDOUT: %.loc13_75: ref %DeriveFromError = deref %p.ref @@ -247,9 +250,10 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %DeriveFromNonType: type = class_type @DeriveFromNonType [template] // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %.27: type = ptr_type %DeriveFromNonType [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.21: type = ptr_type %DeriveFromNonType [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %AccessMemberWithInvalidBasNonType.type: type = fn_type @AccessMemberWithInvalidBasNonType [template] // CHECK:STDOUT: %AccessMemberWithInvalidBasNonType: %AccessMemberWithInvalidBasNonType.type = struct_value () [template] // CHECK:STDOUT: } @@ -257,7 +261,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.1 -// CHECK:STDOUT: .Int32 = %import_ref.51 +// CHECK:STDOUT: .Int = %import_ref.37 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -272,20 +276,21 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %DeriveFromNonType.decl: type = class_decl @DeriveFromNonType [template = constants.%DeriveFromNonType] {} {} // CHECK:STDOUT: %AccessMemberWithInvalidBasNonType.decl: %AccessMemberWithInvalidBasNonType.type = fn_decl @AccessMemberWithInvalidBasNonType [template = constants.%AccessMemberWithInvalidBasNonType] { -// CHECK:STDOUT: %p.patt: %.27 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.27 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.21 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.21 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromNonType.ref: type = name_ref DeriveFromNonType, file.%DeriveFromNonType.decl [template = constants.%DeriveFromNonType] -// CHECK:STDOUT: %.loc15_58: type = ptr_type %DeriveFromNonType [template = constants.%.27] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_64.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_64.2: type = converted %int.make_type_32, %.loc15_64.1 [template = i32] -// CHECK:STDOUT: %p.param: %.27 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.27 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc15_58: type = ptr_type %DeriveFromNonType [template = constants.%.21] +// CHECK:STDOUT: %.loc15_64.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_64.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_64.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_64.3: type = converted %int.make_type_signed, %.loc15_64.2 [template = constants.%i32] +// CHECK:STDOUT: %p.param: %.21 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.21 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -301,9 +306,9 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: has_error // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBasNonType(%p.param_patt: %.27) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBasNonType(%p.param_patt: %.21) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.27 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.21 = name_ref p, %p // CHECK:STDOUT: %.loc15_78: ref %DeriveFromNonType = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return @@ -313,10 +318,12 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %DeriveFromi32: type = class_type @DeriveFromi32 [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = ptr_type %DeriveFromi32 [template] -// CHECK:STDOUT: %.2: type = ptr_type i32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = ptr_type %DeriveFromi32 [template] +// CHECK:STDOUT: %.3: type = ptr_type %i32 [template] // CHECK:STDOUT: %ConvertToBadBasei32.type: type = fn_type @ConvertToBadBasei32 [template] // CHECK:STDOUT: %ConvertToBadBasei32: %ConvertToBadBasei32.type = struct_value () [template] // CHECK:STDOUT: %AccessMemberWithInvalidBasei32.type: type = fn_type @AccessMemberWithInvalidBasei32 [template] @@ -325,7 +332,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -342,44 +349,47 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %DeriveFromi32.decl: type = class_decl @DeriveFromi32 [template = constants.%DeriveFromi32] {} {} // CHECK:STDOUT: %ConvertToBadBasei32.decl: %ConvertToBadBasei32.type = fn_decl @ConvertToBadBasei32 [template = constants.%ConvertToBadBasei32] { -// CHECK:STDOUT: %p.patt: %.1 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.1 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.2 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.2 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.3 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.3 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromi32.ref: type = name_ref DeriveFromi32, file.%DeriveFromi32.decl [template = constants.%DeriveFromi32] -// CHECK:STDOUT: %.loc21_40: type = ptr_type %DeriveFromi32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_49.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc21_49.2: type = converted %int.make_type_32, %.loc21_49.1 [template = i32] -// CHECK:STDOUT: %.loc21_49.3: type = ptr_type i32 [template = constants.%.2] -// CHECK:STDOUT: %p.param: %.1 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.1 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param +// CHECK:STDOUT: %.loc21_40: type = ptr_type %DeriveFromi32 [template = constants.%.2] +// CHECK:STDOUT: %.loc21_46: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc21_46) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_49.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc21_49.2: type = converted %int.make_type_signed, %.loc21_49.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_49.3: type = ptr_type %i32 [template = constants.%.3] +// CHECK:STDOUT: %p.param: %.2 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.2 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.3 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.3 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBasei32.decl: %AccessMemberWithInvalidBasei32.type = fn_decl @AccessMemberWithInvalidBasei32 [template = constants.%AccessMemberWithInvalidBasei32] { -// CHECK:STDOUT: %p.patt: %.1 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.1 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.2 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.2 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromi32.ref: type = name_ref DeriveFromi32, file.%DeriveFromi32.decl [template = constants.%DeriveFromi32] -// CHECK:STDOUT: %.loc23_51: type = ptr_type %DeriveFromi32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_57.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc23_57.2: type = converted %int.make_type_32, %.loc23_57.1 [template = i32] -// CHECK:STDOUT: %p.param: %.1 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.1 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc23_51: type = ptr_type %DeriveFromi32 [template = constants.%.2] +// CHECK:STDOUT: %.loc23_57.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc23_57.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_57.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc23_57.3: type = converted %int.make_type_signed, %.loc23_57.2 [template = constants.%i32] +// CHECK:STDOUT: %p.param: %.2 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.2 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @DeriveFromi32 { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_16.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc7_16.2: type = converted %int.make_type_32, %.loc7_16.1 [template = i32] +// CHECK:STDOUT: %.loc7_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc7_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_16.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc7_16.3: type = converted %int.make_type_signed, %.loc7_16.2 [template = constants.%i32] // CHECK:STDOUT: %.loc7_19: = base_decl , element0 [template] // CHECK:STDOUT: %.loc8: = complete_type_witness [template = ] // CHECK:STDOUT: @@ -389,16 +399,16 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: has_error // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertToBadBasei32(%p.param_patt: %.1) -> %.2 { +// CHECK:STDOUT: fn @ConvertToBadBasei32(%p.param_patt: %.2) -> %.3 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.1 = name_ref p, %p -// CHECK:STDOUT: %.loc21_61: %.2 = converted %p.ref, [template = ] +// CHECK:STDOUT: %p.ref: %.2 = name_ref p, %p +// CHECK:STDOUT: %.loc21_61: %.3 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBasei32(%p.param_patt: %.1) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBasei32(%p.param_patt: %.2) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.1 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.2 = name_ref p, %p // CHECK:STDOUT: %.loc23_71: ref %DeriveFromi32 = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return @@ -417,8 +427,10 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %.5: type = ptr_type %tuple.type.2 [template] // CHECK:STDOUT: %ConvertToBadBaseTuple.type: type = fn_type @ConvertToBadBaseTuple [template] // CHECK:STDOUT: %ConvertToBadBaseTuple: %ConvertToBadBaseTuple.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.25: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.25 [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseTuple.type: type = fn_type @AccessMemberWithInvalidBaseTuple [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseTuple: %AccessMemberWithInvalidBaseTuple.type = struct_value () [template] // CHECK:STDOUT: } @@ -426,7 +438,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.1 -// CHECK:STDOUT: .Int32 = %import_ref.51 +// CHECK:STDOUT: .Int = %import_ref.37 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -463,18 +475,19 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %AccessMemberWithInvalidBaseTuple.decl: %AccessMemberWithInvalidBaseTuple.type = fn_decl @AccessMemberWithInvalidBaseTuple [template = constants.%AccessMemberWithInvalidBaseTuple] { // CHECK:STDOUT: %p.patt: %.4 = binding_pattern p // CHECK:STDOUT: %p.param_patt: %.4 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromTuple.ref: type = name_ref DeriveFromTuple, file.%DeriveFromTuple.decl [template = constants.%DeriveFromTuple] // CHECK:STDOUT: %.loc23_55: type = ptr_type %DeriveFromTuple [template = constants.%.4] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_61.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc23_61.2: type = converted %int.make_type_32, %.loc23_61.1 [template = i32] +// CHECK:STDOUT: %.loc23_61.1: Core.IntLiteral = int_value 32 [template = constants.%.25] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc23_61.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_61.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc23_61.3: type = converted %int.make_type_signed, %.loc23_61.2 [template = constants.%i32] // CHECK:STDOUT: %p.param: %.4 = value_param runtime_param0 // CHECK:STDOUT: %p: %.4 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -505,7 +518,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseTuple(%p.param_patt: %.4) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseTuple(%p.param_patt: %.4) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p // CHECK:STDOUT: %.loc23_75: ref %DeriveFromTuple = deref %p.ref @@ -517,11 +530,13 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %DeriveFromStruct: type = class_type @DeriveFromStruct [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.2: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.3: type = ptr_type %DeriveFromStruct [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %DeriveFromStruct [template] // CHECK:STDOUT: %ConvertToBadBaseStruct.type: type = fn_type @ConvertToBadBaseStruct [template] // CHECK:STDOUT: %ConvertToBadBaseStruct: %ConvertToBadBaseStruct.type = struct_value () [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseStruct.type: type = fn_type @AccessMemberWithInvalidBaseStruct [template] @@ -530,7 +545,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -547,52 +562,57 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %DeriveFromStruct.decl: type = class_decl @DeriveFromStruct [template = constants.%DeriveFromStruct] {} {} // CHECK:STDOUT: %ConvertToBadBaseStruct.decl: %ConvertToBadBaseStruct.type = fn_decl @ConvertToBadBaseStruct [template = constants.%ConvertToBadBaseStruct] { -// CHECK:STDOUT: %p.patt: %.3 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.3 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.4 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.3 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.3 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromStruct.ref: type = name_ref DeriveFromStruct, file.%DeriveFromStruct.decl [template = constants.%DeriveFromStruct] -// CHECK:STDOUT: %.loc21_46: type = ptr_type %DeriveFromStruct [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_32.loc21_57: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_57.1: type = value_of_initializer %int.make_type_32.loc21_57 [template = i32] -// CHECK:STDOUT: %.loc21_57.2: type = converted %int.make_type_32.loc21_57, %.loc21_57.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc21_66: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_66.1: type = value_of_initializer %int.make_type_32.loc21_66 [template = i32] -// CHECK:STDOUT: %.loc21_66.2: type = converted %int.make_type_32.loc21_66, %.loc21_66.1 [template = i32] -// CHECK:STDOUT: %.loc21_69: type = struct_type {.a: i32, .b: i32} [template = constants.%.1] -// CHECK:STDOUT: %.loc21_70: type = ptr_type %.1 [template = constants.%.2] -// CHECK:STDOUT: %p.param: %.3 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.3 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param +// CHECK:STDOUT: %.loc21_46: type = ptr_type %DeriveFromStruct [template = constants.%.4] +// CHECK:STDOUT: %.loc21_57.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21_57: init type = call constants.%Int(%.loc21_57.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_57.2: type = value_of_initializer %int.make_type_signed.loc21_57 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_57.3: type = converted %int.make_type_signed.loc21_57, %.loc21_57.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_66.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21_66: init type = call constants.%Int(%.loc21_66.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_66.2: type = value_of_initializer %int.make_type_signed.loc21_66 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_66.3: type = converted %int.make_type_signed.loc21_66, %.loc21_66.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_69: type = struct_type {.a: %i32, .b: %i32} [template = constants.%.2] +// CHECK:STDOUT: %.loc21_70: type = ptr_type %.2 [template = constants.%.3] +// CHECK:STDOUT: %p.param: %.4 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.3 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.3 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseStruct.decl: %AccessMemberWithInvalidBaseStruct.type = fn_decl @AccessMemberWithInvalidBaseStruct [template = constants.%AccessMemberWithInvalidBaseStruct] { -// CHECK:STDOUT: %p.patt: %.3 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.3 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.4 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromStruct.ref: type = name_ref DeriveFromStruct, file.%DeriveFromStruct.decl [template = constants.%DeriveFromStruct] -// CHECK:STDOUT: %.loc24_57: type = ptr_type %DeriveFromStruct [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc24_63.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc24_63.2: type = converted %int.make_type_32, %.loc24_63.1 [template = i32] -// CHECK:STDOUT: %p.param: %.3 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.3 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc24_57: type = ptr_type %DeriveFromStruct [template = constants.%.4] +// CHECK:STDOUT: %.loc24_63.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc24_63.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc24_63.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc24_63.3: type = converted %int.make_type_signed, %.loc24_63.2 [template = constants.%i32] +// CHECK:STDOUT: %p.param: %.4 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @DeriveFromStruct { -// CHECK:STDOUT: %int.make_type_32.loc9_21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_21.1: type = value_of_initializer %int.make_type_32.loc9_21 [template = i32] -// CHECK:STDOUT: %.loc9_21.2: type = converted %int.make_type_32.loc9_21, %.loc9_21.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc9_30: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_30.1: type = value_of_initializer %int.make_type_32.loc9_30 [template = i32] -// CHECK:STDOUT: %.loc9_30.2: type = converted %int.make_type_32.loc9_30, %.loc9_30.1 [template = i32] -// CHECK:STDOUT: %.loc9_33: type = struct_type {.a: i32, .b: i32} [template = constants.%.1] +// CHECK:STDOUT: %.loc9_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc9_21: init type = call constants.%Int(%.loc9_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_21.2: type = value_of_initializer %int.make_type_signed.loc9_21 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_21.3: type = converted %int.make_type_signed.loc9_21, %.loc9_21.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_30.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc9_30: init type = call constants.%Int(%.loc9_30.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_30.2: type = value_of_initializer %int.make_type_signed.loc9_30 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_30.3: type = converted %int.make_type_signed.loc9_30, %.loc9_30.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_33: type = struct_type {.a: %i32, .b: %i32} [template = constants.%.2] // CHECK:STDOUT: %.loc9_34: = base_decl , element0 [template] // CHECK:STDOUT: %.loc10: = complete_type_witness [template = ] // CHECK:STDOUT: @@ -602,16 +622,16 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: has_error // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertToBadBaseStruct(%p.param_patt: %.3) -> %.2 { +// CHECK:STDOUT: fn @ConvertToBadBaseStruct(%p.param_patt: %.4) -> %.3 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.3 = name_ref p, %p -// CHECK:STDOUT: %.loc21_82: %.2 = converted %p.ref, [template = ] +// CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p +// CHECK:STDOUT: %.loc21_82: %.3 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseStruct(%p.param_patt: %.3) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseStruct(%p.param_patt: %.4) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.3 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p // CHECK:STDOUT: %.loc24_77: ref %DeriveFromStruct = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return @@ -626,8 +646,10 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %.2: type = ptr_type %Incomplete [template] // CHECK:STDOUT: %ConvertToBadBaseIncomplete.type: type = fn_type @ConvertToBadBaseIncomplete [template] // CHECK:STDOUT: %ConvertToBadBaseIncomplete: %ConvertToBadBaseIncomplete.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.22: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.22 [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseIncomplete.type: type = fn_type @AccessMemberWithInvalidBaseIncomplete [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseIncomplete: %AccessMemberWithInvalidBaseIncomplete.type = struct_value () [template] // CHECK:STDOUT: } @@ -635,7 +657,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.1 -// CHECK:STDOUT: .Int32 = %import_ref.51 +// CHECK:STDOUT: .Int = %import_ref.37 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -670,18 +692,19 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %AccessMemberWithInvalidBaseIncomplete.decl: %AccessMemberWithInvalidBaseIncomplete.type = fn_decl @AccessMemberWithInvalidBaseIncomplete [template = constants.%AccessMemberWithInvalidBaseIncomplete] { // CHECK:STDOUT: %p.patt: %.1 = binding_pattern p // CHECK:STDOUT: %p.param_patt: %.1 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromIncomplete.ref: type = name_ref DeriveFromIncomplete, file.%DeriveFromIncomplete.decl [template = constants.%DeriveFromIncomplete] // CHECK:STDOUT: %.loc30_65: type = ptr_type %DeriveFromIncomplete [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc30_71.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc30_71.2: type = converted %int.make_type_32, %.loc30_71.1 [template = i32] +// CHECK:STDOUT: %.loc30_71.1: Core.IntLiteral = int_value 32 [template = constants.%.22] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc30_71.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc30_71.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc30_71.3: type = converted %int.make_type_signed, %.loc30_71.2 [template = constants.%i32] // CHECK:STDOUT: %p.param: %.1 = value_param runtime_param0 // CHECK:STDOUT: %p: %.1 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -705,7 +728,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseIncomplete(%p.param_patt: %.1) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseIncomplete(%p.param_patt: %.1) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.1 = name_ref p, %p // CHECK:STDOUT: %.loc30_85: ref %DeriveFromIncomplete = deref %p.ref @@ -717,17 +740,19 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Final: type = class_type @Final [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Final, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Final, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %DeriveFromFinal: type = class_type @DeriveFromFinal [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %DeriveFromFinal, %Final [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %Final} [template] -// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] -// CHECK:STDOUT: %.8: type = ptr_type %DeriveFromFinal [template] -// CHECK:STDOUT: %.9: type = ptr_type %Final [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %DeriveFromFinal, %Final [template] +// CHECK:STDOUT: %.7: type = struct_type {.base: %Final} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] +// CHECK:STDOUT: %.9: type = ptr_type %DeriveFromFinal [template] +// CHECK:STDOUT: %.10: type = ptr_type %Final [template] // CHECK:STDOUT: %ConvertToBadBaseFinal.type: type = fn_type @ConvertToBadBaseFinal [template] // CHECK:STDOUT: %ConvertToBadBaseFinal: %ConvertToBadBaseFinal.type = struct_value () [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseFinal_WithMember.type: type = fn_type @AccessMemberWithInvalidBaseFinal_WithMember [template] @@ -738,7 +763,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -757,60 +782,63 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %Final.decl: type = class_decl @Final [template = constants.%Final] {} {} // CHECK:STDOUT: %DeriveFromFinal.decl: type = class_decl @DeriveFromFinal [template = constants.%DeriveFromFinal] {} {} // CHECK:STDOUT: %ConvertToBadBaseFinal.decl: %ConvertToBadBaseFinal.type = fn_decl @ConvertToBadBaseFinal [template = constants.%ConvertToBadBaseFinal] { -// CHECK:STDOUT: %p.patt: %.8 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.8 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.9 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.9 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.9 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.9 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.10 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.10 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromFinal.ref: type = name_ref DeriveFromFinal, file.%DeriveFromFinal.decl [template = constants.%DeriveFromFinal] -// CHECK:STDOUT: %.loc15_44: type = ptr_type %DeriveFromFinal [template = constants.%.8] +// CHECK:STDOUT: %.loc15_44: type = ptr_type %DeriveFromFinal [template = constants.%.9] // CHECK:STDOUT: %Final.ref: type = name_ref Final, file.%Final.decl [template = constants.%Final] -// CHECK:STDOUT: %.loc15_55: type = ptr_type %Final [template = constants.%.9] -// CHECK:STDOUT: %p.param: %.8 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.8 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.9 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.9 = return_slot %return.param +// CHECK:STDOUT: %.loc15_55: type = ptr_type %Final [template = constants.%.10] +// CHECK:STDOUT: %p.param: %.9 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.9 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.10 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.10 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseFinal_WithMember.decl: %AccessMemberWithInvalidBaseFinal_WithMember.type = fn_decl @AccessMemberWithInvalidBaseFinal_WithMember [template = constants.%AccessMemberWithInvalidBaseFinal_WithMember] { -// CHECK:STDOUT: %p.patt: %.8 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.8 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.9 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.9 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromFinal.ref: type = name_ref DeriveFromFinal, file.%DeriveFromFinal.decl [template = constants.%DeriveFromFinal] -// CHECK:STDOUT: %.loc19_66: type = ptr_type %DeriveFromFinal [template = constants.%.8] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_72.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc19_72.2: type = converted %int.make_type_32, %.loc19_72.1 [template = i32] -// CHECK:STDOUT: %p.param: %.8 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.8 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc19_66: type = ptr_type %DeriveFromFinal [template = constants.%.9] +// CHECK:STDOUT: %.loc19_72.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc19_72.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_72.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc19_72.3: type = converted %int.make_type_signed, %.loc19_72.2 [template = constants.%i32] +// CHECK:STDOUT: %p.param: %.9 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.9 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseFinal_NoMember.decl: %AccessMemberWithInvalidBaseFinal_NoMember.type = fn_decl @AccessMemberWithInvalidBaseFinal_NoMember [template = constants.%AccessMemberWithInvalidBaseFinal_NoMember] { -// CHECK:STDOUT: %p.patt: %.8 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.8 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.9 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.9 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromFinal.ref: type = name_ref DeriveFromFinal, file.%DeriveFromFinal.decl [template = constants.%DeriveFromFinal] -// CHECK:STDOUT: %.loc23_64: type = ptr_type %DeriveFromFinal [template = constants.%.8] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_70.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc23_70.2: type = converted %int.make_type_32, %.loc23_70.1 [template = i32] -// CHECK:STDOUT: %p.param: %.8 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.8 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc23_64: type = ptr_type %DeriveFromFinal [template = constants.%.9] +// CHECK:STDOUT: %.loc23_70.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc23_70.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_70.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc23_70.3: type = converted %int.make_type_signed, %.loc23_70.2 [template = constants.%i32] +// CHECK:STDOUT: %p.param: %.9 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.9 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Final { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc3_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc3_10.2: type = converted %int.make_type_32, %.loc3_10.1 [template = i32] -// CHECK:STDOUT: %.loc3_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %.loc4: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc3_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc3_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc3_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc3_10.3: type = converted %int.make_type_signed, %.loc3_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc3_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc4: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Final @@ -819,8 +847,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @DeriveFromFinal { // CHECK:STDOUT: %Final.ref: type = name_ref Final, file.%Final.decl [template = constants.%Final] -// CHECK:STDOUT: %.loc11: %.5 = base_decl %Final, element0 [template] -// CHECK:STDOUT: %.loc12: = complete_type_witness %.6 [template = constants.%.7] +// CHECK:STDOUT: %.loc11: %.6 = base_decl %Final, element0 [template] +// CHECK:STDOUT: %.loc12: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%DeriveFromFinal @@ -828,31 +856,31 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: extend %Final.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertToBadBaseFinal(%p.param_patt: %.8) -> %.9 { +// CHECK:STDOUT: fn @ConvertToBadBaseFinal(%p.param_patt: %.9) -> %.10 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.8 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.9 = name_ref p, %p // CHECK:STDOUT: %.loc16_11.1: ref %DeriveFromFinal = deref %p.ref // CHECK:STDOUT: %.loc16_11.2: ref %Final = class_element_access %.loc16_11.1, element0 -// CHECK:STDOUT: %.loc16_11.3: %.9 = addr_of %.loc16_11.2 -// CHECK:STDOUT: %.loc16_11.4: %.9 = converted %p.ref, %.loc16_11.3 +// CHECK:STDOUT: %.loc16_11.3: %.10 = addr_of %.loc16_11.2 +// CHECK:STDOUT: %.loc16_11.4: %.10 = converted %p.ref, %.loc16_11.3 // CHECK:STDOUT: return %.loc16_11.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseFinal_WithMember(%p.param_patt: %.8) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseFinal_WithMember(%p.param_patt: %.9) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.8 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.9 = name_ref p, %p // CHECK:STDOUT: %.loc20_11: ref %DeriveFromFinal = deref %p.ref -// CHECK:STDOUT: %a.ref: %.1 = name_ref a, @Final.%.loc3_8 [template = @Final.%.loc3_8] +// CHECK:STDOUT: %a.ref: %.2 = name_ref a, @Final.%.loc3_8 [template = @Final.%.loc3_8] // CHECK:STDOUT: %.loc20_14.1: ref %Final = class_element_access %.loc20_11, element0 // CHECK:STDOUT: %.loc20_14.2: ref %Final = converted %.loc20_11, %.loc20_14.1 -// CHECK:STDOUT: %.loc20_14.3: ref i32 = class_element_access %.loc20_14.2, element0 -// CHECK:STDOUT: %.loc20_14.4: i32 = bind_value %.loc20_14.3 +// CHECK:STDOUT: %.loc20_14.3: ref %i32 = class_element_access %.loc20_14.2, element0 +// CHECK:STDOUT: %.loc20_14.4: %i32 = bind_value %.loc20_14.3 // CHECK:STDOUT: return %.loc20_14.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseFinal_NoMember(%p.param_patt: %.8) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseFinal_NoMember(%p.param_patt: %.9) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.8 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.9 = name_ref p, %p // CHECK:STDOUT: %.loc27: ref %DeriveFromFinal = deref %p.ref // CHECK:STDOUT: %b.ref: = name_ref b, [template = ] // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon index 155b7c4b4939..430b790b740e 100644 --- a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon +++ b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon @@ -30,22 +30,24 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %A, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %A, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %B, i32 [template] -// CHECK:STDOUT: %.5: type = struct_type {.b: i32} [template] -// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %B, %i32 [template] +// CHECK:STDOUT: %.6: type = struct_type {.b: %i32} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: %AccessBInA.type: type = fn_type @AccessBInA [template] // CHECK:STDOUT: %AccessBInA: %AccessBInA.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -65,26 +67,28 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %AccessBInA.decl: %AccessBInA.type = fn_decl @AccessBInA [template = constants.%AccessBInA] { // CHECK:STDOUT: %a.patt: %A = binding_pattern a // CHECK:STDOUT: %a.param_patt: %A = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_24.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc19_24.2: type = converted %int.make_type_32, %.loc19_24.1 [template = i32] +// CHECK:STDOUT: %.loc19_24.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc19_24.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_24.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc19_24.3: type = converted %int.make_type_signed, %.loc19_24.2 [template = constants.%i32] // CHECK:STDOUT: %a.param: %A = value_param runtime_param0 // CHECK:STDOUT: %a: %A = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -92,24 +96,25 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_10.2: type = converted %int.make_type_32, %.loc16_10.1 [template = i32] -// CHECK:STDOUT: %.loc16_8: %.4 = field_decl b, element0 [template] -// CHECK:STDOUT: %.loc17: = complete_type_witness %.5 [template = constants.%.6] +// CHECK:STDOUT: %.loc16_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc16_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc16_10.3: type = converted %int.make_type_signed, %.loc16_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_8: %.5 = field_decl b, element0 [template] +// CHECK:STDOUT: %.loc17: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: .b = %.loc16_8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessBInA(%a.param_patt: %A) -> i32 { +// CHECK:STDOUT: fn @AccessBInA(%a.param_patt: %A) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %b.ref: %.4 = name_ref b, @B.%.loc16_8 [template = @B.%.loc16_8] +// CHECK:STDOUT: %b.ref: %.5 = name_ref b, @B.%.loc16_8 [template = @B.%.loc16_8] // CHECK:STDOUT: %.loc26_11.1: %B = converted %a.ref, [template = ] -// CHECK:STDOUT: %.loc26_11.2: i32 = class_element_access , element0 [template = ] +// CHECK:STDOUT: %.loc26_11.2: %i32 = class_element_access , element0 [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_derived_to_base.carbon b/toolchain/check/testdata/class/fail_derived_to_base.carbon index 688382b38c45..c2bf80fe6081 100644 --- a/toolchain/check/testdata/class/fail_derived_to_base.carbon +++ b/toolchain/check/testdata/class/fail_derived_to_base.carbon @@ -44,32 +44,34 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %A1: type = class_type @A1 [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %A1, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %A1, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %A2: type = class_type @A2 [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %A2, i32 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %A2, %i32 [template] // CHECK:STDOUT: %B2: type = class_type @B2 [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %B2, %A2 [template] -// CHECK:STDOUT: %.7: type = unbound_element_type %B2, i32 [template] -// CHECK:STDOUT: %.8: type = struct_type {.base: %A2, .b: i32} [template] -// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] -// CHECK:STDOUT: %.10: type = ptr_type %B2 [template] -// CHECK:STDOUT: %.11: type = ptr_type %A1 [template] +// CHECK:STDOUT: %.7: type = unbound_element_type %B2, %A2 [template] +// CHECK:STDOUT: %.8: type = unbound_element_type %B2, %i32 [template] +// CHECK:STDOUT: %.9: type = struct_type {.base: %A2, .b: %i32} [template] +// CHECK:STDOUT: %.10: = complete_type_witness %.9 [template] +// CHECK:STDOUT: %.11: type = ptr_type %B2 [template] +// CHECK:STDOUT: %.12: type = ptr_type %A1 [template] // CHECK:STDOUT: %ConvertUnrelated.type: type = fn_type @ConvertUnrelated [template] // CHECK:STDOUT: %ConvertUnrelated: %ConvertUnrelated.type = struct_value () [template] // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] -// CHECK:STDOUT: %.40: type = ptr_type %Incomplete [template] -// CHECK:STDOUT: %.41: type = ptr_type %A2 [template] +// CHECK:STDOUT: %.35: type = ptr_type %Incomplete [template] +// CHECK:STDOUT: %.36: type = ptr_type %A2 [template] // CHECK:STDOUT: %ConvertIncomplete.type: type = fn_type @ConvertIncomplete [template] // CHECK:STDOUT: %ConvertIncomplete: %ConvertIncomplete.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -91,44 +93,45 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %A2.decl: type = class_decl @A2 [template = constants.%A2] {} {} // CHECK:STDOUT: %B2.decl: type = class_decl @B2 [template = constants.%B2] {} {} // CHECK:STDOUT: %ConvertUnrelated.decl: %ConvertUnrelated.type = fn_decl @ConvertUnrelated [template = constants.%ConvertUnrelated] { -// CHECK:STDOUT: %p.patt: %.10 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.10 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.11 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.11 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.11 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.11 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.12 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.12 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %B2.ref: type = name_ref B2, file.%B2.decl [template = constants.%B2] -// CHECK:STDOUT: %.loc31_26: type = ptr_type %B2 [template = constants.%.10] +// CHECK:STDOUT: %.loc31_26: type = ptr_type %B2 [template = constants.%.11] // CHECK:STDOUT: %A1.ref: type = name_ref A1, file.%A1.decl [template = constants.%A1] -// CHECK:STDOUT: %.loc31_34: type = ptr_type %A1 [template = constants.%.11] -// CHECK:STDOUT: %p.param: %.10 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.10 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.11 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.11 = return_slot %return.param +// CHECK:STDOUT: %.loc31_34: type = ptr_type %A1 [template = constants.%.12] +// CHECK:STDOUT: %p.param: %.11 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.11 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.12 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.12 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {} // CHECK:STDOUT: %ConvertIncomplete.decl: %ConvertIncomplete.type = fn_decl @ConvertIncomplete [template = constants.%ConvertIncomplete] { -// CHECK:STDOUT: %p.patt: %.40 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.40 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.41 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.41 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.35 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.35 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.36 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.36 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, file.%Incomplete.decl [template = constants.%Incomplete] -// CHECK:STDOUT: %.loc41_35: type = ptr_type %Incomplete [template = constants.%.40] +// CHECK:STDOUT: %.loc41_35: type = ptr_type %Incomplete [template = constants.%.35] // CHECK:STDOUT: %A2.ref: type = name_ref A2, file.%A2.decl [template = constants.%A2] -// CHECK:STDOUT: %.loc41_43: type = ptr_type %A2 [template = constants.%.41] -// CHECK:STDOUT: %p.param: %.40 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.40 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.41 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.41 = return_slot %return.param +// CHECK:STDOUT: %.loc41_43: type = ptr_type %A2 [template = constants.%.36] +// CHECK:STDOUT: %p.param: %.35 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.35 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.36 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.36 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A1 { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A1 @@ -136,11 +139,12 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A2 { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_10.2: type = converted %int.make_type_32, %.loc16_10.1 [template = i32] -// CHECK:STDOUT: %.loc16_8: %.4 = field_decl a, element0 [template] -// CHECK:STDOUT: %.loc17: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc16_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc16_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc16_10.3: type = converted %int.make_type_signed, %.loc16_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_8: %.5 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc17: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A2 @@ -149,12 +153,13 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: // CHECK:STDOUT: class @B2 { // CHECK:STDOUT: %A2.ref: type = name_ref A2, file.%A2.decl [template = constants.%A2] -// CHECK:STDOUT: %.loc20: %.6 = base_decl %A2, element0 [template] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc21_10.2: type = converted %int.make_type_32, %.loc21_10.1 [template = i32] -// CHECK:STDOUT: %.loc21_8: %.7 = field_decl b, element1 [template] -// CHECK:STDOUT: %.loc22: = complete_type_witness %.8 [template = constants.%.9] +// CHECK:STDOUT: %.loc20: %.7 = base_decl %A2, element0 [template] +// CHECK:STDOUT: %.loc21_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc21_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc21_10.3: type = converted %int.make_type_signed, %.loc21_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_8: %.8 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc22: = complete_type_witness %.9 [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B2 @@ -165,17 +170,17 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: // CHECK:STDOUT: class @Incomplete; // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertUnrelated(%p.param_patt: %.10) -> %.11 { +// CHECK:STDOUT: fn @ConvertUnrelated(%p.param_patt: %.11) -> %.12 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.10 = name_ref p, %p -// CHECK:STDOUT: %.loc31_46: %.11 = converted %p.ref, [template = ] +// CHECK:STDOUT: %p.ref: %.11 = name_ref p, %p +// CHECK:STDOUT: %.loc31_46: %.12 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertIncomplete(%p.param_patt: %.40) -> %.41 { +// CHECK:STDOUT: fn @ConvertIncomplete(%p.param_patt: %.35) -> %.36 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.40 = name_ref p, %p -// CHECK:STDOUT: %.loc41_55: %.41 = converted %p.ref, [template = ] +// CHECK:STDOUT: %p.ref: %.35 = name_ref p, %p +// CHECK:STDOUT: %.loc41_55: %.36 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_field_modifiers.carbon b/toolchain/check/testdata/class/fail_field_modifiers.carbon index 524c8a47e2b6..c5e26229511f 100644 --- a/toolchain/check/testdata/class/fail_field_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_field_modifiers.carbon @@ -38,26 +38,30 @@ class Class { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Class, i32 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 0 [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: type = struct_type {.j: i32, .k: i32} [template] -// CHECK:STDOUT: %.33: = complete_type_witness %.32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Class, %i32 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: type = struct_type {.j: %i32, .k: %i32} [template] +// CHECK:STDOUT: %.32: = complete_type_witness %.31 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -74,35 +78,41 @@ class Class { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_18.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] -// CHECK:STDOUT: %.loc17_18.2: type = converted %int.make_type_32.loc17, %.loc17_18.1 [template = i32] -// CHECK:STDOUT: %.loc17_16: %.1 = field_decl j, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_16.1: type = value_of_initializer %int.make_type_32.loc23 [template = i32] -// CHECK:STDOUT: %.loc23_16.2: type = converted %int.make_type_32.loc23, %.loc23_16.1 [template = i32] -// CHECK:STDOUT: %.loc23_14: %.1 = field_decl k, element1 [template] -// CHECK:STDOUT: %int.make_type_32.loc29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc29_18.1: type = value_of_initializer %int.make_type_32.loc29 [template = i32] -// CHECK:STDOUT: %.loc29_18.2: type = converted %int.make_type_32.loc29, %.loc29_18.1 [template = i32] -// CHECK:STDOUT: %.loc29_24: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc29_25.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc29_25.2: = bound_method %.loc29_24, %.loc29_25.1 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc29: init i32 = call %.loc29_25.2(%.loc29_24) [template = constants.%.28] -// CHECK:STDOUT: %.loc29_25.3: i32 = value_of_initializer %int.convert_checked.loc29 [template = constants.%.28] -// CHECK:STDOUT: %.loc29_25.4: i32 = converted %.loc29_24, %.loc29_25.3 [template = constants.%.28] -// CHECK:STDOUT: %l: i32 = bind_name l, %.loc29_25.4 -// CHECK:STDOUT: %int.make_type_32.loc34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc34_16.1: type = value_of_initializer %int.make_type_32.loc34 [template = i32] -// CHECK:STDOUT: %.loc34_16.2: type = converted %int.make_type_32.loc34, %.loc34_16.1 [template = i32] -// CHECK:STDOUT: %.loc34_22: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc34_23.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc34_23.2: = bound_method %.loc34_22, %.loc34_23.1 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc34: init i32 = call %.loc34_23.2(%.loc34_22) [template = constants.%.31] -// CHECK:STDOUT: %.loc34_23.3: i32 = value_of_initializer %int.convert_checked.loc34 [template = constants.%.31] -// CHECK:STDOUT: %.loc34_23.4: i32 = converted %.loc34_22, %.loc34_23.3 [template = constants.%.31] -// CHECK:STDOUT: %m: i32 = bind_name m, %.loc34_23.4 -// CHECK:STDOUT: %.loc35: = complete_type_witness %.32 [template = constants.%.33] +// CHECK:STDOUT: %.loc17_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%.loc17_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_18.2: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_18.3: type = converted %int.make_type_signed.loc17, %.loc17_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_16: %.2 = field_decl j, element0 [template] +// CHECK:STDOUT: %.loc23_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc23: init type = call constants.%Int(%.loc23_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_16.2: type = value_of_initializer %int.make_type_signed.loc23 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_16.3: type = converted %int.make_type_signed.loc23, %.loc23_16.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_14: %.2 = field_decl k, element1 [template] +// CHECK:STDOUT: %.loc29_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc29: init type = call constants.%Int(%.loc29_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc29_18.2: type = value_of_initializer %int.make_type_signed.loc29 [template = constants.%i32] +// CHECK:STDOUT: %.loc29_18.3: type = converted %int.make_type_signed.loc29, %.loc29_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc29_24: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc29_25.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc29_25.2: = bound_method %.loc29_24, %.loc29_25.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc29_25.3: = specific_function %.loc29_25.2, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %.loc29_25.3(%.loc29_24) [template = constants.%.26] +// CHECK:STDOUT: %.loc29_25.4: %i32 = value_of_initializer %int.convert_checked.loc29 [template = constants.%.26] +// CHECK:STDOUT: %.loc29_25.5: %i32 = converted %.loc29_24, %.loc29_25.4 [template = constants.%.26] +// CHECK:STDOUT: %l: %i32 = bind_name l, %.loc29_25.5 +// CHECK:STDOUT: %.loc34_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc34: init type = call constants.%Int(%.loc34_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc34_16.2: type = value_of_initializer %int.make_type_signed.loc34 [template = constants.%i32] +// CHECK:STDOUT: %.loc34_16.3: type = converted %int.make_type_signed.loc34, %.loc34_16.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc34_22: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc34_23.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc34_23.2: = bound_method %.loc34_22, %.loc34_23.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc34_23.3: = specific_function %.loc34_23.2, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc34: init %i32 = call %.loc34_23.3(%.loc34_22) [template = constants.%.30] +// CHECK:STDOUT: %.loc34_23.4: %i32 = value_of_initializer %int.convert_checked.loc34 [template = constants.%.30] +// CHECK:STDOUT: %.loc34_23.5: %i32 = converted %.loc34_22, %.loc34_23.4 [template = constants.%.30] +// CHECK:STDOUT: %m: %i32 = bind_name m, %.loc34_23.5 +// CHECK:STDOUT: %.loc35: = complete_type_witness %.31 [template = constants.%.32] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/fail_generic_method.carbon b/toolchain/check/testdata/class/fail_generic_method.carbon index c733735214cb..e17e365f3cca 100644 --- a/toolchain/check/testdata/class/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_generic_method.carbon @@ -44,17 +44,19 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = struct_type {.a: %T} [symbolic] // CHECK:STDOUT: %.3: = complete_type_witness %.2 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.4 [template] +// CHECK:STDOUT: %N: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] -// CHECK:STDOUT: %.4: %.type = struct_value () [template] +// CHECK:STDOUT: %.5: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -73,17 +75,18 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc11_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_13.2 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.5] { // CHECK:STDOUT: %self.patt: = binding_pattern self // CHECK:STDOUT: %self.param_patt: = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %n.patt: = binding_pattern n // CHECK:STDOUT: %n.param_patt: = value_param_pattern %n.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc32_14.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc32_14.2: type = converted %int.make_type_32, %.loc32_14.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc32_10.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc32_10.2 (constants.%N)] +// CHECK:STDOUT: %.loc32_14.1: Core.IntLiteral = int_value 32 [template = constants.%.4] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc32_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc32_14.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc32_14.3: type = converted %int.make_type_signed, %.loc32_14.2 [template = constants.%i32] +// CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc32_10.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc32_10.2 (constants.%N)] // CHECK:STDOUT: %Self.ref: = name_ref Self, [template = ] // CHECK:STDOUT: %T.ref: = name_ref T, [template = ] // CHECK:STDOUT: %self.param: = value_param runtime_param0 @@ -138,9 +141,9 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: fn[%self.param_patt: @F.%Class (%Class.2)](%n.param_patt: @F.%T (%T)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @.1(%N.loc32_10.1: i32) { -// CHECK:STDOUT: %N.loc32_10.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc32_10.2 (constants.%N)] -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: generic fn @.1(%N.loc32_10.1: %i32) { +// CHECK:STDOUT: %N.loc32_10.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc32_10.2 (constants.%N)] +// CHECK:STDOUT: %N.patt: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index 9a7841da5222..0f64f98eb2fe 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -186,8 +186,10 @@ class C { // CHECK:STDOUT: %ConvertFromStruct: %ConvertFromStruct.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: %.3: type = ptr_type %Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.4 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %MemberAccess.type: type = fn_type @MemberAccess [template] @@ -207,14 +209,14 @@ class C { // CHECK:STDOUT: %IncompleteAddrSelf: type = class_type @IncompleteAddrSelf [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.2 [template] // CHECK:STDOUT: %CallIncompleteAddrSelf.type: type = fn_type @CallIncompleteAddrSelf [template] // CHECK:STDOUT: %CallIncompleteAddrSelf: %CallIncompleteAddrSelf.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -256,34 +258,36 @@ class C { // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %p.patt: %.3 = binding_pattern p // CHECK:STDOUT: %p.param_patt: %.3 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc44_14: type = ptr_type %Class [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc44_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc44_20.2: type = converted %int.make_type_32, %.loc44_20.1 [template = i32] +// CHECK:STDOUT: %.loc44_20.1: Core.IntLiteral = int_value 32 [template = constants.%.4] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc44_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc44_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc44_20.3: type = converted %int.make_type_signed, %.loc44_20.2 [template = constants.%i32] // CHECK:STDOUT: %p.param: %.3 = value_param runtime_param0 // CHECK:STDOUT: %p: %.3 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %MemberAccess.decl: %MemberAccess.type = fn_decl @MemberAccess [template = constants.%MemberAccess] { // CHECK:STDOUT: %p.patt: %.3 = binding_pattern p // CHECK:STDOUT: %p.param_patt: %.3 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc55_25: type = ptr_type %Class [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc55_31.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc55_31.2: type = converted %int.make_type_32, %.loc55_31.1 [template = i32] +// CHECK:STDOUT: %.loc55_31.1: Core.IntLiteral = int_value 32 [template = constants.%.4] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc55_31.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc55_31.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc55_31.3: type = converted %int.make_type_signed, %.loc55_31.2 [template = constants.%i32] // CHECK:STDOUT: %p.param: %.3 = value_param runtime_param0 // CHECK:STDOUT: %p: %.3 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Copy.decl: %Copy.type = fn_decl @Copy [template = constants.%Copy] { // CHECK:STDOUT: %p.patt: %.3 = binding_pattern p @@ -359,7 +363,7 @@ class C { // CHECK:STDOUT: %self.param: %.3 = value_param runtime_param0 // CHECK:STDOUT: %self: %.3 = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc134: = complete_type_witness %.2 [template = constants.%.4] +// CHECK:STDOUT: %.loc134: = complete_type_witness %.2 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%IncompleteAddrSelf @@ -384,14 +388,14 @@ class C { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%p.param_patt: %.3) -> i32 { +// CHECK:STDOUT: fn @G(%p.param_patt: %.3) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.3 = name_ref p, %p // CHECK:STDOUT: %.loc52: ref %Class = deref %p.ref // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @MemberAccess(%p.param_patt: %.3) -> i32 { +// CHECK:STDOUT: fn @MemberAccess(%p.param_patt: %.3) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %.3 = name_ref p, %p // CHECK:STDOUT: %.loc63: ref %Class = deref %p.ref diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index de11dad874d4..1d2191fee971 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -34,30 +34,33 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Class, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Class, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.5: type = struct_type {.a: Core.IntLiteral} [template] -// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.8: type = struct_type {.a: Core.IntLiteral, .c: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.33: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 1 [template] -// CHECK:STDOUT: %.35: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.36: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral, .c: Core.IntLiteral} [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.6: type = struct_type {.a: Core.IntLiteral} [template] +// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.9: type = struct_type {.a: Core.IntLiteral, .c: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.29: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.33: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.34: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral, .c: Core.IntLiteral} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -76,15 +79,17 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] -// CHECK:STDOUT: %.loc13_8: %.1 = field_decl b, element1 [template] -// CHECK:STDOUT: %.loc14: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed.loc12, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc13_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.3: type = converted %int.make_type_signed.loc13, %.loc13_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -94,29 +99,30 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc21_9: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc21_10.1: %.5 = struct_literal (%.loc21_9) +// CHECK:STDOUT: %.loc21_9: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc21_10.1: %.6 = struct_literal (%.loc21_9) // CHECK:STDOUT: %Class.ref.loc21: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc21_10.2: ref %Class = temporary_storage // CHECK:STDOUT: %.loc21_10.3: ref %Class = temporary %.loc21_10.2, // CHECK:STDOUT: %.loc21_12: ref %Class = converted %.loc21_10.1, %.loc21_10.3 -// CHECK:STDOUT: %.loc26_9: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc26_17: Core.IntLiteral = int_value 2 [template = constants.%.7] -// CHECK:STDOUT: %.loc26_18.1: %.8 = struct_literal (%.loc26_9, %.loc26_17) +// CHECK:STDOUT: %.loc26_9: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc26_17: Core.IntLiteral = int_value 2 [template = constants.%.8] +// CHECK:STDOUT: %.loc26_18.1: %.9 = struct_literal (%.loc26_9, %.loc26_17) // CHECK:STDOUT: %Class.ref.loc26: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %.loc26_18.2: %Convert.type.2 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc26_18.3: = bound_method %.loc26_9, %.loc26_18.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc26_18.3(%.loc26_9) [template = constants.%.34] -// CHECK:STDOUT: %.loc26_18.4: init i32 = converted %.loc26_9, %int.convert_checked [template = constants.%.34] -// CHECK:STDOUT: %.loc26_18.5: ref %Class = temporary_storage -// CHECK:STDOUT: %.loc26_18.6: ref i32 = class_element_access %.loc26_18.5, element0 -// CHECK:STDOUT: %.loc26_18.7: init i32 = initialize_from %.loc26_18.4 to %.loc26_18.6 [template = constants.%.34] -// CHECK:STDOUT: %.loc26_18.8: ref %Class = temporary %.loc26_18.5, -// CHECK:STDOUT: %.loc26_20: ref %Class = converted %.loc26_18.1, %.loc26_18.8 -// CHECK:STDOUT: %.loc30_9: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc30_17: Core.IntLiteral = int_value 2 [template = constants.%.7] -// CHECK:STDOUT: %.loc30_25: Core.IntLiteral = int_value 3 [template = constants.%.35] -// CHECK:STDOUT: %.loc30_26.1: %.36 = struct_literal (%.loc30_9, %.loc30_17, %.loc30_25) +// CHECK:STDOUT: %.loc26_18.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc26_18.3: = bound_method %.loc26_9, %.loc26_18.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc26_18.4: = specific_function %.loc26_18.3, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc26_18.4(%.loc26_9) [template = constants.%.32] +// CHECK:STDOUT: %.loc26_18.5: init %i32 = converted %.loc26_9, %int.convert_checked [template = constants.%.32] +// CHECK:STDOUT: %.loc26_18.6: ref %Class = temporary_storage +// CHECK:STDOUT: %.loc26_18.7: ref %i32 = class_element_access %.loc26_18.6, element0 +// CHECK:STDOUT: %.loc26_18.8: init %i32 = initialize_from %.loc26_18.5 to %.loc26_18.7 [template = constants.%.32] +// CHECK:STDOUT: %.loc26_18.9: ref %Class = temporary %.loc26_18.6, +// CHECK:STDOUT: %.loc26_20: ref %Class = converted %.loc26_18.1, %.loc26_18.9 +// CHECK:STDOUT: %.loc30_9: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc30_17: Core.IntLiteral = int_value 2 [template = constants.%.8] +// CHECK:STDOUT: %.loc30_25: Core.IntLiteral = int_value 3 [template = constants.%.33] +// CHECK:STDOUT: %.loc30_26.1: %.34 = struct_literal (%.loc30_9, %.loc30_17, %.loc30_25) // CHECK:STDOUT: %Class.ref.loc30: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc30_26.2: ref %Class = temporary_storage // CHECK:STDOUT: %.loc30_26.3: ref %Class = temporary %.loc30_26.2, diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index f284efbfbd6a..e4dcf59858e6 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -30,34 +30,38 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Class, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] -// CHECK:STDOUT: %.4: type = ptr_type %Class [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Class, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %Class [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.8: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.33: = bound_method %.6, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 1 [template] -// CHECK:STDOUT: %.35: = bound_method %.7, %Convert.15 [template] -// CHECK:STDOUT: %.36: i32 = int_value 2 [template] -// CHECK:STDOUT: %struct: %Class = struct_value (%.34, %.36) [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.9: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.29: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.30: = bound_method %.7, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.33: = bound_method %.8, %Convert.14 [template] +// CHECK:STDOUT: %.34: = specific_function %.33, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.35: %i32 = int_value 2 [template] +// CHECK:STDOUT: %struct: %Class = struct_value (%.32, %.35) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -74,27 +78,29 @@ fn F() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %p.patt: %.4 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.4 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %p.patt: %.5 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.5 = value_param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %.loc16: type = ptr_type %Class [template = constants.%.4] -// CHECK:STDOUT: %p.param: %.4 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param +// CHECK:STDOUT: %.loc16: type = ptr_type %Class [template = constants.%.5] +// CHECK:STDOUT: %p.param: %.5 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.5 = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] -// CHECK:STDOUT: %.loc13_8: %.1 = field_decl b, element1 [template] -// CHECK:STDOUT: %.loc14: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed.loc12, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc13_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.3: type = converted %int.make_type_signed.loc13, %.loc13_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -102,38 +108,40 @@ fn F() { // CHECK:STDOUT: .b = %.loc13_8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%p.param_patt: %.4); +// CHECK:STDOUT: fn @G(%p.param_patt: %.5); // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref.loc25_10: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %c.var: ref %Class = var c // CHECK:STDOUT: %c: ref %Class = bind_name c, %c.var -// CHECK:STDOUT: %.loc25_24: Core.IntLiteral = int_value 1 [template = constants.%.6] -// CHECK:STDOUT: %.loc25_32: Core.IntLiteral = int_value 2 [template = constants.%.7] -// CHECK:STDOUT: %.loc25_33.1: %.8 = struct_literal (%.loc25_24, %.loc25_32) +// CHECK:STDOUT: %.loc25_24: Core.IntLiteral = int_value 1 [template = constants.%.7] +// CHECK:STDOUT: %.loc25_32: Core.IntLiteral = int_value 2 [template = constants.%.8] +// CHECK:STDOUT: %.loc25_33.1: %.9 = struct_literal (%.loc25_24, %.loc25_32) // CHECK:STDOUT: %Class.ref.loc25_38: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %.loc25_33.2: %Convert.type.2 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc25_33.3: = bound_method %.loc25_24, %.loc25_33.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc25_33.1: init i32 = call %.loc25_33.3(%.loc25_24) [template = constants.%.34] -// CHECK:STDOUT: %.loc25_33.4: init i32 = converted %.loc25_24, %int.convert_checked.loc25_33.1 [template = constants.%.34] -// CHECK:STDOUT: %.loc25_33.5: ref %Class = temporary_storage -// CHECK:STDOUT: %.loc25_33.6: ref i32 = class_element_access %.loc25_33.5, element0 -// CHECK:STDOUT: %.loc25_33.7: init i32 = initialize_from %.loc25_33.4 to %.loc25_33.6 [template = constants.%.34] -// CHECK:STDOUT: %.loc25_33.8: %Convert.type.2 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc25_33.9: = bound_method %.loc25_32, %.loc25_33.8 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc25_33.2: init i32 = call %.loc25_33.9(%.loc25_32) [template = constants.%.36] -// CHECK:STDOUT: %.loc25_33.10: init i32 = converted %.loc25_32, %int.convert_checked.loc25_33.2 [template = constants.%.36] -// CHECK:STDOUT: %.loc25_33.11: ref i32 = class_element_access %.loc25_33.5, element1 -// CHECK:STDOUT: %.loc25_33.12: init i32 = initialize_from %.loc25_33.10 to %.loc25_33.11 [template = constants.%.36] -// CHECK:STDOUT: %.loc25_33.13: init %Class = class_init (%.loc25_33.7, %.loc25_33.12), %.loc25_33.5 [template = constants.%struct] -// CHECK:STDOUT: %.loc25_33.14: ref %Class = temporary %.loc25_33.5, %.loc25_33.13 -// CHECK:STDOUT: %.loc25_35.1: ref %Class = converted %.loc25_33.1, %.loc25_33.14 +// CHECK:STDOUT: %.loc25_33.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc25_33.3: = bound_method %.loc25_24, %.loc25_33.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc25_33.4: = specific_function %.loc25_33.3, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc25_33.1: init %i32 = call %.loc25_33.4(%.loc25_24) [template = constants.%.32] +// CHECK:STDOUT: %.loc25_33.5: init %i32 = converted %.loc25_24, %int.convert_checked.loc25_33.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc25_33.6: ref %Class = temporary_storage +// CHECK:STDOUT: %.loc25_33.7: ref %i32 = class_element_access %.loc25_33.6, element0 +// CHECK:STDOUT: %.loc25_33.8: init %i32 = initialize_from %.loc25_33.5 to %.loc25_33.7 [template = constants.%.32] +// CHECK:STDOUT: %.loc25_33.9: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc25_33.10: = bound_method %.loc25_32, %.loc25_33.9 [template = constants.%.33] +// CHECK:STDOUT: %.loc25_33.11: = specific_function %.loc25_33.10, @Convert.2(constants.%.1) [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked.loc25_33.2: init %i32 = call %.loc25_33.11(%.loc25_32) [template = constants.%.35] +// CHECK:STDOUT: %.loc25_33.12: init %i32 = converted %.loc25_32, %int.convert_checked.loc25_33.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc25_33.13: ref %i32 = class_element_access %.loc25_33.6, element1 +// CHECK:STDOUT: %.loc25_33.14: init %i32 = initialize_from %.loc25_33.12 to %.loc25_33.13 [template = constants.%.35] +// CHECK:STDOUT: %.loc25_33.15: init %Class = class_init (%.loc25_33.8, %.loc25_33.14), %.loc25_33.6 [template = constants.%struct] +// CHECK:STDOUT: %.loc25_33.16: ref %Class = temporary %.loc25_33.6, %.loc25_33.15 +// CHECK:STDOUT: %.loc25_35.1: ref %Class = converted %.loc25_33.1, %.loc25_33.16 // CHECK:STDOUT: %.loc25_35.2: %Class = bind_value %.loc25_35.1 // CHECK:STDOUT: assign %c.var, // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [template = constants.%G] // CHECK:STDOUT: %c.ref: ref %Class = name_ref c, %c -// CHECK:STDOUT: %.loc26: %.4 = addr_of %c.ref +// CHECK:STDOUT: %.loc26: %.5 = addr_of %c.ref // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.ref(%.loc26) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_member_of_let.carbon b/toolchain/check/testdata/class/fail_member_of_let.carbon index c327b9abc668..cb655f6f167e 100644 --- a/toolchain/check/testdata/class/fail_member_of_let.carbon +++ b/toolchain/check/testdata/class/fail_member_of_let.carbon @@ -29,19 +29,21 @@ fn T.F() {} // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -55,28 +57,29 @@ fn T.F() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.3] {} {} +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32, %.loc12_13.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc12_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_signed, %.loc12_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32; +// CHECK:STDOUT: fn @F() -> %i32; // CHECK:STDOUT: // CHECK:STDOUT: fn @.1() { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index 8f22045b2283..bfa2ac43ba1e 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -25,26 +25,29 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 1 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 1 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -60,47 +63,50 @@ fn G() -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc17_11.2: type = converted %int.make_type_32, %.loc17_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc17_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc17_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc17_11.3: type = converted %int.make_type_signed, %.loc17_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32, %.loc12_13.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc12_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_signed, %.loc12_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc15: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32 { +// CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc13_12: Core.IntLiteral = int_value 1 [template = constants.%.3] -// CHECK:STDOUT: %.loc13_13.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_13.2: = bound_method %.loc13_12, %.loc13_13.1 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc13_13.2(%.loc13_12) [template = constants.%.29] -// CHECK:STDOUT: %.loc13_13.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.29] -// CHECK:STDOUT: %.loc13_13.4: i32 = converted %.loc13_12, %.loc13_13.3 [template = constants.%.29] -// CHECK:STDOUT: return %.loc13_13.4 +// CHECK:STDOUT: %.loc13_12: Core.IntLiteral = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc13_13.1: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_13.2: = bound_method %.loc13_12, %.loc13_13.1 [template = constants.%.25] +// CHECK:STDOUT: %.loc13_13.3: = specific_function %.loc13_13.2, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc13_13.3(%.loc13_12) [template = constants.%.27] +// CHECK:STDOUT: %.loc13_13.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc13_13.5: %i32 = converted %.loc13_12, %.loc13_13.4 [template = constants.%.27] +// CHECK:STDOUT: return %.loc13_13.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> i32 { +// CHECK:STDOUT: fn @G() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: = name_ref F, [template = ] // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/fail_unbound_field.carbon b/toolchain/check/testdata/class/fail_unbound_field.carbon index 6e2d698d8ef4..3922c2ef8cdf 100644 --- a/toolchain/check/testdata/class/fail_unbound_field.carbon +++ b/toolchain/check/testdata/class/fail_unbound_field.carbon @@ -30,20 +30,22 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Class, i32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = struct_type {.field: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.3: type = struct_type {.field: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -58,33 +60,36 @@ fn G() -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc22_11.2: type = converted %int.make_type_32, %.loc22_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc22_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc22_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc22_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc22_11.3: type = converted %int.make_type_signed, %.loc22_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_14.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_14.2: type = converted %int.make_type_32, %.loc12_14.1 [template = i32] -// CHECK:STDOUT: %.loc12_12: %.1 = field_decl field, element0 [template] +// CHECK:STDOUT: %.loc12_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_14.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_14.3: type = converted %int.make_type_signed, %.loc12_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_12: %.2 = field_decl field, element0 [template] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32, %.loc13_13.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc13_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_13.3: type = converted %int.make_type_signed, %.loc13_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc20: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc20: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -92,16 +97,16 @@ fn G() -> i32 { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32 { +// CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %field.ref: %.1 = name_ref field, @Class.%.loc12_12 [template = @Class.%.loc12_12] +// CHECK:STDOUT: %field.ref: %.2 = name_ref field, @Class.%.loc12_12 [template = @Class.%.loc12_12] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> i32 { +// CHECK:STDOUT: fn @G() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %field.ref: %.1 = name_ref field, @Class.%.loc12_12 [template = @Class.%.loc12_12] +// CHECK:STDOUT: %field.ref: %.2 = name_ref field, @Class.%.loc12_12 [template = @Class.%.loc12_12] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_unknown_member.carbon b/toolchain/check/testdata/class/fail_unknown_member.carbon index 684cf8b9a75c..0c58beb20182 100644 --- a/toolchain/check/testdata/class/fail_unknown_member.carbon +++ b/toolchain/check/testdata/class/fail_unknown_member.carbon @@ -24,18 +24,20 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Class, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.n: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Class, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.n: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -52,33 +54,35 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %c.patt: %Class = binding_pattern c // CHECK:STDOUT: %c.param_patt: %Class = value_param_pattern %c.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_19.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_19.2: type = converted %int.make_type_32, %.loc15_19.1 [template = i32] +// CHECK:STDOUT: %.loc15_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_19.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_19.3: type = converted %int.make_type_signed, %.loc15_19.2 [template = constants.%i32] // CHECK:STDOUT: %c.param: %Class = value_param runtime_param0 // CHECK:STDOUT: %c: %Class = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl n, element0 [template] -// CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class // CHECK:STDOUT: .n = %.loc12_8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%c.param_patt: %Class) -> i32 { +// CHECK:STDOUT: fn @G(%c.param_patt: %Class) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %Class = name_ref c, %c // CHECK:STDOUT: %something.ref: = name_ref something, [template = ] diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index 583b86c87dd5..315528928132 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -25,28 +25,32 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Class, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.j: i32, .k: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Class, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.j: %i32, .k: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 2 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.31: = bound_method %.30, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -65,15 +69,17 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl j, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] -// CHECK:STDOUT: %.loc13_8: %.1 = field_decl k, element1 [template] -// CHECK:STDOUT: %.loc14: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed.loc12, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl j, element0 [template] +// CHECK:STDOUT: %.loc13_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.3: type = converted %int.make_type_signed.loc13, %.loc13_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8: %.2 = field_decl k, element1 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -87,42 +93,46 @@ fn Run() { // CHECK:STDOUT: %c.var: ref %Class = var c // CHECK:STDOUT: %c: ref %Class = bind_name c, %c.var // CHECK:STDOUT: %c.ref.loc18: ref %Class = name_ref c, %c -// CHECK:STDOUT: %j.ref.loc18: %.1 = name_ref j, @Class.%.loc12_8 [template = @Class.%.loc12_8] -// CHECK:STDOUT: %.loc18_4: ref i32 = class_element_access %c.ref.loc18, element0 -// CHECK:STDOUT: %.loc18_9: Core.IntLiteral = int_value 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc18_7.1: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_7.2: = bound_method %.loc18_9, %.loc18_7.1 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc18: init i32 = call %.loc18_7.2(%.loc18_9) [template = constants.%.31] -// CHECK:STDOUT: %.loc18_7.3: init i32 = converted %.loc18_9, %int.convert_checked.loc18 [template = constants.%.31] -// CHECK:STDOUT: assign %.loc18_4, %.loc18_7.3 +// CHECK:STDOUT: %j.ref.loc18: %.2 = name_ref j, @Class.%.loc12_8 [template = @Class.%.loc12_8] +// CHECK:STDOUT: %.loc18_4: ref %i32 = class_element_access %c.ref.loc18, element0 +// CHECK:STDOUT: %.loc18_9: Core.IntLiteral = int_value 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc18_7.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_7.2: = bound_method %.loc18_9, %.loc18_7.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc18_7.3: = specific_function %.loc18_7.2, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %.loc18_7.3(%.loc18_9) [template = constants.%.29] +// CHECK:STDOUT: %.loc18_7.4: init %i32 = converted %.loc18_9, %int.convert_checked.loc18 [template = constants.%.29] +// CHECK:STDOUT: assign %.loc18_4, %.loc18_7.4 // CHECK:STDOUT: %c.ref.loc19: ref %Class = name_ref c, %c -// CHECK:STDOUT: %k.ref.loc19: %.1 = name_ref k, @Class.%.loc13_8 [template = @Class.%.loc13_8] -// CHECK:STDOUT: %.loc19_4: ref i32 = class_element_access %c.ref.loc19, element1 -// CHECK:STDOUT: %.loc19_9: Core.IntLiteral = int_value 2 [template = constants.%.32] -// CHECK:STDOUT: %.loc19_7.1: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc19_7.2: = bound_method %.loc19_9, %.loc19_7.1 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc19: init i32 = call %.loc19_7.2(%.loc19_9) [template = constants.%.34] -// CHECK:STDOUT: %.loc19_7.3: init i32 = converted %.loc19_9, %int.convert_checked.loc19 [template = constants.%.34] -// CHECK:STDOUT: assign %.loc19_4, %.loc19_7.3 -// CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc20_11.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32] -// CHECK:STDOUT: %.loc20_11.2: type = converted %int.make_type_32.loc20, %.loc20_11.1 [template = i32] -// CHECK:STDOUT: %cj.var: ref i32 = var cj -// CHECK:STDOUT: %cj: ref i32 = bind_name cj, %cj.var +// CHECK:STDOUT: %k.ref.loc19: %.2 = name_ref k, @Class.%.loc13_8 [template = @Class.%.loc13_8] +// CHECK:STDOUT: %.loc19_4: ref %i32 = class_element_access %c.ref.loc19, element1 +// CHECK:STDOUT: %.loc19_9: Core.IntLiteral = int_value 2 [template = constants.%.30] +// CHECK:STDOUT: %.loc19_7.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc19_7.2: = bound_method %.loc19_9, %.loc19_7.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc19_7.3: = specific_function %.loc19_7.2, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %.loc19_7.3(%.loc19_9) [template = constants.%.33] +// CHECK:STDOUT: %.loc19_7.4: init %i32 = converted %.loc19_9, %int.convert_checked.loc19 [template = constants.%.33] +// CHECK:STDOUT: assign %.loc19_4, %.loc19_7.4 +// CHECK:STDOUT: %.loc20_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%.loc20_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc20_11.2: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] +// CHECK:STDOUT: %.loc20_11.3: type = converted %int.make_type_signed.loc20, %.loc20_11.2 [template = constants.%i32] +// CHECK:STDOUT: %cj.var: ref %i32 = var cj +// CHECK:STDOUT: %cj: ref %i32 = bind_name cj, %cj.var // CHECK:STDOUT: %c.ref.loc20: ref %Class = name_ref c, %c -// CHECK:STDOUT: %j.ref.loc20: %.1 = name_ref j, @Class.%.loc12_8 [template = @Class.%.loc12_8] -// CHECK:STDOUT: %.loc20_18.1: ref i32 = class_element_access %c.ref.loc20, element0 -// CHECK:STDOUT: %.loc20_18.2: i32 = bind_value %.loc20_18.1 +// CHECK:STDOUT: %j.ref.loc20: %.2 = name_ref j, @Class.%.loc12_8 [template = @Class.%.loc12_8] +// CHECK:STDOUT: %.loc20_18.1: ref %i32 = class_element_access %c.ref.loc20, element0 +// CHECK:STDOUT: %.loc20_18.2: %i32 = bind_value %.loc20_18.1 // CHECK:STDOUT: assign %cj.var, %.loc20_18.2 -// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] -// CHECK:STDOUT: %.loc21_11.2: type = converted %int.make_type_32.loc21, %.loc21_11.1 [template = i32] -// CHECK:STDOUT: %ck.var: ref i32 = var ck -// CHECK:STDOUT: %ck: ref i32 = bind_name ck, %ck.var +// CHECK:STDOUT: %.loc21_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%.loc21_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_11.2: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_11.3: type = converted %int.make_type_signed.loc21, %.loc21_11.2 [template = constants.%i32] +// CHECK:STDOUT: %ck.var: ref %i32 = var ck +// CHECK:STDOUT: %ck: ref %i32 = bind_name ck, %ck.var // CHECK:STDOUT: %c.ref.loc21: ref %Class = name_ref c, %c -// CHECK:STDOUT: %k.ref.loc21: %.1 = name_ref k, @Class.%.loc13_8 [template = @Class.%.loc13_8] -// CHECK:STDOUT: %.loc21_18.1: ref i32 = class_element_access %c.ref.loc21, element1 -// CHECK:STDOUT: %.loc21_18.2: i32 = bind_value %.loc21_18.1 +// CHECK:STDOUT: %k.ref.loc21: %.2 = name_ref k, @Class.%.loc13_8 [template = @Class.%.loc13_8] +// CHECK:STDOUT: %.loc21_18.1: ref %i32 = class_element_access %c.ref.loc21, element1 +// CHECK:STDOUT: %.loc21_18.2: %i32 = bind_value %.loc21_18.1 // CHECK:STDOUT: assign %ck.var, %.loc21_18.2 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index 7db89460b93e..081906a6d672 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -26,28 +26,32 @@ fn Test() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Class, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.j: i32, .k: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Class, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.j: %i32, .k: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Test.type: type = fn_type @Test [template] // CHECK:STDOUT: %Test: %Test.type = struct_value () [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 2 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.31: = bound_method %.30, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -66,15 +70,17 @@ fn Test() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl j, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] -// CHECK:STDOUT: %.loc13_8: %.1 = field_decl k, element1 [template] -// CHECK:STDOUT: %.loc14: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed.loc12, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl j, element0 [template] +// CHECK:STDOUT: %.loc13_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.3: type = converted %int.make_type_signed.loc13, %.loc13_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8: %.2 = field_decl k, element1 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -88,46 +94,50 @@ fn Test() { // CHECK:STDOUT: %cv.var: ref %Class = var cv // CHECK:STDOUT: %cv: ref %Class = bind_name cv, %cv.var // CHECK:STDOUT: %cv.ref.loc18: ref %Class = name_ref cv, %cv -// CHECK:STDOUT: %j.ref.loc18: %.1 = name_ref j, @Class.%.loc12_8 [template = @Class.%.loc12_8] -// CHECK:STDOUT: %.loc18_5: ref i32 = class_element_access %cv.ref.loc18, element0 -// CHECK:STDOUT: %.loc18_10: Core.IntLiteral = int_value 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc18_8.1: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_8.2: = bound_method %.loc18_10, %.loc18_8.1 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc18: init i32 = call %.loc18_8.2(%.loc18_10) [template = constants.%.31] -// CHECK:STDOUT: %.loc18_8.3: init i32 = converted %.loc18_10, %int.convert_checked.loc18 [template = constants.%.31] -// CHECK:STDOUT: assign %.loc18_5, %.loc18_8.3 +// CHECK:STDOUT: %j.ref.loc18: %.2 = name_ref j, @Class.%.loc12_8 [template = @Class.%.loc12_8] +// CHECK:STDOUT: %.loc18_5: ref %i32 = class_element_access %cv.ref.loc18, element0 +// CHECK:STDOUT: %.loc18_10: Core.IntLiteral = int_value 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc18_8.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_8.2: = bound_method %.loc18_10, %.loc18_8.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc18_8.3: = specific_function %.loc18_8.2, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %.loc18_8.3(%.loc18_10) [template = constants.%.29] +// CHECK:STDOUT: %.loc18_8.4: init %i32 = converted %.loc18_10, %int.convert_checked.loc18 [template = constants.%.29] +// CHECK:STDOUT: assign %.loc18_5, %.loc18_8.4 // CHECK:STDOUT: %cv.ref.loc19: ref %Class = name_ref cv, %cv -// CHECK:STDOUT: %k.ref.loc19: %.1 = name_ref k, @Class.%.loc13_8 [template = @Class.%.loc13_8] -// CHECK:STDOUT: %.loc19_5: ref i32 = class_element_access %cv.ref.loc19, element1 -// CHECK:STDOUT: %.loc19_10: Core.IntLiteral = int_value 2 [template = constants.%.32] -// CHECK:STDOUT: %.loc19_8.1: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc19_8.2: = bound_method %.loc19_10, %.loc19_8.1 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc19: init i32 = call %.loc19_8.2(%.loc19_10) [template = constants.%.34] -// CHECK:STDOUT: %.loc19_8.3: init i32 = converted %.loc19_10, %int.convert_checked.loc19 [template = constants.%.34] -// CHECK:STDOUT: assign %.loc19_5, %.loc19_8.3 +// CHECK:STDOUT: %k.ref.loc19: %.2 = name_ref k, @Class.%.loc13_8 [template = @Class.%.loc13_8] +// CHECK:STDOUT: %.loc19_5: ref %i32 = class_element_access %cv.ref.loc19, element1 +// CHECK:STDOUT: %.loc19_10: Core.IntLiteral = int_value 2 [template = constants.%.30] +// CHECK:STDOUT: %.loc19_8.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc19_8.2: = bound_method %.loc19_10, %.loc19_8.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc19_8.3: = specific_function %.loc19_8.2, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %.loc19_8.3(%.loc19_10) [template = constants.%.33] +// CHECK:STDOUT: %.loc19_8.4: init %i32 = converted %.loc19_10, %int.convert_checked.loc19 [template = constants.%.33] +// CHECK:STDOUT: assign %.loc19_5, %.loc19_8.4 // CHECK:STDOUT: %Class.ref.loc20: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %cv.ref.loc20: ref %Class = name_ref cv, %cv // CHECK:STDOUT: %.loc20: %Class = bind_value %cv.ref.loc20 // CHECK:STDOUT: %c: %Class = bind_name c, %.loc20 -// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] -// CHECK:STDOUT: %.loc21_11.2: type = converted %int.make_type_32.loc21, %.loc21_11.1 [template = i32] -// CHECK:STDOUT: %cj.var: ref i32 = var cj -// CHECK:STDOUT: %cj: ref i32 = bind_name cj, %cj.var +// CHECK:STDOUT: %.loc21_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%.loc21_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_11.2: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_11.3: type = converted %int.make_type_signed.loc21, %.loc21_11.2 [template = constants.%i32] +// CHECK:STDOUT: %cj.var: ref %i32 = var cj +// CHECK:STDOUT: %cj: ref %i32 = bind_name cj, %cj.var // CHECK:STDOUT: %c.ref.loc21: %Class = name_ref c, %c -// CHECK:STDOUT: %j.ref.loc21: %.1 = name_ref j, @Class.%.loc12_8 [template = @Class.%.loc12_8] -// CHECK:STDOUT: %.loc21_18.1: ref i32 = class_element_access %c.ref.loc21, element0 -// CHECK:STDOUT: %.loc21_18.2: i32 = bind_value %.loc21_18.1 +// CHECK:STDOUT: %j.ref.loc21: %.2 = name_ref j, @Class.%.loc12_8 [template = @Class.%.loc12_8] +// CHECK:STDOUT: %.loc21_18.1: ref %i32 = class_element_access %c.ref.loc21, element0 +// CHECK:STDOUT: %.loc21_18.2: %i32 = bind_value %.loc21_18.1 // CHECK:STDOUT: assign %cj.var, %.loc21_18.2 -// CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] -// CHECK:STDOUT: %.loc22_11.2: type = converted %int.make_type_32.loc22, %.loc22_11.1 [template = i32] -// CHECK:STDOUT: %ck.var: ref i32 = var ck -// CHECK:STDOUT: %ck: ref i32 = bind_name ck, %ck.var +// CHECK:STDOUT: %.loc22_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%.loc22_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc22_11.2: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] +// CHECK:STDOUT: %.loc22_11.3: type = converted %int.make_type_signed.loc22, %.loc22_11.2 [template = constants.%i32] +// CHECK:STDOUT: %ck.var: ref %i32 = var ck +// CHECK:STDOUT: %ck: ref %i32 = bind_name ck, %ck.var // CHECK:STDOUT: %c.ref.loc22: %Class = name_ref c, %c -// CHECK:STDOUT: %k.ref.loc22: %.1 = name_ref k, @Class.%.loc13_8 [template = @Class.%.loc13_8] -// CHECK:STDOUT: %.loc22_18.1: ref i32 = class_element_access %c.ref.loc22, element1 -// CHECK:STDOUT: %.loc22_18.2: i32 = bind_value %.loc22_18.1 +// CHECK:STDOUT: %k.ref.loc22: %.2 = name_ref k, @Class.%.loc13_8 [template = @Class.%.loc13_8] +// CHECK:STDOUT: %.loc22_18.1: ref %i32 = class_element_access %c.ref.loc22, element1 +// CHECK:STDOUT: %.loc22_18.2: %i32 = bind_value %.loc22_18.1 // CHECK:STDOUT: assign %ck.var, %.loc22_18.2 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/generic/base_is_generic.carbon b/toolchain/check/testdata/class/generic/base_is_generic.carbon index 967a2dd597b4..4e01653072cd 100644 --- a/toolchain/check/testdata/class/generic/base_is_generic.carbon +++ b/toolchain/check/testdata/class/generic/base_is_generic.carbon @@ -103,26 +103,28 @@ fn H() { // CHECK:STDOUT: %.2: type = struct_type {.x: %T} [symbolic] // CHECK:STDOUT: %.3: = complete_type_witness %.2 [symbolic] // CHECK:STDOUT: %Param: type = class_type @Param [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %Param, i32 [template] -// CHECK:STDOUT: %.5: type = struct_type {.y: i32} [template] -// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.4 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %Param, %i32 [template] +// CHECK:STDOUT: %.6: type = struct_type {.y: %i32} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %Base.3: type = class_type @Base, @Base(%Param) [template] -// CHECK:STDOUT: %.7: type = unbound_element_type %Base.3, %Param [template] -// CHECK:STDOUT: %.8: type = struct_type {.x: %Param} [template] -// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] -// CHECK:STDOUT: %.13: type = unbound_element_type %Derived, %Base.3 [template] -// CHECK:STDOUT: %.14: type = struct_type {.base: %Base.3} [template] -// CHECK:STDOUT: %.15: = complete_type_witness %.14 [template] +// CHECK:STDOUT: %.8: type = unbound_element_type %Base.3, %Param [template] +// CHECK:STDOUT: %.9: type = struct_type {.x: %Param} [template] +// CHECK:STDOUT: %.10: = complete_type_witness %.9 [template] +// CHECK:STDOUT: %.14: type = unbound_element_type %Derived, %Base.3 [template] +// CHECK:STDOUT: %.15: type = struct_type {.base: %Base.3} [template] +// CHECK:STDOUT: %.16: = complete_type_witness %.15 [template] // CHECK:STDOUT: %DoubleFieldAccess.type: type = fn_type @DoubleFieldAccess [template] // CHECK:STDOUT: %DoubleFieldAccess: %DoubleFieldAccess.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -149,17 +151,18 @@ fn H() { // CHECK:STDOUT: %DoubleFieldAccess.decl: %DoubleFieldAccess.type = fn_decl @DoubleFieldAccess [template = constants.%DoubleFieldAccess] { // CHECK:STDOUT: %d.patt: %Derived = binding_pattern d // CHECK:STDOUT: %d.param_patt: %Derived = value_param_pattern %d.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_37.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_37.2: type = converted %int.make_type_32, %.loc16_37.1 [template = i32] +// CHECK:STDOUT: %.loc16_37.1: Core.IntLiteral = int_value 32 [template = constants.%.4] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc16_37.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_37.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc16_37.3: type = converted %int.make_type_signed, %.loc16_37.2 [template = constants.%i32] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -185,11 +188,12 @@ fn H() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Param { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc9_10.2: type = converted %int.make_type_32, %.loc9_10.1 [template = i32] -// CHECK:STDOUT: %.loc9_8: %.4 = field_decl y, element0 [template] -// CHECK:STDOUT: %.loc10: = complete_type_witness %.5 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_10.1: Core.IntLiteral = int_value 32 [template = constants.%.4] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc9_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc9_10.3: type = converted %int.make_type_signed, %.loc9_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_8: %.5 = field_decl y, element0 [template] +// CHECK:STDOUT: %.loc10: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Param @@ -200,8 +204,8 @@ fn H() { // CHECK:STDOUT: %Base.ref: %Base.type = name_ref Base, file.%Base.decl [template = constants.%Base.1] // CHECK:STDOUT: %Param.ref: type = name_ref Param, file.%Param.decl [template = constants.%Param] // CHECK:STDOUT: %Base: type = class_type @Base, @Base(constants.%Param) [template = constants.%Base.3] -// CHECK:STDOUT: %.loc13: %.13 = base_decl %Base.3, element0 [template] -// CHECK:STDOUT: %.loc14: = complete_type_witness %.14 [template = constants.%.15] +// CHECK:STDOUT: %.loc13: %.14 = base_decl %Base.3, element0 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.15 [template = constants.%.16] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -209,16 +213,16 @@ fn H() { // CHECK:STDOUT: extend %Base // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @DoubleFieldAccess(%d.param_patt: %Derived) -> i32 { +// CHECK:STDOUT: fn @DoubleFieldAccess(%d.param_patt: %Derived) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d -// CHECK:STDOUT: %x.ref: %.7 = name_ref x, @Base.%.loc5_8.1 [template = @Base.%.loc5_8.1] +// CHECK:STDOUT: %x.ref: %.8 = name_ref x, @Base.%.loc5_8.1 [template = @Base.%.loc5_8.1] // CHECK:STDOUT: %.loc17_11.1: ref %Base.3 = class_element_access %d.ref, element0 // CHECK:STDOUT: %.loc17_11.2: ref %Base.3 = converted %d.ref, %.loc17_11.1 // CHECK:STDOUT: %.loc17_11.3: ref %Param = class_element_access %.loc17_11.2, element0 -// CHECK:STDOUT: %y.ref: %.4 = name_ref y, @Param.%.loc9_8 [template = @Param.%.loc9_8] -// CHECK:STDOUT: %.loc17_13.1: ref i32 = class_element_access %.loc17_11.3, element0 -// CHECK:STDOUT: %.loc17_13.2: i32 = bind_value %.loc17_13.1 +// CHECK:STDOUT: %y.ref: %.5 = name_ref y, @Param.%.loc9_8 [template = @Param.%.loc9_8] +// CHECK:STDOUT: %.loc17_13.1: ref %i32 = class_element_access %.loc17_11.3, element0 +// CHECK:STDOUT: %.loc17_13.2: %i32 = bind_value %.loc17_13.1 // CHECK:STDOUT: return %.loc17_13.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -238,9 +242,9 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Base => constants.%Base.3 -// CHECK:STDOUT: %.loc5_8.2 => constants.%.7 -// CHECK:STDOUT: %.loc6_1.2 => constants.%.8 -// CHECK:STDOUT: %.loc6_1.3 => constants.%.9 +// CHECK:STDOUT: %.loc5_8.2 => constants.%.8 +// CHECK:STDOUT: %.loc6_1.2 => constants.%.9 +// CHECK:STDOUT: %.loc6_1.3 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import.carbon @@ -248,39 +252,41 @@ fn H() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %Param: type = class_type @Param [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %.3: type = struct_type {.x: %T} [symbolic] -// CHECK:STDOUT: %.4: = complete_type_witness %.3 [symbolic] +// CHECK:STDOUT: %.4: type = struct_type {.x: %T} [symbolic] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [symbolic] // CHECK:STDOUT: %Base.2: type = class_type @Base, @Base(%T) [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Base.3: type = class_type @Base, @Base(%Param) [template] -// CHECK:STDOUT: %.8: type = unbound_element_type %Base.2, %T [symbolic] -// CHECK:STDOUT: %.9: type = unbound_element_type %Base.3, %Param [template] -// CHECK:STDOUT: %.10: type = struct_type {.x: %Param} [template] -// CHECK:STDOUT: %.11: = complete_type_witness %.10 [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.9: type = unbound_element_type %Base.2, %T [symbolic] +// CHECK:STDOUT: %.10: type = unbound_element_type %Base.3, %Param [template] +// CHECK:STDOUT: %.11: type = struct_type {.x: %Param} [template] +// CHECK:STDOUT: %.12: = complete_type_witness %.11 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %ImportedDoubleFieldAccess.type: type = fn_type @ImportedDoubleFieldAccess [template] // CHECK:STDOUT: %ImportedDoubleFieldAccess: %ImportedDoubleFieldAccess.type = struct_value () [template] -// CHECK:STDOUT: %.16: type = unbound_element_type %Param, i32 [template] +// CHECK:STDOUT: %.17: type = unbound_element_type %Param, %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//extend_generic_base, inst+9, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Main//extend_generic_base, inst+26, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//extend_generic_base, inst+43, loaded [template = constants.%Derived] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//extend_generic_base, inst+72, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//extend_generic_base, inst+50, loaded [template = constants.%Derived] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//extend_generic_base, inst+80, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.11 +// CHECK:STDOUT: .Int = %import_ref.11 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.5 = import_ref Main//extend_generic_base, inst+27, unloaded -// CHECK:STDOUT: %import_ref.6: %.16 = import_ref Main//extend_generic_base, inst+39, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.6: %.17 = import_ref Main//extend_generic_base, inst+46, loaded [template = %.1] // CHECK:STDOUT: %import_ref.7 = import_ref Main//extend_generic_base, inst+15, unloaded -// CHECK:STDOUT: %import_ref.8: @Base.%.1 (%.8) = import_ref Main//extend_generic_base, inst+18, loaded [template = %.2] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//extend_generic_base, inst+44, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//extend_generic_base, inst+56, unloaded +// CHECK:STDOUT: %import_ref.8: @Base.%.1 (%.9) = import_ref Main//extend_generic_base, inst+18, loaded [template = %.2] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//extend_generic_base, inst+51, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//extend_generic_base, inst+63, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -297,17 +303,18 @@ fn H() { // CHECK:STDOUT: %ImportedDoubleFieldAccess.decl: %ImportedDoubleFieldAccess.type = fn_decl @ImportedDoubleFieldAccess [template = constants.%ImportedDoubleFieldAccess] { // CHECK:STDOUT: %d.patt: %Derived = binding_pattern d // CHECK:STDOUT: %d.param_patt: %Derived = value_param_pattern %d.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, imports.%import_ref.3 [template = constants.%Derived] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_45.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc6_45.2: type = converted %int.make_type_32, %.loc6_45.1 [template = i32] +// CHECK:STDOUT: %.loc6_45.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc6_45.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_45.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc6_45.3: type = converted %int.make_type_signed, %.loc6_45.2 [template = constants.%i32] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -330,9 +337,9 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T) [symbolic = %Base (constants.%Base.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @Base.%Base (%Base.2), @Base.%T (%T) [symbolic = %.1 (constants.%.8)] -// CHECK:STDOUT: %.2: type = struct_type {.x: @Base.%T (%T)} [symbolic = %.2 (constants.%.3)] -// CHECK:STDOUT: %.3: = complete_type_witness @Base.%.2 (%.3) [symbolic = %.3 (constants.%.4)] +// CHECK:STDOUT: %.1: type = unbound_element_type @Base.%Base (%Base.2), @Base.%T (%T) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %.2: type = struct_type {.x: @Base.%T (%T)} [symbolic = %.2 (constants.%.4)] +// CHECK:STDOUT: %.3: = complete_type_witness @Base.%.2 (%.4) [symbolic = %.3 (constants.%.5)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: @@ -341,16 +348,16 @@ fn H() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ImportedDoubleFieldAccess(%d.param_patt: %Derived) -> i32 { +// CHECK:STDOUT: fn @ImportedDoubleFieldAccess(%d.param_patt: %Derived) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d -// CHECK:STDOUT: %x.ref: %.9 = name_ref x, imports.%import_ref.8 [template = imports.%.2] +// CHECK:STDOUT: %x.ref: %.10 = name_ref x, imports.%import_ref.8 [template = imports.%.2] // CHECK:STDOUT: %.loc7_11.1: ref %Base.3 = class_element_access %d.ref, element0 // CHECK:STDOUT: %.loc7_11.2: ref %Base.3 = converted %d.ref, %.loc7_11.1 // CHECK:STDOUT: %.loc7_11.3: ref %Param = class_element_access %.loc7_11.2, element0 -// CHECK:STDOUT: %y.ref: %.16 = name_ref y, imports.%import_ref.6 [template = imports.%.1] -// CHECK:STDOUT: %.loc7_13.1: ref i32 = class_element_access %.loc7_11.3, element0 -// CHECK:STDOUT: %.loc7_13.2: i32 = bind_value %.loc7_13.1 +// CHECK:STDOUT: %y.ref: %.17 = name_ref y, imports.%import_ref.6 [template = imports.%.1] +// CHECK:STDOUT: %.loc7_13.1: ref %i32 = class_element_access %.loc7_11.3, element0 +// CHECK:STDOUT: %.loc7_13.2: %i32 = bind_value %.loc7_13.1 // CHECK:STDOUT: return %.loc7_13.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -365,9 +372,9 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Base => constants.%Base.3 -// CHECK:STDOUT: %.1 => constants.%.9 -// CHECK:STDOUT: %.2 => constants.%.10 -// CHECK:STDOUT: %.3 => constants.%.11 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %.2 => constants.%.11 +// CHECK:STDOUT: %.3 => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Base(%T) { @@ -498,21 +505,23 @@ fn H() { // CHECK:STDOUT: %.7: = complete_type_witness %.6 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %C.3: type = class_type @C, @C(i32) [template] -// CHECK:STDOUT: %X.4: type = class_type @X, @X(i32) [template] -// CHECK:STDOUT: %.8: type = unbound_element_type %C.3, %X.4 [template] -// CHECK:STDOUT: %.9: type = struct_type {.base: %X.4} [template] -// CHECK:STDOUT: %.10: = complete_type_witness %.9 [template] -// CHECK:STDOUT: %G.type.3: type = fn_type @G, @X(i32) [template] +// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.8 [template] +// CHECK:STDOUT: %C.3: type = class_type @C, @C(%i32) [template] +// CHECK:STDOUT: %X.4: type = class_type @X, @X(%i32) [template] +// CHECK:STDOUT: %.9: type = unbound_element_type %C.3, %X.4 [template] +// CHECK:STDOUT: %.10: type = struct_type {.base: %X.4} [template] +// CHECK:STDOUT: %.11: = complete_type_witness %.10 [template] +// CHECK:STDOUT: %G.type.3: type = fn_type @G, @X(%i32) [template] // CHECK:STDOUT: %G.3: %G.type.3 = struct_value () [template] -// CHECK:STDOUT: %.13: = specific_function %G.3, @G(i32) [template] +// CHECK:STDOUT: %.14: = specific_function %G.3, @G(%i32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -615,21 +624,23 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc13_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13_10 [template = i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13_10, %.loc13_10.1 [template = i32] +// CHECK:STDOUT: %.loc13_10.1: Core.IntLiteral = int_value 32 [template = constants.%.8] +// CHECK:STDOUT: %int.make_type_signed.loc13_10: init type = call constants.%Int(%.loc13_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.2: type = value_of_initializer %int.make_type_signed.loc13_10 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.3: type = converted %int.make_type_signed.loc13_10, %.loc13_10.2 [template = constants.%i32] // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] -// CHECK:STDOUT: %int.make_type_32.loc13_18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_32.loc13_18 [template = i32] -// CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_32.loc13_18, %.loc13_17.1 [template = i32] -// CHECK:STDOUT: %C: type = class_type @C, @C(i32) [template = constants.%C.3] -// CHECK:STDOUT: %.loc13_22.1: %G.type.3 = specific_constant @X.%G.decl, @X(i32) [template = constants.%G.3] +// CHECK:STDOUT: %.loc13_18: Core.IntLiteral = int_value 32 [template = constants.%.8] +// CHECK:STDOUT: %int.make_type_signed.loc13_18: init type = call constants.%Int(%.loc13_18) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_signed.loc13_18 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_signed.loc13_18, %.loc13_17.1 [template = constants.%i32] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.3] +// CHECK:STDOUT: %.loc13_22.1: %G.type.3 = specific_constant @X.%G.decl, @X(constants.%i32) [template = constants.%G.3] // CHECK:STDOUT: %G.ref: %G.type.3 = name_ref G, %.loc13_22.1 [template = constants.%G.3] -// CHECK:STDOUT: %.loc13_22.2: = specific_function %G.ref, @G(i32) [template = constants.%.13] -// CHECK:STDOUT: %G.call: init i32 = call %.loc13_22.2() -// CHECK:STDOUT: %.loc13_26.1: i32 = value_of_initializer %G.call -// CHECK:STDOUT: %.loc13_26.2: i32 = converted %G.call, %.loc13_26.1 -// CHECK:STDOUT: %i: i32 = bind_name i, %.loc13_26.2 +// CHECK:STDOUT: %.loc13_22.2: = specific_function %G.ref, @G(constants.%i32) [template = constants.%.14] +// CHECK:STDOUT: %G.call: init %i32 = call %.loc13_22.2() +// CHECK:STDOUT: %.loc13_26.1: %i32 = value_of_initializer %G.call +// CHECK:STDOUT: %.loc13_26.2: %i32 = converted %G.call, %.loc13_26.1 +// CHECK:STDOUT: %i: %i32 = bind_name i, %.loc13_26.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -689,34 +700,34 @@ fn H() { // CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(i32) { -// CHECK:STDOUT: %T.loc8_9.2 => i32 -// CHECK:STDOUT: %T.patt.loc8_9.2 => i32 +// CHECK:STDOUT: specific @C(constants.%i32) { +// CHECK:STDOUT: %T.loc8_9.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %X.loc9_17.2 => constants.%X.4 // CHECK:STDOUT: %C => constants.%C.3 -// CHECK:STDOUT: %.loc9_20.2 => constants.%.8 -// CHECK:STDOUT: %.loc10_1.2 => constants.%.9 -// CHECK:STDOUT: %.loc10_1.3 => constants.%.10 +// CHECK:STDOUT: %.loc9_20.2 => constants.%.9 +// CHECK:STDOUT: %.loc10_1.2 => constants.%.10 +// CHECK:STDOUT: %.loc10_1.3 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @X(i32) { -// CHECK:STDOUT: %U.loc4_14.2 => i32 -// CHECK:STDOUT: %U.patt.loc4_14.2 => i32 +// CHECK:STDOUT: specific @X(constants.%i32) { +// CHECK:STDOUT: %U.loc4_14.2 => constants.%i32 +// CHECK:STDOUT: %U.patt.loc4_14.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %G.type => constants.%G.type.3 // CHECK:STDOUT: %G => constants.%G.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @G(i32) { -// CHECK:STDOUT: %U => i32 +// CHECK:STDOUT: specific @G(constants.%i32) { +// CHECK:STDOUT: %U => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %G.type => constants.%G.type.3 // CHECK:STDOUT: %G => constants.%G.3 -// CHECK:STDOUT: %.loc5_24.3 => constants.%.13 +// CHECK:STDOUT: %.loc5_24.3 => constants.%.14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_extend_generic_symbolic_base.carbon @@ -724,8 +735,10 @@ fn H() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] @@ -733,21 +746,21 @@ fn H() { // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %X.3: type = class_type @X, @X(%T) [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%T) [symbolic] -// CHECK:STDOUT: %.3: type = unbound_element_type %C.2, %X.3 [symbolic] -// CHECK:STDOUT: %.4: type = struct_type {.base: %X.3} [symbolic] -// CHECK:STDOUT: %.5: = complete_type_witness %.4 [symbolic] +// CHECK:STDOUT: %.4: type = unbound_element_type %C.2, %X.3 [symbolic] +// CHECK:STDOUT: %.5: type = struct_type {.base: %X.3} [symbolic] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %G.type.1: type = fn_type @G, @X(%U) [symbolic] // CHECK:STDOUT: %G.1: %G.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.6: = specific_function %G.1, @G(%U) [symbolic] +// CHECK:STDOUT: %.7: = specific_function %G.1, @G(%U) [symbolic] // CHECK:STDOUT: %G.type.2: type = fn_type @G, @X(%T) [symbolic] // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [symbolic] -// CHECK:STDOUT: %C.3: type = class_type @C, @C(i32) [template] -// CHECK:STDOUT: %X.4: type = class_type @X, @X(i32) [template] -// CHECK:STDOUT: %.7: type = unbound_element_type %C.3, %X.4 [template] -// CHECK:STDOUT: %.8: type = struct_type {.base: %X.4} [template] -// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] -// CHECK:STDOUT: %.13: = specific_function %G.2, @G(%T) [symbolic] +// CHECK:STDOUT: %C.3: type = class_type @C, @C(%i32) [template] +// CHECK:STDOUT: %X.4: type = class_type @X, @X(%i32) [template] +// CHECK:STDOUT: %.8: type = unbound_element_type %C.3, %X.4 [template] +// CHECK:STDOUT: %.9: type = struct_type {.base: %X.4} [template] +// CHECK:STDOUT: %.10: = complete_type_witness %.9 [template] +// CHECK:STDOUT: %.14: = specific_function %G.2, @G(%T) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -755,7 +768,7 @@ fn H() { // CHECK:STDOUT: %import_ref.2: %C.type = import_ref Main//extend_generic_symbolic_base, inst+47, loaded [template = constants.%C.1] // CHECK:STDOUT: %import_ref.3 = import_ref Main//extend_generic_symbolic_base, inst+70, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.4 +// CHECK:STDOUT: .Int = %import_ref.4 // CHECK:STDOUT: .ImplicitAs = %import_ref.9 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -786,9 +799,9 @@ fn H() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %X: type = class_type @X, @X(%T) [symbolic = %X (constants.%X.3)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @C.%C (%C.2), @C.%X (%X.3) [symbolic = %.1 (constants.%.3)] -// CHECK:STDOUT: %.2: type = struct_type {.base: @C.%X (%X.3)} [symbolic = %.2 (constants.%.4)] -// CHECK:STDOUT: %.3: = complete_type_witness @C.%.2 (%.4) [symbolic = %.3 (constants.%.5)] +// CHECK:STDOUT: %.1: type = unbound_element_type @C.%C (%C.2), @C.%X (%X.3) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: type = struct_type {.base: @C.%X (%X.3)} [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: %.3: = complete_type_witness @C.%.2 (%.5) [symbolic = %.3 (constants.%.6)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: @@ -815,20 +828,22 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: fn @H() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc13_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13_10 [template = i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13_10, %.loc13_10.1 [template = i32] +// CHECK:STDOUT: %.loc13_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_10: init type = call constants.%Int(%.loc13_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.2: type = value_of_initializer %int.make_type_signed.loc13_10 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.3: type = converted %int.make_type_signed.loc13_10, %.loc13_10.2 [template = constants.%i32] // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.2 [template = constants.%C.1] -// CHECK:STDOUT: %int.make_type_32.loc13_18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_32.loc13_18 [template = i32] -// CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_32.loc13_18, %.loc13_17.1 [template = i32] -// CHECK:STDOUT: %C: type = class_type @C, @C(i32) [template = constants.%C.3] +// CHECK:STDOUT: %.loc13_18: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_18: init type = call constants.%Int(%.loc13_18) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_signed.loc13_18 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_signed.loc13_18, %.loc13_17.1 [template = constants.%i32] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.3] // CHECK:STDOUT: %.loc13_22.1: %G.type.2 = specific_constant imports.%import_ref.6, @X(constants.%T) [symbolic = constants.%G.2] // CHECK:STDOUT: %G.ref: %G.type.2 = name_ref G, %.loc13_22.1 [symbolic = constants.%G.2] -// CHECK:STDOUT: %.loc13_22.2: = specific_function %G.ref, @G(constants.%T) [symbolic = constants.%.13] +// CHECK:STDOUT: %.loc13_22.2: = specific_function %G.ref, @G(constants.%T) [symbolic = constants.%.14] // CHECK:STDOUT: %G.call: init %T = call %.loc13_22.2() -// CHECK:STDOUT: %.loc13_26: i32 = converted %G.call, [template = ] -// CHECK:STDOUT: %j: i32 = bind_name j, +// CHECK:STDOUT: %.loc13_26: %i32 = converted %G.call, [template = ] +// CHECK:STDOUT: %j: %i32 = bind_name j, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -838,7 +853,7 @@ fn H() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %G.type: type = fn_type @G, @X(%U) [symbolic = %G.type (constants.%G.type.1)] // CHECK:STDOUT: %G: @G.%G.type (%G.type.1) = struct_value () [symbolic = %G (constants.%G.1)] -// CHECK:STDOUT: %.1: = specific_function %G, @G(%U) [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %.1: = specific_function %G, @G(%U) [symbolic = %.1 (constants.%.7)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> @G.%U (%U); // CHECK:STDOUT: } @@ -887,7 +902,7 @@ fn H() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %G.type => constants.%G.type.1 // CHECK:STDOUT: %G => constants.%G.1 -// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.1 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @X(@G.%U) { @@ -899,21 +914,21 @@ fn H() { // CHECK:STDOUT: %U => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(i32) { -// CHECK:STDOUT: %T => i32 -// CHECK:STDOUT: %T.patt => i32 +// CHECK:STDOUT: specific @C(constants.%i32) { +// CHECK:STDOUT: %T => constants.%i32 +// CHECK:STDOUT: %T.patt => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %X => constants.%X.4 // CHECK:STDOUT: %C => constants.%C.3 -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %.2 => constants.%.8 -// CHECK:STDOUT: %.3 => constants.%.9 +// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 +// CHECK:STDOUT: %.3 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @X(i32) { -// CHECK:STDOUT: %U => i32 -// CHECK:STDOUT: %U.patt => i32 +// CHECK:STDOUT: specific @X(constants.%i32) { +// CHECK:STDOUT: %U => constants.%i32 +// CHECK:STDOUT: %U.patt => constants.%i32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { @@ -922,6 +937,6 @@ fn H() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %G.type => constants.%G.type.2 // CHECK:STDOUT: %G => constants.%G.2 -// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %.1 => constants.%.14 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index e408a84306e0..1b4e96b5a9a3 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -90,34 +90,38 @@ class Outer(T:! type) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N, 1 [symbolic] -// CHECK:STDOUT: %N.patt.1: i32 = symbolic_binding_pattern N, 1 [symbolic] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T, %N.1) [symbolic] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] -// CHECK:STDOUT: %.3: type = ptr_type i32 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.29: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 5 [template] -// CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(%.3, %.30) [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 0 [template] -// CHECK:STDOUT: %Class.4: type = class_type @Class, @Class(%empty_tuple.type, %.34) [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %i32 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.26: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.27: = specific_function %.26, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.28: %i32 = int_value 5 [template] +// CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(%.4, %.28) [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.31: = bound_method %.30, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 0 [template] +// CHECK:STDOUT: %Class.4: type = class_type @Class, @Class(%empty_tuple.type, %.33) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -135,55 +139,59 @@ class Outer(T:! type) { // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.patt.loc4_23.1: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32, %.loc4_27.1 [template = i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed, %.loc4_27.2 [template = constants.%i32] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc4_23.1: i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.1)] +// CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.ref.loc6: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_17.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc6_17.2: type = converted %int.make_type_32, %.loc6_17.1 [template = i32] -// CHECK:STDOUT: %.loc6_17.3: type = ptr_type i32 [template = constants.%.3] -// CHECK:STDOUT: %.loc6_20: Core.IntLiteral = int_value 5 [template = constants.%.4] -// CHECK:STDOUT: %.loc6_13.1: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_13.2: = bound_method %.loc6_20, %.loc6_13.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc6: init i32 = call %.loc6_13.2(%.loc6_20) [template = constants.%.30] -// CHECK:STDOUT: %.loc6_13.3: i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%.30] -// CHECK:STDOUT: %.loc6_13.4: i32 = converted %.loc6_20, %.loc6_13.3 [template = constants.%.30] -// CHECK:STDOUT: %Class.loc6: type = class_type @Class, @Class(constants.%.3, constants.%.30) [template = constants.%Class.3] +// CHECK:STDOUT: %.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc6_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_17.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc6_17.2: type = converted %int.make_type_signed, %.loc6_17.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_17.3: type = ptr_type %i32 [template = constants.%.4] +// CHECK:STDOUT: %.loc6_20: Core.IntLiteral = int_value 5 [template = constants.%.5] +// CHECK:STDOUT: %.loc6_13.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_13.2: = bound_method %.loc6_20, %.loc6_13.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc6_13.3: = specific_function %.loc6_13.2, @Convert.2(constants.%.1) [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %.loc6_13.3(%.loc6_20) [template = constants.%.28] +// CHECK:STDOUT: %.loc6_13.4: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%.28] +// CHECK:STDOUT: %.loc6_13.5: %i32 = converted %.loc6_20, %.loc6_13.4 [template = constants.%.28] +// CHECK:STDOUT: %Class.loc6: type = class_type @Class, @Class(constants.%.4, constants.%.28) [template = constants.%Class.3] // CHECK:STDOUT: %a.var: ref %Class.3 = var a // CHECK:STDOUT: %a: ref %Class.3 = bind_name a, %a.var // CHECK:STDOUT: %Class.ref.loc9: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %.loc9_15: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_18: Core.IntLiteral = int_value 0 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_18: Core.IntLiteral = int_value 0 [template = constants.%.30] // CHECK:STDOUT: %.loc9_13.1: type = converted %.loc9_15, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc9_13.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_13.3: = bound_method %.loc9_18, %.loc9_13.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc9: init i32 = call %.loc9_13.3(%.loc9_18) [template = constants.%.34] -// CHECK:STDOUT: %.loc9_13.4: i32 = value_of_initializer %int.convert_checked.loc9 [template = constants.%.34] -// CHECK:STDOUT: %.loc9_13.5: i32 = converted %.loc9_18, %.loc9_13.4 [template = constants.%.34] -// CHECK:STDOUT: %Class.loc9: type = class_type @Class, @Class(constants.%empty_tuple.type, constants.%.34) [template = constants.%Class.4] +// CHECK:STDOUT: %.loc9_13.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_13.3: = bound_method %.loc9_18, %.loc9_13.2 [template = constants.%.31] +// CHECK:STDOUT: %.loc9_13.4: = specific_function %.loc9_13.3, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %.loc9_13.4(%.loc9_18) [template = constants.%.33] +// CHECK:STDOUT: %.loc9_13.5: %i32 = value_of_initializer %int.convert_checked.loc9 [template = constants.%.33] +// CHECK:STDOUT: %.loc9_13.6: %i32 = converted %.loc9_18, %.loc9_13.5 [template = constants.%.33] +// CHECK:STDOUT: %Class.loc9: type = class_type @Class, @Class(constants.%empty_tuple.type, constants.%.33) [template = constants.%Class.4] // CHECK:STDOUT: %b.var: ref %Class.4 = var b // CHECK:STDOUT: %b: ref %Class.4 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: i32) { +// CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: %i32) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc4_23.2: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.loc4_23.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc4_23.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc4_33: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_33: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 @@ -197,20 +205,20 @@ class Outer(T:! type) { // CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(constants.%.3, constants.%.30) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%.3 -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%.3 -// CHECK:STDOUT: %N.loc4_23.2 => constants.%.30 -// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%.30 +// CHECK:STDOUT: specific @Class(constants.%.4, constants.%.28) { +// CHECK:STDOUT: %T.loc4_13.2 => constants.%.4 +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%.4 +// CHECK:STDOUT: %N.loc4_23.2 => constants.%.28 +// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%.28 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(constants.%empty_tuple.type, constants.%.34) { +// CHECK:STDOUT: specific @Class(constants.%empty_tuple.type, constants.%.33) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%empty_tuple.type // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%empty_tuple.type -// CHECK:STDOUT: %N.loc4_23.2 => constants.%.34 -// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%.34 +// CHECK:STDOUT: %N.loc4_23.2 => constants.%.33 +// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%.33 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -220,21 +228,23 @@ class Outer(T:! type) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 1 [symbolic] -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 1 [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %N: %i32 = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt: %i32 = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T, %N) [symbolic] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] -// CHECK:STDOUT: %.3: type = ptr_type i32 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -250,36 +260,38 @@ class Outer(T:! type) { // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.patt.loc4_23.1: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32, %.loc4_27.1 [template = i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed, %.loc4_27.2 [template = constants.%i32] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc4_23.1: i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N)] +// CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_32, %.loc13_17.1 [template = i32] -// CHECK:STDOUT: %.loc13_17.3: type = ptr_type i32 [template = constants.%.3] +// CHECK:STDOUT: %.loc13_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_signed, %.loc13_17.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_17.3: type = ptr_type %i32 [template = constants.%.4] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: i32) { +// CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: %i32) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N)] -// CHECK:STDOUT: %N.patt.loc4_23.2: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.loc4_23.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc4_23.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc4_33: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_33: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 @@ -298,23 +310,25 @@ class Outer(T:! type) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 1 [symbolic] -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 1 [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %N: %i32 = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt: %i32 = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T, %N) [symbolic] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] -// CHECK:STDOUT: %.3: type = ptr_type i32 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %i32 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -330,38 +344,40 @@ class Outer(T:! type) { // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.patt.loc4_23.1: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32, %.loc4_27.1 [template = i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed, %.loc4_27.2 [template = constants.%i32] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc4_23.1: i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N)] +// CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_32, %.loc13_17.1 [template = i32] -// CHECK:STDOUT: %.loc13_17.3: type = ptr_type i32 [template = constants.%.3] -// CHECK:STDOUT: %.loc13_20: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc13_23: Core.IntLiteral = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc13_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_signed, %.loc13_17.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_17.3: type = ptr_type %i32 [template = constants.%.4] +// CHECK:STDOUT: %.loc13_20: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc13_23: Core.IntLiteral = int_value 2 [template = constants.%.6] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: i32) { +// CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: %i32) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N)] -// CHECK:STDOUT: %N.patt.loc4_23.2: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.loc4_23.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc4_23.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc4_33: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_33: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 @@ -380,22 +396,24 @@ class Outer(T:! type) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N, 1 [symbolic] -// CHECK:STDOUT: %N.patt.1: i32 = symbolic_binding_pattern N, 1 [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T, %N.1) [symbolic] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %.4: type = ptr_type i32 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.5: type = ptr_type %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -412,38 +430,40 @@ class Outer(T:! type) { // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.patt.loc4_23.1: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32, %.loc4_27.1 [template = i32] +// CHECK:STDOUT: %.loc4_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: type = converted %int.make_type_signed, %.loc4_27.2 [template = constants.%i32] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc4_23.1: i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.1)] +// CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %.loc15_14: Core.IntLiteral = int_value 5 [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_20.2: type = converted %int.make_type_32, %.loc15_20.1 [template = i32] -// CHECK:STDOUT: %.loc15_20.3: type = ptr_type i32 [template = constants.%.4] +// CHECK:STDOUT: %.loc15_14: Core.IntLiteral = int_value 5 [template = constants.%.4] +// CHECK:STDOUT: %.loc15_17: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_17) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_20.2: type = converted %int.make_type_signed, %.loc15_20.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_20.3: type = ptr_type %i32 [template = constants.%.5] // CHECK:STDOUT: %.loc15_13: type = converted %.loc15_14, [template = ] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: i32) { +// CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: %i32) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc4_23.2: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.loc4_23.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc4_23.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc4_33: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_33: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 diff --git a/toolchain/check/testdata/class/generic/field.carbon b/toolchain/check/testdata/class/generic/field.carbon index 5a34d983e097..62e4fcd7cdd6 100644 --- a/toolchain/check/testdata/class/generic/field.carbon +++ b/toolchain/check/testdata/class/generic/field.carbon @@ -35,14 +35,16 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %.1: type = unbound_element_type %Class.2, %T [symbolic] // CHECK:STDOUT: %.2: type = struct_type {.x: %T} [symbolic] // CHECK:STDOUT: %.3: = complete_type_witness %.2 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(i32) [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.4 [template] +// CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(%i32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %Class.3, i32 [template] -// CHECK:STDOUT: %.5: type = struct_type {.x: i32} [template] -// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %Class.3, %i32 [template] +// CHECK:STDOUT: %.6: type = struct_type {.x: %i32} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic] @@ -50,14 +52,14 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %Class.4: type = class_type @Class, @Class(%U) [symbolic] // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] -// CHECK:STDOUT: %.9: type = unbound_element_type %Class.4, %U [symbolic] -// CHECK:STDOUT: %.10: type = struct_type {.x: %U} [symbolic] -// CHECK:STDOUT: %.11: = complete_type_witness %.10 [symbolic] +// CHECK:STDOUT: %.10: type = unbound_element_type %Class.4, %U [symbolic] +// CHECK:STDOUT: %.11: type = struct_type {.x: %U} [symbolic] +// CHECK:STDOUT: %.12: = complete_type_witness %.11 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -82,21 +84,23 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %c.patt: %Class.3 = binding_pattern c // CHECK:STDOUT: %c.param_patt: %Class.3 = value_param_pattern %c.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %int.make_type_32.loc15_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_14.1: type = value_of_initializer %int.make_type_32.loc15_15 [template = i32] -// CHECK:STDOUT: %.loc15_14.2: type = converted %int.make_type_32.loc15_15, %.loc15_14.1 [template = i32] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(i32) [template = constants.%Class.3] -// CHECK:STDOUT: %int.make_type_32.loc15_24: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_24.1: type = value_of_initializer %int.make_type_32.loc15_24 [template = i32] -// CHECK:STDOUT: %.loc15_24.2: type = converted %int.make_type_32.loc15_24, %.loc15_24.1 [template = i32] +// CHECK:STDOUT: %.loc15_15: Core.IntLiteral = int_value 32 [template = constants.%.4] +// CHECK:STDOUT: %int.make_type_signed.loc15_15: init type = call constants.%Int(%.loc15_15) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_14.1: type = value_of_initializer %int.make_type_signed.loc15_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_14.2: type = converted %int.make_type_signed.loc15_15, %.loc15_14.1 [template = constants.%i32] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.3] +// CHECK:STDOUT: %.loc15_24.1: Core.IntLiteral = int_value 32 [template = constants.%.4] +// CHECK:STDOUT: %int.make_type_signed.loc15_24: init type = call constants.%Int(%.loc15_24.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_24.2: type = value_of_initializer %int.make_type_signed.loc15_24 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_24.3: type = converted %int.make_type_signed.loc15_24, %.loc15_24.2 [template = constants.%i32] // CHECK:STDOUT: %c.param: %Class.3 = value_param runtime_param0 // CHECK:STDOUT: %c: %Class.3 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %T.patt.loc19_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc19_6.2 (constants.%T.patt)] @@ -159,12 +163,12 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%c.param_patt: %Class.3) -> i32 { +// CHECK:STDOUT: fn @F(%c.param_patt: %Class.3) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %Class.3 = name_ref c, %c -// CHECK:STDOUT: %x.ref: %.4 = name_ref x, @Class.%.loc12_8.1 [template = @Class.%.loc12_8.1] -// CHECK:STDOUT: %.loc16_11.1: ref i32 = class_element_access %c.ref, element0 -// CHECK:STDOUT: %.loc16_11.2: i32 = bind_value %.loc16_11.1 +// CHECK:STDOUT: %x.ref: %.5 = name_ref x, @Class.%.loc12_8.1 [template = @Class.%.loc12_8.1] +// CHECK:STDOUT: %.loc16_11.1: ref %i32 = class_element_access %c.ref, element0 +// CHECK:STDOUT: %.loc16_11.2: %i32 = bind_value %.loc16_11.1 // CHECK:STDOUT: return %.loc16_11.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -192,12 +196,12 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %Class.loc23_24.2: type = class_type @Class, @Class(%U.loc23_6.2) [symbolic = %Class.loc23_24.2 (constants.%Class.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc24_11.3: type = unbound_element_type @H.%Class.loc23_24.2 (%Class.4), @H.%U.loc23_6.2 (%U) [symbolic = %.loc24_11.3 (constants.%.9)] +// CHECK:STDOUT: %.loc24_11.3: type = unbound_element_type @H.%Class.loc23_24.2 (%Class.4), @H.%U.loc23_6.2 (%U) [symbolic = %.loc24_11.3 (constants.%.10)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%U.param_patt: type, %c.param_patt: @H.%Class.loc23_24.2 (%Class.4)) -> @H.%U.loc23_6.2 (%U) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: @H.%Class.loc23_24.2 (%Class.4) = name_ref c, %c -// CHECK:STDOUT: %x.ref: @H.%.loc24_11.3 (%.9) = name_ref x, @Class.%.loc12_8.1 [template = @Class.%.loc12_8.1] +// CHECK:STDOUT: %x.ref: @H.%.loc24_11.3 (%.10) = name_ref x, @Class.%.loc12_8.1 [template = @Class.%.loc12_8.1] // CHECK:STDOUT: %.loc24_11.1: ref @H.%U.loc23_6.2 (%U) = class_element_access %c.ref, element0 // CHECK:STDOUT: %.loc24_11.2: @H.%U.loc23_6.2 (%U) = bind_value %.loc24_11.1 // CHECK:STDOUT: return %.loc24_11.2 @@ -220,15 +224,15 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(i32) { -// CHECK:STDOUT: %T.loc11_13.2 => i32 -// CHECK:STDOUT: %T.patt.loc11_13.2 => i32 +// CHECK:STDOUT: specific @Class(constants.%i32) { +// CHECK:STDOUT: %T.loc11_13.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.3 -// CHECK:STDOUT: %.loc12_8.2 => constants.%.4 -// CHECK:STDOUT: %.loc13_1.2 => constants.%.5 -// CHECK:STDOUT: %.loc13_1.3 => constants.%.6 +// CHECK:STDOUT: %.loc12_8.2 => constants.%.5 +// CHECK:STDOUT: %.loc13_1.2 => constants.%.6 +// CHECK:STDOUT: %.loc13_1.3 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@G.%T.loc19_6.2) { @@ -248,9 +252,9 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.4 -// CHECK:STDOUT: %.loc12_8.2 => constants.%.9 -// CHECK:STDOUT: %.loc13_1.2 => constants.%.10 -// CHECK:STDOUT: %.loc13_1.3 => constants.%.11 +// CHECK:STDOUT: %.loc12_8.2 => constants.%.10 +// CHECK:STDOUT: %.loc13_1.2 => constants.%.11 +// CHECK:STDOUT: %.loc13_1.3 => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@H.%U.loc23_6.2) { diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 05c1bc66a84f..410bac46676f 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -94,28 +94,31 @@ class Class(U:! type) { // CHECK:STDOUT: %CompleteClass.type: type = generic_class_type @CompleteClass [template] // CHECK:STDOUT: %CompleteClass.1: %CompleteClass.type = struct_value () [template] // CHECK:STDOUT: %CompleteClass.2: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %CompleteClass.2, i32 [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %CompleteClass.2, %i32 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.2: type = struct_type {.n: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.29: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 0 [template] -// CHECK:STDOUT: %CompleteClass.3: type = class_type @CompleteClass, @CompleteClass(i32) [template] +// CHECK:STDOUT: %.3: type = struct_type {.n: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.26: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.27: = specific_function %.26, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.28: %i32 = int_value 0 [template] +// CHECK:STDOUT: %CompleteClass.3: type = class_type @CompleteClass, @CompleteClass(%i32) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -149,10 +152,11 @@ class Class(U:! type) { // CHECK:STDOUT: %return.param_patt: %CompleteClass.3 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, file.%CompleteClass.decl [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_24.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_24.2: type = converted %int.make_type_32, %.loc11_24.1 [template = i32] -// CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(i32) [template = constants.%CompleteClass.3] +// CHECK:STDOUT: %.loc11_25: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_25) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_24.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_24.2: type = converted %int.make_type_signed, %.loc11_24.1 [template = constants.%i32] +// CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(constants.%i32) [template = constants.%CompleteClass.3] // CHECK:STDOUT: %return.param: ref %CompleteClass.3 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %CompleteClass.3 = return_slot %return.param // CHECK:STDOUT: } @@ -171,26 +175,28 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(%T.loc6_21.2) [symbolic = %CompleteClass (constants.%CompleteClass.2)] -// CHECK:STDOUT: %.loc7_8.2: type = unbound_element_type @CompleteClass.%CompleteClass (%CompleteClass.2), i32 [symbolic = %.loc7_8.2 (constants.%.1)] +// CHECK:STDOUT: %.loc7_8.2: type = unbound_element_type @CompleteClass.%CompleteClass (%CompleteClass.2), %i32 [symbolic = %.loc7_8.2 (constants.%.2)] // CHECK:STDOUT: %F.type: type = fn_type @F.1, @CompleteClass(%T.loc6_21.2) [symbolic = %F.type (constants.%F.type.1)] // CHECK:STDOUT: %F: @CompleteClass.%F.type (%F.type.1) = struct_value () [symbolic = %F (constants.%F.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc7_10.2: type = converted %int.make_type_32, %.loc7_10.1 [template = i32] -// CHECK:STDOUT: %.loc7_8.1: @CompleteClass.%.loc7_8.2 (%.1) = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc7_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc7_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc7_10.3: type = converted %int.make_type_signed, %.loc7_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.1: @CompleteClass.%.loc7_8.2 (%.2) = field_decl n, element0 [template] // CHECK:STDOUT: %F.decl: @CompleteClass.%F.type (%F.type.1) = fn_decl @F.1 [symbolic = @CompleteClass.%F (constants.%F.1)] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_32, %.loc8_13.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc8_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_13.3: type = converted %int.make_type_signed, %.loc8_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc9: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc9: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%CompleteClass.2 @@ -202,15 +208,16 @@ class Class(U:! type) { // CHECK:STDOUT: generic fn @F.1(@CompleteClass.%T.loc6_21.1: type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn() -> i32 { +// CHECK:STDOUT: fn() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc8_26: Core.IntLiteral = int_value 0 [template = constants.%.4] -// CHECK:STDOUT: %.loc8_27.1: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_27.2: = bound_method %.loc8_26, %.loc8_27.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc8_27.2(%.loc8_26) [template = constants.%.30] -// CHECK:STDOUT: %.loc8_27.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.30] -// CHECK:STDOUT: %.loc8_27.4: i32 = converted %.loc8_26, %.loc8_27.3 [template = constants.%.30] -// CHECK:STDOUT: return %.loc8_27.4 +// CHECK:STDOUT: %.loc8_26: Core.IntLiteral = int_value 0 [template = constants.%.5] +// CHECK:STDOUT: %.loc8_27.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_27.2: = bound_method %.loc8_26, %.loc8_27.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc8_27.3: = specific_function %.loc8_27.2, @Convert.2(constants.%.1) [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc8_27.3(%.loc8_26) [template = constants.%.28] +// CHECK:STDOUT: %.loc8_27.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.28] +// CHECK:STDOUT: %.loc8_27.5: %i32 = converted %.loc8_26, %.loc8_27.4 [template = constants.%.28] +// CHECK:STDOUT: return %.loc8_27.5 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -227,7 +234,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.2 -// CHECK:STDOUT: %.loc7_8.2 => constants.%.1 +// CHECK:STDOUT: %.loc7_8.2 => constants.%.2 // CHECK:STDOUT: %F.type => constants.%F.type.1 // CHECK:STDOUT: %F => constants.%F.1 // CHECK:STDOUT: } @@ -239,170 +246,156 @@ class Class(U:! type) { // CHECK:STDOUT: %T.patt.loc6_21.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @CompleteClass(i32) { -// CHECK:STDOUT: %T.loc6_21.2 => i32 -// CHECK:STDOUT: %T.patt.loc6_21.2 => i32 +// CHECK:STDOUT: specific @CompleteClass(constants.%i32) { +// CHECK:STDOUT: %T.loc6_21.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc6_21.2 => constants.%i32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- foo.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, imports.%import_ref.10 [symbolic] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.11 [template] -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %.5: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%.5)> [symbolic] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: = interface_witness (%Convert.2) [symbolic] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.3, @impl.2(%N) [symbolic] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic] -// CHECK:STDOUT: %.6: = interface_witness (%Convert.3) [symbolic] -// CHECK:STDOUT: %.7: type = int_type unsigned, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %.4: = interface_witness (%Convert.3) [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.4, @impl.3(%N) [symbolic] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] -// CHECK:STDOUT: %.8: = interface_witness (%Convert.4) [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %.5: = interface_witness (%Convert.4) [symbolic] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.5 [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.21 [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.5, %Convert.type.5 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.17 [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.5, @impl.4(%N) [symbolic] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] -// CHECK:STDOUT: %.11: = interface_witness (%Convert.6) [symbolic] -// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] -// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] -// CHECK:STDOUT: %.12: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %.8: = interface_witness (%Convert.6) [symbolic] // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] // CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%iN)> [symbolic] // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.9: type = assoc_entity_type %As.type.2, %Convert.type.7 [symbolic] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.27 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.7, @impl.5(%N) [symbolic] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] -// CHECK:STDOUT: %.13: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] -// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.34 [symbolic] -// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] -// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] -// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.35 [template] -// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.5)> [symbolic] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.8) [symbolic] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.8, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.9) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.9, @impl.7(%N) [symbolic] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] -// CHECK:STDOUT: %.17: = interface_witness (%Convert.10) [symbolic] -// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] -// CHECK:STDOUT: %.18: = interface_witness (%Convert.11) [symbolic] -// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] -// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] -// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.45 [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] -// CHECK:STDOUT: %.21: = interface_witness (%Convert.13) [symbolic] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] -// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %.14: type = assoc_entity_type %As.type.5, %Convert.type.11 [template] +// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.12) [symbolic] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T) [symbolic] -// CHECK:STDOUT: %.23: type = unbound_element_type %Class.2, %T [symbolic] -// CHECK:STDOUT: %.24: type = struct_type {.x: %T} [symbolic] -// CHECK:STDOUT: %.25: = complete_type_witness %.24 [symbolic] +// CHECK:STDOUT: %.17: type = unbound_element_type %Class.2, %T [symbolic] +// CHECK:STDOUT: %.18: type = struct_type {.x: %T} [symbolic] +// CHECK:STDOUT: %.19: = complete_type_witness %.18 [symbolic] // CHECK:STDOUT: %CompleteClass.type: type = generic_class_type @CompleteClass [template] // CHECK:STDOUT: %CompleteClass.1: %CompleteClass.type = struct_value () [template] +// CHECK:STDOUT: %.20: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.20 [template] // CHECK:STDOUT: %CompleteClass.2: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic] -// CHECK:STDOUT: %.28: type = unbound_element_type %CompleteClass.2, i32 [symbolic] +// CHECK:STDOUT: %.23: type = unbound_element_type %CompleteClass.2, %i32 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %CompleteClass.3: type = class_type @CompleteClass, @CompleteClass(i32) [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %CompleteClass.3: type = class_type @CompleteClass, @CompleteClass(%i32) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.29: type = unbound_element_type %CompleteClass.3, i32 [template] -// CHECK:STDOUT: %F.type.3: type = fn_type @F.1, @CompleteClass(i32) [template] +// CHECK:STDOUT: %.24: type = unbound_element_type %CompleteClass.3, %i32 [template] +// CHECK:STDOUT: %F.type.3: type = fn_type @F.1, @CompleteClass(%i32) [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.32: type = struct_type {.n: Core.IntLiteral} [template] -// CHECK:STDOUT: %.33: %.1 = assoc_entity element0, imports.%import_ref.57 [symbolic] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.34: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.35: = bound_method %.31, %Convert.15 [template] -// CHECK:STDOUT: %.36: i32 = int_value 1 [template] -// CHECK:STDOUT: %struct: %CompleteClass.3 = struct_value (%.36) [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.27: type = struct_type {.n: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] +// CHECK:STDOUT: %.28: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.13 [template] +// CHECK:STDOUT: %.29: %.28 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.30: %.1 = assoc_entity element0, imports.%import_ref.43 [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.20) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.32: = bound_method %.26, %Convert.14 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.2(%.20) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 1 [template] +// CHECK:STDOUT: %struct: %CompleteClass.3 = struct_value (%.34) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+20, loaded [template = constants.%CompleteClass.1] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.55 -// CHECK:STDOUT: .ImplicitAs = %import_ref.56 +// CHECK:STDOUT: .Int = %import_ref.41 +// CHECK:STDOUT: .ImplicitAs = %import_ref.42 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4 = import_ref Main//foo, inst+69, unloaded -// CHECK:STDOUT: %import_ref.5: @ImplicitAs.%.1 (%.1) = import_ref Main//foo, inst+70, loaded [symbolic = @ImplicitAs.%.2 (constants.%.33)] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+71, unloaded -// CHECK:STDOUT: %import_ref.7: type = import_ref Main//foo, inst+105, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.8: type = import_ref Main//foo, inst+106, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.9: = import_ref Main//foo, inst+107, loaded [template = constants.%.34] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//foo, inst+86, unloaded -// CHECK:STDOUT: %import_ref.12: type = import_ref Main//foo, inst+117, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.13: type = import_ref Main//foo, inst+118, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] -// CHECK:STDOUT: %import_ref.14 = import_ref Main//foo, inst+119, unloaded -// CHECK:STDOUT: %import_ref.15: type = import_ref Main//foo, inst+147, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.16: type = import_ref Main//foo, inst+148, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.5)] -// CHECK:STDOUT: %import_ref.17 = import_ref Main//foo, inst+149, unloaded -// CHECK:STDOUT: %import_ref.18: type = import_ref Main//foo, inst+172, loaded [template = i32] -// CHECK:STDOUT: %import_ref.19: type = import_ref Main//foo, inst+173, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.20 = import_ref Main//foo, inst+174, unloaded -// CHECK:STDOUT: %import_ref.22: type = import_ref Main//foo, inst+185, loaded [symbolic = @impl.5.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.23: type = import_ref Main//foo, inst+186, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.24 = import_ref Main//foo, inst+187, unloaded -// CHECK:STDOUT: %import_ref.25: type = import_ref Main//foo, inst+212, loaded [symbolic = @impl.6.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.26: type = import_ref Main//foo, inst+213, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.27 = import_ref Main//foo, inst+214, unloaded -// CHECK:STDOUT: %import_ref.28 = import_ref Main//foo, inst+244, unloaded -// CHECK:STDOUT: %import_ref.29 = import_ref Main//foo, inst+245, unloaded -// CHECK:STDOUT: %import_ref.30 = import_ref Main//foo, inst+246, unloaded -// CHECK:STDOUT: %import_ref.31: type = import_ref Main//foo, inst+248, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.32: type = import_ref Main//foo, inst+249, loaded [template = constants.%As.type.3] -// CHECK:STDOUT: %import_ref.33 = import_ref Main//foo, inst+250, unloaded -// CHECK:STDOUT: %import_ref.34 = import_ref Main//foo, inst+265, unloaded -// CHECK:STDOUT: %import_ref.36: type = import_ref Main//foo, inst+287, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.37: type = import_ref Main//foo, inst+288, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] -// CHECK:STDOUT: %import_ref.38 = import_ref Main//foo, inst+289, unloaded -// CHECK:STDOUT: %import_ref.39: type = import_ref Main//foo, inst+316, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.40: type = import_ref Main//foo, inst+317, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] -// CHECK:STDOUT: %import_ref.41 = import_ref Main//foo, inst+318, unloaded -// CHECK:STDOUT: %import_ref.42: type = import_ref Main//foo, inst+341, loaded [template = i32] -// CHECK:STDOUT: %import_ref.43: type = import_ref Main//foo, inst+342, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.44 = import_ref Main//foo, inst+343, unloaded -// CHECK:STDOUT: %import_ref.46: type = import_ref Main//foo, inst+354, loaded [symbolic = @impl.11.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.47: type = import_ref Main//foo, inst+355, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.48 = import_ref Main//foo, inst+356, unloaded -// CHECK:STDOUT: %import_ref.49: type = import_ref Main//foo, inst+381, loaded [symbolic = @impl.12.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.50: type = import_ref Main//foo, inst+382, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.51 = import_ref Main//foo, inst+383, unloaded -// CHECK:STDOUT: %import_ref.52 = import_ref Main//foo, inst+25, unloaded -// CHECK:STDOUT: %import_ref.53 = import_ref Main//foo, inst+37, unloaded -// CHECK:STDOUT: %import_ref.54 = import_ref Main//foo, inst+45, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//foo, inst+77, unloaded +// CHECK:STDOUT: %import_ref.5: @ImplicitAs.%.1 (%.1) = import_ref Main//foo, inst+78, loaded [symbolic = @ImplicitAs.%.2 (constants.%.30)] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+79, unloaded +// CHECK:STDOUT: %import_ref.7: type = import_ref Main//foo, inst+121, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.8: type = import_ref Main//foo, inst+122, loaded [symbolic = @impl.1.%ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: %import_ref.9: = import_ref Main//foo, inst+123, loaded [symbolic = @impl.1.%.1 (constants.%.3)] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//foo, inst+94, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref Main//foo, inst+151, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.12: type = import_ref Main//foo, inst+152, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %import_ref.13 = import_ref Main//foo, inst+153, unloaded +// CHECK:STDOUT: %import_ref.14: type = import_ref Main//foo, inst+180, loaded [symbolic = @impl.3.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.15: type = import_ref Main//foo, inst+181, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.16 = import_ref Main//foo, inst+182, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Main//foo, inst+212, loaded [symbolic = @impl.4.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.19: type = import_ref Main//foo, inst+213, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.20 = import_ref Main//foo, inst+214, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//foo, inst+244, unloaded +// CHECK:STDOUT: %import_ref.22 = import_ref Main//foo, inst+245, unloaded +// CHECK:STDOUT: %import_ref.23 = import_ref Main//foo, inst+246, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Main//foo, inst+252, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.25: type = import_ref Main//foo, inst+253, loaded [symbolic = @impl.5.%As.type (constants.%As.type.3)] +// CHECK:STDOUT: %import_ref.26 = import_ref Main//foo, inst+254, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Main//foo, inst+269, unloaded +// CHECK:STDOUT: %import_ref.28: type = import_ref Main//foo, inst+306, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.29: type = import_ref Main//foo, inst+307, loaded [symbolic = @impl.6.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.30 = import_ref Main//foo, inst+308, unloaded +// CHECK:STDOUT: %import_ref.31: type = import_ref Main//foo, inst+335, loaded [symbolic = @impl.7.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.32: type = import_ref Main//foo, inst+336, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.33 = import_ref Main//foo, inst+337, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Main//foo, inst+367, loaded [symbolic = @impl.8.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.36: type = import_ref Main//foo, inst+368, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.37 = import_ref Main//foo, inst+369, unloaded +// CHECK:STDOUT: %import_ref.38 = import_ref Main//foo, inst+25, unloaded +// CHECK:STDOUT: %import_ref.39 = import_ref Main//foo, inst+44, unloaded +// CHECK:STDOUT: %import_ref.40 = import_ref Main//foo, inst+53, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -427,10 +420,11 @@ class Class(U:! type) { // CHECK:STDOUT: %return.param_patt: %CompleteClass.3 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_24.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_24.2: type = converted %int.make_type_32, %.loc8_24.1 [template = i32] -// CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(i32) [template = constants.%CompleteClass.3] +// CHECK:STDOUT: %.loc8_25: Core.IntLiteral = int_value 32 [template = constants.%.20] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_25) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_24.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_24.2: type = converted %int.make_type_signed, %.loc8_24.1 [template = constants.%i32] +// CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(constants.%i32) [template = constants.%CompleteClass.3] // CHECK:STDOUT: %return.param: ref %CompleteClass.3 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %CompleteClass.3 = return_slot %return.param // CHECK:STDOUT: } @@ -463,168 +457,148 @@ class Class(U:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] -// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.13)] -// CHECK:STDOUT: %.2: @As.%.1 (%.13) = assoc_entity element0, imports.%import_ref.34 [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.7) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %.2: @As.%.1 (%.9) = assoc_entity element0, imports.%import_ref.27 [symbolic = %.2 (constants.%.10)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.28 -// CHECK:STDOUT: .Convert = imports.%import_ref.29 -// CHECK:STDOUT: witness = (imports.%import_ref.30) +// CHECK:STDOUT: .Self = imports.%import_ref.21 +// CHECK:STDOUT: .Convert = imports.%import_ref.22 +// CHECK:STDOUT: witness = (imports.%import_ref.23) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.7 as imports.%import_ref.8 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.9 +// CHECK:STDOUT: generic impl @impl.1(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.1(%N) [symbolic = %Convert.type (constants.%Convert.type.2)] +// CHECK:STDOUT: %Convert: @impl.1.%Convert.type (%Convert.type.2) = struct_value () [symbolic = %Convert (constants.%Convert.2)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.7 as imports.%import_ref.8 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.9 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] // CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: impl: imports.%import_ref.11 as imports.%import_ref.12 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: witness = imports.%import_ref.13 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] // CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: impl: imports.%import_ref.14 as imports.%import_ref.15 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: witness = imports.%import_ref.16 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: generic impl @impl.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.4(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.4.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%iN)> [symbolic = %As.type (constants.%As.type.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] -// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.22 as imports.%import_ref.23 { +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.24 +// CHECK:STDOUT: witness = imports.%import_ref.26 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%uN)> [symbolic = %As.type (constants.%As.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] -// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.9)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.25 as imports.%import_ref.26 { +// CHECK:STDOUT: impl: imports.%import_ref.28 as imports.%import_ref.29 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.27 +// CHECK:STDOUT: witness = imports.%import_ref.30 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.7: imports.%import_ref.31 as imports.%import_ref.32 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.33 +// CHECK:STDOUT: generic impl @impl.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.7(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.7.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.31 as imports.%import_ref.32 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.33 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] -// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.12)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.12) = struct_value () [symbolic = %Convert (constants.%Convert.12)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.36 as imports.%import_ref.37 { +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.38 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] -// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.39 as imports.%import_ref.40 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.41 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.10: imports.%import_ref.42 as imports.%import_ref.43 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.44 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] -// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.46 as imports.%import_ref.47 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.48 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] -// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.49 as imports.%import_ref.50 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.51 +// CHECK:STDOUT: witness = imports.%import_ref.37 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -634,14 +608,14 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class.2)] -// CHECK:STDOUT: %.loc5_8.2: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T.1 (%T) [symbolic = %.loc5_8.2 (constants.%.23)] -// CHECK:STDOUT: %.loc6_1.2: type = struct_type {.x: @Class.%T.1 (%T)} [symbolic = %.loc6_1.2 (constants.%.24)] -// CHECK:STDOUT: %.loc6_1.3: = complete_type_witness @Class.%.loc6_1.2 (%.24) [symbolic = %.loc6_1.3 (constants.%.25)] +// CHECK:STDOUT: %.loc5_8.2: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T.1 (%T) [symbolic = %.loc5_8.2 (constants.%.17)] +// CHECK:STDOUT: %.loc6_1.2: type = struct_type {.x: @Class.%T.1 (%T)} [symbolic = %.loc6_1.2 (constants.%.18)] +// CHECK:STDOUT: %.loc6_1.3: = complete_type_witness @Class.%.loc6_1.2 (%.18) [symbolic = %.loc6_1.3 (constants.%.19)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] -// CHECK:STDOUT: %.loc5_8.1: @Class.%.loc5_8.2 (%.23) = field_decl x, element0 [template] -// CHECK:STDOUT: %.loc6_1.1: = complete_type_witness %.24 [symbolic = %.loc6_1.3 (constants.%.25)] +// CHECK:STDOUT: %.loc5_8.1: @Class.%.loc5_8.2 (%.17) = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc6_1.1: = complete_type_witness %.18 [symbolic = %.loc6_1.3 (constants.%.19)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 @@ -655,15 +629,15 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic = %CompleteClass (constants.%CompleteClass.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @CompleteClass.%CompleteClass (%CompleteClass.2), i32 [symbolic = %.1 (constants.%.28)] +// CHECK:STDOUT: %.1: type = unbound_element_type @CompleteClass.%CompleteClass (%CompleteClass.2), %i32 [symbolic = %.1 (constants.%.23)] // CHECK:STDOUT: %F.type: type = fn_type @F.1, @CompleteClass(%T) [symbolic = %F.type (constants.%F.type.1)] // CHECK:STDOUT: %F: @CompleteClass.%F.type (%F.type.1) = struct_value () [symbolic = %F (constants.%F.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.52 -// CHECK:STDOUT: .n = imports.%import_ref.53 -// CHECK:STDOUT: .F = imports.%import_ref.54 +// CHECK:STDOUT: .Self = imports.%import_ref.38 +// CHECK:STDOUT: .n = imports.%import_ref.39 +// CHECK:STDOUT: .F = imports.%import_ref.40 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -677,38 +651,38 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { @@ -721,79 +695,70 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F.1(constants.%T: type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn() -> i32; +// CHECK:STDOUT: fn() -> %i32; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2() -> %return: %CompleteClass.3 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc9_16: Core.IntLiteral = int_value 1 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_17.1: %.32 = struct_literal (%.loc9_16) -// CHECK:STDOUT: %.loc9_17.2: %Convert.type.2 = interface_witness_access constants.%.34, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_17.3: = bound_method %.loc9_16, %.loc9_17.2 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc9_17.3(%.loc9_16) [template = constants.%.36] -// CHECK:STDOUT: %.loc9_17.4: init i32 = converted %.loc9_16, %int.convert_checked [template = constants.%.36] -// CHECK:STDOUT: %.loc9_17.5: ref i32 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc9_17.6: init i32 = initialize_from %.loc9_17.4 to %.loc9_17.5 [template = constants.%.36] -// CHECK:STDOUT: %.loc9_17.7: init %CompleteClass.3 = class_init (%.loc9_17.6), %return [template = constants.%struct] -// CHECK:STDOUT: %.loc9_18: init %CompleteClass.3 = converted %.loc9_17.1, %.loc9_17.7 [template = constants.%struct] +// CHECK:STDOUT: %.loc9_16: Core.IntLiteral = int_value 1 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_17.1: %.27 = struct_literal (%.loc9_16) +// CHECK:STDOUT: %.loc9_17.2: %Convert.type.13 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_17.3: = bound_method %.loc9_16, %.loc9_17.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_17.4: = specific_function %.loc9_17.3, @Convert.2(constants.%.20) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc9_17.4(%.loc9_16) [template = constants.%.34] +// CHECK:STDOUT: %.loc9_17.5: init %i32 = converted %.loc9_16, %int.convert_checked [template = constants.%.34] +// CHECK:STDOUT: %.loc9_17.6: ref %i32 = class_element_access %return, element0 +// CHECK:STDOUT: %.loc9_17.7: init %i32 = initialize_from %.loc9_17.5 to %.loc9_17.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc9_17.8: init %CompleteClass.3 = class_init (%.loc9_17.7), %return [template = constants.%struct] +// CHECK:STDOUT: %.loc9_18: init %CompleteClass.3 = converted %.loc9_17.1, %.loc9_17.8 [template = constants.%struct] // CHECK:STDOUT: return %.loc9_18 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.11[%self.param_patt: Core.IntLiteral]() -> i32 = "int.convert_checked"; -// CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 -// CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 -// CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.1 => constants.%.3 -// CHECK:STDOUT: %.2 => constants.%.4 +// CHECK:STDOUT: specific @ImplicitAs(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(%Dest) { @@ -801,6 +766,25 @@ class Class(U:! type) { // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.1.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -812,62 +796,38 @@ class Class(U:! type) { // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @ImplicitAs(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { @@ -875,46 +835,46 @@ class Class(U:! type) { // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5 // CHECK:STDOUT: %Convert => constants.%Convert.5 -// CHECK:STDOUT: %.1 => constants.%.9 -// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: specific @impl.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: specific @impl.3(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: specific @impl.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(%N) { +// CHECK:STDOUT: specific @impl.4(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.5(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%Dest) { @@ -922,17 +882,9 @@ class Class(U:! type) { // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.3 -// CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 -// CHECK:STDOUT: %Convert => constants.%Convert.9 -// CHECK:STDOUT: %.1 => constants.%.15 -// CHECK:STDOUT: %.2 => constants.%.16 +// CHECK:STDOUT: specific @As(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(%Dest) { @@ -940,6 +892,25 @@ class Class(U:! type) { // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.5.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @As(@Convert.6.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -951,62 +922,38 @@ class Class(U:! type) { // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.8.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.9.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(@impl.6.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: specific @impl.6(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(%N) { +// CHECK:STDOUT: specific @impl.6(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(Core.IntLiteral) { @@ -1014,46 +961,46 @@ class Class(U:! type) { // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %As.type => constants.%As.type.5 // CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 -// CHECK:STDOUT: %Convert => constants.%Convert.12 -// CHECK:STDOUT: %.1 => constants.%.19 -// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.11 +// CHECK:STDOUT: %Convert => constants.%Convert.11 +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.2 => constants.%.15 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: specific @impl.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(%N) { +// CHECK:STDOUT: specific @impl.7(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.9(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: specific @impl.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(%N) { +// CHECK:STDOUT: specific @impl.8(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.10(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { @@ -1072,7 +1019,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.2 -// CHECK:STDOUT: %.1 => constants.%.28 +// CHECK:STDOUT: %.1 => constants.%.23 // CHECK:STDOUT: %F.type => constants.%F.type.1 // CHECK:STDOUT: %F => constants.%F.1 // CHECK:STDOUT: } @@ -1084,22 +1031,56 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @CompleteClass(i32) { -// CHECK:STDOUT: %T => i32 -// CHECK:STDOUT: %T.patt => i32 +// CHECK:STDOUT: specific @CompleteClass(constants.%i32) { +// CHECK:STDOUT: %T => constants.%i32 +// CHECK:STDOUT: %T.patt => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.3 -// CHECK:STDOUT: %.1 => constants.%.29 +// CHECK:STDOUT: %.1 => constants.%.24 // CHECK:STDOUT: %F.type => constants.%F.type.3 // CHECK:STDOUT: %F => constants.%F.3 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%i32) { +// CHECK:STDOUT: %Dest => constants.%i32 +// CHECK:STDOUT: %Dest.patt => constants.%i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.13 +// CHECK:STDOUT: %Convert => constants.%Convert.13 +// CHECK:STDOUT: %.1 => constants.%.28 +// CHECK:STDOUT: %.2 => constants.%.29 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(constants.%.20) { +// CHECK:STDOUT: %N => constants.%.20 +// CHECK:STDOUT: %N.patt => constants.%.20 +// CHECK:STDOUT: %iN => constants.%i32 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.14 +// CHECK:STDOUT: %Convert => constants.%Convert.14 +// CHECK:STDOUT: %.1 => constants.%.31 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%.20) { +// CHECK:STDOUT: %N => constants.%.20 +// CHECK:STDOUT: %iN => constants.%i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- use_foo.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %UseMethod.type: type = fn_type @UseMethod [template] // CHECK:STDOUT: %UseMethod: %UseMethod.type = struct_value () [template] // CHECK:STDOUT: %CompleteClass.type: type = generic_class_type @CompleteClass [template] @@ -1107,16 +1088,16 @@ class Class(U:! type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %CompleteClass.2: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %.3: type = unbound_element_type %CompleteClass.2, i32 [symbolic] +// CHECK:STDOUT: %.4: type = unbound_element_type %CompleteClass.2, %i32 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %CompleteClass.3: type = class_type @CompleteClass, @CompleteClass(i32) [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %CompleteClass.3, i32 [template] -// CHECK:STDOUT: %F.type.2: type = fn_type @F.1, @CompleteClass(i32) [template] +// CHECK:STDOUT: %CompleteClass.3: type = class_type @CompleteClass, @CompleteClass(%i32) [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %CompleteClass.3, %i32 [template] +// CHECK:STDOUT: %F.type.2: type = fn_type @F.1, @CompleteClass(%i32) [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %.6: = specific_function %F.2, @F.1(i32) [template] +// CHECK:STDOUT: %.7: = specific_function %F.2, @F.1(%i32) [template] // CHECK:STDOUT: %UseField.type: type = fn_type @UseField [template] // CHECK:STDOUT: %UseField: %UseField.type = struct_value () [template] // CHECK:STDOUT: } @@ -1124,15 +1105,15 @@ class Class(U:! type) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//foo, inst+9, unloaded // CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+20, loaded [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, inst+432, loaded [template = constants.%F.3] +// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, inst+413, loaded [template = constants.%F.3] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.4 +// CHECK:STDOUT: .Int = %import_ref.4 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+25, unloaded -// CHECK:STDOUT: %import_ref.6: @CompleteClass.%.1 (%.3) = import_ref Main//foo, inst+37, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.7: @CompleteClass.%F.type (%F.type.1) = import_ref Main//foo, inst+45, loaded [symbolic = @CompleteClass.%F (constants.%F.1)] +// CHECK:STDOUT: %import_ref.6: @CompleteClass.%.1 (%.4) = import_ref Main//foo, inst+44, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.7: @CompleteClass.%F.type (%F.type.1) = import_ref Main//foo, inst+53, loaded [symbolic = @CompleteClass.%F (constants.%F.1)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1147,24 +1128,26 @@ class Class(U:! type) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %UseMethod.decl: %UseMethod.type = fn_decl @UseMethod [template = constants.%UseMethod] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_32.loc5, %.loc5_19.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc5_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19.3: type = converted %int.make_type_signed.loc5, %.loc5_19.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %UseField.decl: %UseField.type = fn_decl @UseField [template = constants.%UseField] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_18.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32] -// CHECK:STDOUT: %.loc10_18.2: type = converted %int.make_type_32.loc10, %.loc10_18.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc10_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc10: init type = call constants.%Int(%.loc10_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_18.2: type = value_of_initializer %int.make_type_signed.loc10 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_18.3: type = converted %int.make_type_signed.loc10, %.loc10_18.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1174,7 +1157,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic = %CompleteClass (constants.%CompleteClass.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @CompleteClass.%CompleteClass (%CompleteClass.2), i32 [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %.1: type = unbound_element_type @CompleteClass.%CompleteClass (%CompleteClass.2), %i32 [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: %F.type: type = fn_type @F.1, @CompleteClass(%T) [symbolic = %F.type (constants.%F.type.1)] // CHECK:STDOUT: %F: @CompleteClass.%F.type (%F.type.1) = struct_value () [symbolic = %F (constants.%F.1)] // CHECK:STDOUT: @@ -1186,13 +1169,14 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @UseMethod() -> i32 { +// CHECK:STDOUT: fn @UseMethod() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_23.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_23.2: type = converted %int.make_type_32.loc6, %.loc6_23.1 [template = i32] -// CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(i32) [template = constants.%CompleteClass.3] +// CHECK:STDOUT: %.loc6_24: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_24) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_23.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_23.2: type = converted %int.make_type_signed.loc6, %.loc6_23.1 [template = constants.%i32] +// CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(constants.%i32) [template = constants.%CompleteClass.3] // CHECK:STDOUT: %v.var: ref %CompleteClass.3 = var v // CHECK:STDOUT: %v: ref %CompleteClass.3 = bind_name v, %v.var // CHECK:STDOUT: %F.ref.loc6: %F.type.3 = name_ref F, imports.%import_ref.3 [template = constants.%F.3] @@ -1200,30 +1184,31 @@ class Class(U:! type) { // CHECK:STDOUT: %F.call.loc6: init %CompleteClass.3 = call %F.ref.loc6() to %.loc6_7 // CHECK:STDOUT: assign %v.var, %F.call.loc6 // CHECK:STDOUT: %v.ref: ref %CompleteClass.3 = name_ref v, %v -// CHECK:STDOUT: %.loc7_11.1: %F.type.2 = specific_constant imports.%import_ref.7, @CompleteClass(i32) [template = constants.%F.2] +// CHECK:STDOUT: %.loc7_11.1: %F.type.2 = specific_constant imports.%import_ref.7, @CompleteClass(constants.%i32) [template = constants.%F.2] // CHECK:STDOUT: %F.ref.loc7: %F.type.2 = name_ref F, %.loc7_11.1 [template = constants.%F.2] -// CHECK:STDOUT: %.loc7_11.2: = specific_function %F.ref.loc7, @F.1(i32) [template = constants.%.6] -// CHECK:STDOUT: %F.call.loc7: init i32 = call %.loc7_11.2() -// CHECK:STDOUT: %.loc7_15.1: i32 = value_of_initializer %F.call.loc7 -// CHECK:STDOUT: %.loc7_15.2: i32 = converted %F.call.loc7, %.loc7_15.1 +// CHECK:STDOUT: %.loc7_11.2: = specific_function %F.ref.loc7, @F.1(constants.%i32) [template = constants.%.7] +// CHECK:STDOUT: %F.call.loc7: init %i32 = call %.loc7_11.2() +// CHECK:STDOUT: %.loc7_15.1: %i32 = value_of_initializer %F.call.loc7 +// CHECK:STDOUT: %.loc7_15.2: %i32 = converted %F.call.loc7, %.loc7_15.1 // CHECK:STDOUT: return %.loc7_15.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F.1(constants.%T: type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn() -> i32; +// CHECK:STDOUT: fn() -> %i32; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2() -> %CompleteClass.3; // CHECK:STDOUT: -// CHECK:STDOUT: fn @UseField() -> i32 { +// CHECK:STDOUT: fn @UseField() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_23.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_23.2: type = converted %int.make_type_32.loc11, %.loc11_23.1 [template = i32] -// CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(i32) [template = constants.%CompleteClass.3] +// CHECK:STDOUT: %.loc11_24: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_24) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_23.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_23.2: type = converted %int.make_type_signed.loc11, %.loc11_23.1 [template = constants.%i32] +// CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(constants.%i32) [template = constants.%CompleteClass.3] // CHECK:STDOUT: %v.var: ref %CompleteClass.3 = var v // CHECK:STDOUT: %v: ref %CompleteClass.3 = bind_name v, %v.var // CHECK:STDOUT: %F.ref: %F.type.3 = name_ref F, imports.%import_ref.3 [template = constants.%F.3] @@ -1231,9 +1216,9 @@ class Class(U:! type) { // CHECK:STDOUT: %F.call: init %CompleteClass.3 = call %F.ref() to %.loc11_7 // CHECK:STDOUT: assign %v.var, %F.call // CHECK:STDOUT: %v.ref: ref %CompleteClass.3 = name_ref v, %v -// CHECK:STDOUT: %n.ref: %.4 = name_ref n, imports.%import_ref.6 [template = imports.%.1] -// CHECK:STDOUT: %.loc12_11.1: ref i32 = class_element_access %v.ref, element0 -// CHECK:STDOUT: %.loc12_11.2: i32 = bind_value %.loc12_11.1 +// CHECK:STDOUT: %n.ref: %.5 = name_ref n, imports.%import_ref.6 [template = imports.%.1] +// CHECK:STDOUT: %.loc12_11.1: ref %i32 = class_element_access %v.ref, element0 +// CHECK:STDOUT: %.loc12_11.2: %i32 = bind_value %.loc12_11.1 // CHECK:STDOUT: return %.loc12_11.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1243,7 +1228,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.2 -// CHECK:STDOUT: %.1 => constants.%.3 +// CHECK:STDOUT: %.1 => constants.%.4 // CHECK:STDOUT: %F.type => constants.%F.type.1 // CHECK:STDOUT: %F => constants.%F.1 // CHECK:STDOUT: } @@ -1255,18 +1240,18 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @CompleteClass(i32) { -// CHECK:STDOUT: %T => i32 -// CHECK:STDOUT: %T.patt => i32 +// CHECK:STDOUT: specific @CompleteClass(constants.%i32) { +// CHECK:STDOUT: %T => constants.%i32 +// CHECK:STDOUT: %T.patt => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.3 -// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.1 => constants.%.5 // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.1(i32) { +// CHECK:STDOUT: specific @F.1(constants.%i32) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1277,133 +1262,117 @@ class Class(U:! type) { // CHECK:STDOUT: %Use: %Use.type = struct_value () [template] // CHECK:STDOUT: %CompleteClass.type: type = generic_class_type @CompleteClass [template] // CHECK:STDOUT: %CompleteClass.1: %CompleteClass.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %CompleteClass.2: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %.3: type = unbound_element_type %CompleteClass.2, i32 [symbolic] +// CHECK:STDOUT: %.4: type = unbound_element_type %CompleteClass.2, %i32 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type i32 [template] -// CHECK:STDOUT: %CompleteClass.3: type = class_type @CompleteClass, @CompleteClass(%.4) [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %CompleteClass.3, i32 [template] -// CHECK:STDOUT: %F.type.2: type = fn_type @F.1, @CompleteClass(%.4) [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %.5: type = ptr_type %i32 [template] +// CHECK:STDOUT: %CompleteClass.3: type = class_type @CompleteClass, @CompleteClass(%.5) [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %CompleteClass.3, %i32 [template] +// CHECK:STDOUT: %F.type.2: type = fn_type @F.1, @CompleteClass(%.5) [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %CompleteClass.4: type = class_type @CompleteClass, @CompleteClass(i32) [template] -// CHECK:STDOUT: %.7: type = unbound_element_type %CompleteClass.4, i32 [template] -// CHECK:STDOUT: %F.type.4: type = fn_type @F.1, @CompleteClass(i32) [template] +// CHECK:STDOUT: %CompleteClass.4: type = class_type @CompleteClass, @CompleteClass(%i32) [template] +// CHECK:STDOUT: %.8: type = unbound_element_type %CompleteClass.4, %i32 [template] +// CHECK:STDOUT: %F.type.4: type = fn_type @F.1, @CompleteClass(%i32) [template] // CHECK:STDOUT: %F.4: %F.type.4 = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %.15: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.15)> [symbolic] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2, @impl.1(%N) [symbolic] +// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.3) [symbolic] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3, @impl.2(%N) [symbolic] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] -// CHECK:STDOUT: %.16: = interface_witness (%Convert.4) [symbolic] -// CHECK:STDOUT: %.17: type = int_type unsigned, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%.17)> [symbolic] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.4) [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.4, @impl.3(%N) [symbolic] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [symbolic] -// CHECK:STDOUT: %.18: = interface_witness (%Convert.5) [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.7: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] -// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.5) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.4(%N) [symbolic] // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] -// CHECK:STDOUT: %.21: = interface_witness (%Convert.7) [symbolic] -// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.5, @impl.6(%N) [symbolic] -// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] -// CHECK:STDOUT: %.22: = interface_witness (%Convert.8) [symbolic] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.7) [symbolic] // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] // CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%iN)> [symbolic] // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] +// CHECK:STDOUT: %.20: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] +// CHECK:STDOUT: %.21: %.20 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.7, @impl.5(%N) [symbolic] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic] -// CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.2, %Convert.type.9 [symbolic] -// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.40 [symbolic] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.6, @As(i32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %.25: type = assoc_entity_type %As.type.3, %Convert.type.10 [template] -// CHECK:STDOUT: %.26: %.25 = assoc_entity element0, imports.%import_ref.41 [template] -// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.15)> [symbolic] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.9) [symbolic] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.8, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.9, @impl.7(%N) [symbolic] // CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.11) [symbolic] -// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.17)> [symbolic] -// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.8, @impl.9(%N) [symbolic] -// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.12) [symbolic] -// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] -// CHECK:STDOUT: %.29: type = assoc_entity_type %As.type.6, %Convert.type.13 [template] -// CHECK:STDOUT: %.30: %.29 = assoc_entity element0, imports.%import_ref.51 [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.9, @impl.11(%N) [symbolic] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] -// CHECK:STDOUT: %.31: = interface_witness (%Convert.14) [symbolic] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.10, @impl.12(%N) [symbolic] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [symbolic] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.15) [symbolic] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.11) [symbolic] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %.25: type = assoc_entity_type %As.type.5, %Convert.type.12 [template] +// CHECK:STDOUT: %.26: %.25 = assoc_entity element0, imports.%import_ref.40 [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.10, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.13) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//foo, inst+9, unloaded // CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+20, loaded [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, inst+432, loaded [template = constants.%F.3] +// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, inst+413, loaded [template = constants.%F.3] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.7 +// CHECK:STDOUT: .Int = %import_ref.7 // CHECK:STDOUT: .ImplicitAs = %import_ref.8 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.4 = import_ref Main//foo, inst+25, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+37, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+45, unloaded -// CHECK:STDOUT: %import_ref.14: type = import_ref Main//foo, inst+105, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.15: type = import_ref Main//foo, inst+106, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.16 = import_ref Main//foo, inst+107, unloaded -// CHECK:STDOUT: %import_ref.18: type = import_ref Main//foo, inst+117, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.19: type = import_ref Main//foo, inst+118, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] -// CHECK:STDOUT: %import_ref.20 = import_ref Main//foo, inst+119, unloaded -// CHECK:STDOUT: %import_ref.21: type = import_ref Main//foo, inst+147, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.22: type = import_ref Main//foo, inst+148, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.6)] -// CHECK:STDOUT: %import_ref.23 = import_ref Main//foo, inst+149, unloaded -// CHECK:STDOUT: %import_ref.24: type = import_ref Main//foo, inst+172, loaded [template = i32] -// CHECK:STDOUT: %import_ref.25: type = import_ref Main//foo, inst+173, loaded [template = constants.%ImplicitAs.type.7] -// CHECK:STDOUT: %import_ref.26 = import_ref Main//foo, inst+174, unloaded -// CHECK:STDOUT: %import_ref.28: type = import_ref Main//foo, inst+185, loaded [symbolic = @impl.5.%.1 (constants.%.15)] -// CHECK:STDOUT: %import_ref.29: type = import_ref Main//foo, inst+186, loaded [template = constants.%ImplicitAs.type.7] -// CHECK:STDOUT: %import_ref.30 = import_ref Main//foo, inst+187, unloaded -// CHECK:STDOUT: %import_ref.31: type = import_ref Main//foo, inst+212, loaded [symbolic = @impl.6.%.1 (constants.%.17)] -// CHECK:STDOUT: %import_ref.32: type = import_ref Main//foo, inst+213, loaded [template = constants.%ImplicitAs.type.7] -// CHECK:STDOUT: %import_ref.33 = import_ref Main//foo, inst+214, unloaded -// CHECK:STDOUT: %import_ref.34 = import_ref Main//foo, inst+244, unloaded -// CHECK:STDOUT: %import_ref.35 = import_ref Main//foo, inst+245, unloaded -// CHECK:STDOUT: %import_ref.36 = import_ref Main//foo, inst+246, unloaded -// CHECK:STDOUT: %import_ref.37: type = import_ref Main//foo, inst+248, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.38: type = import_ref Main//foo, inst+249, loaded [template = constants.%As.type.3] -// CHECK:STDOUT: %import_ref.39 = import_ref Main//foo, inst+250, unloaded -// CHECK:STDOUT: %import_ref.40 = import_ref Main//foo, inst+265, unloaded -// CHECK:STDOUT: %import_ref.42: type = import_ref Main//foo, inst+287, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.43: type = import_ref Main//foo, inst+288, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] -// CHECK:STDOUT: %import_ref.44 = import_ref Main//foo, inst+289, unloaded -// CHECK:STDOUT: %import_ref.45: type = import_ref Main//foo, inst+316, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.46: type = import_ref Main//foo, inst+317, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] -// CHECK:STDOUT: %import_ref.47 = import_ref Main//foo, inst+318, unloaded -// CHECK:STDOUT: %import_ref.48: type = import_ref Main//foo, inst+341, loaded [template = i32] -// CHECK:STDOUT: %import_ref.49: type = import_ref Main//foo, inst+342, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.50 = import_ref Main//foo, inst+343, unloaded -// CHECK:STDOUT: %import_ref.52: type = import_ref Main//foo, inst+354, loaded [symbolic = @impl.11.%.1 (constants.%.15)] -// CHECK:STDOUT: %import_ref.53: type = import_ref Main//foo, inst+355, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.54 = import_ref Main//foo, inst+356, unloaded -// CHECK:STDOUT: %import_ref.55: type = import_ref Main//foo, inst+381, loaded [symbolic = @impl.12.%.1 (constants.%.17)] -// CHECK:STDOUT: %import_ref.56: type = import_ref Main//foo, inst+382, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.57 = import_ref Main//foo, inst+383, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+44, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+53, unloaded +// CHECK:STDOUT: %import_ref.14: type = import_ref Main//foo, inst+121, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.15: type = import_ref Main//foo, inst+122, loaded [symbolic = @impl.1.%ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %import_ref.16 = import_ref Main//foo, inst+123, unloaded +// CHECK:STDOUT: %import_ref.17: type = import_ref Main//foo, inst+151, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.18: type = import_ref Main//foo, inst+152, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.19 = import_ref Main//foo, inst+153, unloaded +// CHECK:STDOUT: %import_ref.20: type = import_ref Main//foo, inst+180, loaded [symbolic = @impl.3.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.21: type = import_ref Main//foo, inst+181, loaded [template = constants.%ImplicitAs.type.6] +// CHECK:STDOUT: %import_ref.22 = import_ref Main//foo, inst+182, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Main//foo, inst+212, loaded [symbolic = @impl.4.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.25: type = import_ref Main//foo, inst+213, loaded [template = constants.%ImplicitAs.type.6] +// CHECK:STDOUT: %import_ref.26 = import_ref Main//foo, inst+214, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Main//foo, inst+244, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Main//foo, inst+245, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Main//foo, inst+246, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Main//foo, inst+252, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.31: type = import_ref Main//foo, inst+253, loaded [symbolic = @impl.5.%As.type (constants.%As.type.3)] +// CHECK:STDOUT: %import_ref.32 = import_ref Main//foo, inst+254, unloaded +// CHECK:STDOUT: %import_ref.33 = import_ref Main//foo, inst+269, unloaded +// CHECK:STDOUT: %import_ref.34: type = import_ref Main//foo, inst+306, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.35: type = import_ref Main//foo, inst+307, loaded [symbolic = @impl.6.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.36 = import_ref Main//foo, inst+308, unloaded +// CHECK:STDOUT: %import_ref.37: type = import_ref Main//foo, inst+335, loaded [symbolic = @impl.7.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.38: type = import_ref Main//foo, inst+336, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.39 = import_ref Main//foo, inst+337, unloaded +// CHECK:STDOUT: %import_ref.41: type = import_ref Main//foo, inst+367, loaded [symbolic = @impl.8.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.42: type = import_ref Main//foo, inst+368, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.43 = import_ref Main//foo, inst+369, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1426,168 +1395,148 @@ class Class(U:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.9)] -// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.9) [symbolic = %.1 (constants.%.23)] -// CHECK:STDOUT: %.2: @As.%.1 (%.23) = assoc_entity element0, imports.%import_ref.40 [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.20)] +// CHECK:STDOUT: %.2: @As.%.1 (%.20) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.21)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.34 -// CHECK:STDOUT: .Convert = imports.%import_ref.35 -// CHECK:STDOUT: witness = (imports.%import_ref.36) +// CHECK:STDOUT: .Self = imports.%import_ref.27 +// CHECK:STDOUT: .Convert = imports.%import_ref.28 +// CHECK:STDOUT: witness = (imports.%import_ref.29) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.14 as imports.%import_ref.15 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.16 +// CHECK:STDOUT: generic impl @impl.1(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.1(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] +// CHECK:STDOUT: %Convert: @impl.1.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.14)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.14 as imports.%import_ref.15 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.16 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] // CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.16)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.15)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: impl: imports.%import_ref.17 as imports.%import_ref.18 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: witness = imports.%import_ref.19 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.6)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.5)] // CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: impl: imports.%import_ref.20 as imports.%import_ref.21 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: witness = imports.%import_ref.22 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.24 as imports.%import_ref.25 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: generic impl @impl.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.4(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @impl.4.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.19)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%iN)> [symbolic = %As.type (constants.%As.type.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] -// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.9)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.22)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.28 as imports.%import_ref.29 { +// CHECK:STDOUT: impl: imports.%import_ref.30 as imports.%import_ref.31 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.30 +// CHECK:STDOUT: witness = imports.%import_ref.32 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%uN)> [symbolic = %As.type (constants.%As.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.8)] -// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.23)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.31 as imports.%import_ref.32 { +// CHECK:STDOUT: impl: imports.%import_ref.34 as imports.%import_ref.35 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.33 +// CHECK:STDOUT: witness = imports.%import_ref.36 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.7: imports.%import_ref.37 as imports.%import_ref.38 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.39 +// CHECK:STDOUT: generic impl @impl.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.7(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] +// CHECK:STDOUT: %Convert: @impl.7.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.24)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.37 as imports.%import_ref.38 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.39 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] -// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.27)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.27)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.42 as imports.%import_ref.43 { +// CHECK:STDOUT: impl: imports.%import_ref.41 as imports.%import_ref.42 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.44 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.12)] -// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.12) = struct_value () [symbolic = %Convert (constants.%Convert.12)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.28)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.47 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.10: imports.%import_ref.48 as imports.%import_ref.49 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.50 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] -// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.31)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.52 as imports.%import_ref.53 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.54 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.15)] -// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.15) = struct_value () [symbolic = %Convert (constants.%Convert.15)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.32)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.55 as imports.%import_ref.56 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.57 +// CHECK:STDOUT: witness = imports.%import_ref.43 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1597,7 +1546,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic = %CompleteClass (constants.%CompleteClass.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @CompleteClass.%CompleteClass (%CompleteClass.2), i32 [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %.1: type = unbound_element_type @CompleteClass.%CompleteClass (%CompleteClass.2), %i32 [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: %F.type: type = fn_type @F.1, @CompleteClass(%T) [symbolic = %F.type (constants.%F.type.1)] // CHECK:STDOUT: %F: @CompleteClass.%F.type (%F.type.1) = struct_value () [symbolic = %F (constants.%F.1)] // CHECK:STDOUT: @@ -1612,11 +1561,12 @@ class Class(U:! type) { // CHECK:STDOUT: fn @Use() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_27.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_27.2: type = converted %int.make_type_32, %.loc14_27.1 [template = i32] -// CHECK:STDOUT: %.loc14_27.3: type = ptr_type i32 [template = constants.%.4] -// CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(constants.%.4) [template = constants.%CompleteClass.3] +// CHECK:STDOUT: %.loc14_24: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_24) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_27.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_27.2: type = converted %int.make_type_signed, %.loc14_27.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_27.3: type = ptr_type %i32 [template = constants.%.5] +// CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(constants.%.5) [template = constants.%CompleteClass.3] // CHECK:STDOUT: %v.var: ref %CompleteClass.3 = var v // CHECK:STDOUT: %v: ref %CompleteClass.3 = bind_name v, %v.var // CHECK:STDOUT: %F.ref: %F.type.3 = name_ref F, imports.%import_ref.3 [template = constants.%F.3] @@ -1630,45 +1580,45 @@ class Class(U:! type) { // CHECK:STDOUT: generic fn @F.1(constants.%T: type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn() -> i32; +// CHECK:STDOUT: fn() -> %i32; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2() -> %CompleteClass.4; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.15) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.17) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { @@ -1681,38 +1631,38 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.15) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.17) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.15)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.15)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.17)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.17)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(constants.%T) { @@ -1721,7 +1671,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.2 -// CHECK:STDOUT: %.1 => constants.%.3 +// CHECK:STDOUT: %.1 => constants.%.4 // CHECK:STDOUT: %F.type => constants.%F.type.1 // CHECK:STDOUT: %F => constants.%F.1 // CHECK:STDOUT: } @@ -1733,98 +1683,98 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @CompleteClass(constants.%.4) { -// CHECK:STDOUT: %T => constants.%.4 -// CHECK:STDOUT: %T.patt => constants.%.4 +// CHECK:STDOUT: specific @CompleteClass(constants.%.5) { +// CHECK:STDOUT: %T => constants.%.5 +// CHECK:STDOUT: %T.patt => constants.%.5 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.3 -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.1 => constants.%.6 // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @CompleteClass(i32) { -// CHECK:STDOUT: %T => i32 -// CHECK:STDOUT: %T.patt => i32 +// CHECK:STDOUT: specific @CompleteClass(constants.%i32) { +// CHECK:STDOUT: %T => constants.%i32 +// CHECK:STDOUT: %T.patt => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.4 -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.1 => constants.%.8 // CHECK:STDOUT: %F.type => constants.%F.type.4 // CHECK:STDOUT: %F => constants.%F.4 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: specific @Convert.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.17 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.3(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.17 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.3(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.17 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.15 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: specific @impl.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(%N) { +// CHECK:STDOUT: specific @impl.4(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.5(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%Dest) { @@ -1832,17 +1782,9 @@ class Class(U:! type) { // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.3 -// CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.10 -// CHECK:STDOUT: %Convert => constants.%Convert.10 -// CHECK:STDOUT: %.1 => constants.%.25 -// CHECK:STDOUT: %.2 => constants.%.26 +// CHECK:STDOUT: specific @As(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(%Dest) { @@ -1850,6 +1792,25 @@ class Class(U:! type) { // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.5.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @As(@Convert.6.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -1861,62 +1822,38 @@ class Class(U:! type) { // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.15) { -// CHECK:STDOUT: %Dest => constants.%.15 -// CHECK:STDOUT: %Dest.patt => constants.%.15 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.8.%.1) { -// CHECK:STDOUT: %Dest => constants.%.15 -// CHECK:STDOUT: %Dest.patt => constants.%.15 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.15 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.15 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.17) { -// CHECK:STDOUT: %Dest => constants.%.17 -// CHECK:STDOUT: %Dest.patt => constants.%.17 +// CHECK:STDOUT: specific @As(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.9.%.1) { -// CHECK:STDOUT: %Dest => constants.%.17 -// CHECK:STDOUT: %Dest.patt => constants.%.17 +// CHECK:STDOUT: specific @As(@impl.6.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: specific @impl.6(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.17 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(%N) { +// CHECK:STDOUT: specific @impl.6(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.17 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(Core.IntLiteral) { @@ -1924,119 +1861,109 @@ class Class(U:! type) { // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %As.type => constants.%As.type.5 // CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.13 -// CHECK:STDOUT: %Convert => constants.%Convert.13 -// CHECK:STDOUT: %.1 => constants.%.29 -// CHECK:STDOUT: %.2 => constants.%.30 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 +// CHECK:STDOUT: %Convert => constants.%Convert.12 +// CHECK:STDOUT: %.1 => constants.%.25 +// CHECK:STDOUT: %.2 => constants.%.26 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: specific @impl.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(%N) { +// CHECK:STDOUT: specific @impl.7(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.9(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: specific @impl.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(%N) { +// CHECK:STDOUT: specific @impl.8(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.10(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_foo.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, imports.%import_ref.10 [symbolic] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.11 [template] -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %.5: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%.5)> [symbolic] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: = interface_witness (%Convert.2) [symbolic] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.3, @impl.2(%N) [symbolic] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic] -// CHECK:STDOUT: %.6: = interface_witness (%Convert.3) [symbolic] -// CHECK:STDOUT: %.7: type = int_type unsigned, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %.4: = interface_witness (%Convert.3) [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.4, @impl.3(%N) [symbolic] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] -// CHECK:STDOUT: %.8: = interface_witness (%Convert.4) [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %.5: = interface_witness (%Convert.4) [symbolic] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.5 [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.21 [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.5, %Convert.type.5 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.17 [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.5, @impl.4(%N) [symbolic] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] -// CHECK:STDOUT: %.11: = interface_witness (%Convert.6) [symbolic] -// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] -// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] -// CHECK:STDOUT: %.12: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %.8: = interface_witness (%Convert.6) [symbolic] // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] // CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%iN)> [symbolic] // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.9: type = assoc_entity_type %As.type.2, %Convert.type.7 [symbolic] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.27 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.7, @impl.5(%N) [symbolic] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] -// CHECK:STDOUT: %.13: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] -// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.34 [symbolic] -// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] -// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] -// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.35 [template] -// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.5)> [symbolic] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.8) [symbolic] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.8, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.9) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.9, @impl.7(%N) [symbolic] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] -// CHECK:STDOUT: %.17: = interface_witness (%Convert.10) [symbolic] -// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] -// CHECK:STDOUT: %.18: = interface_witness (%Convert.11) [symbolic] -// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] -// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] -// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.45 [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] -// CHECK:STDOUT: %.21: = interface_witness (%Convert.13) [symbolic] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] -// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %.14: type = assoc_entity_type %As.type.5, %Convert.type.11 [template] +// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.34 [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.12) [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic] // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] @@ -2044,62 +1971,50 @@ class Class(U:! type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] -// CHECK:STDOUT: %.23: %.type = struct_value () [template] -// CHECK:STDOUT: %.24: type = class_type @.1, @.1(%U) [symbolic] +// CHECK:STDOUT: %.17: %.type = struct_value () [template] +// CHECK:STDOUT: %.18: type = class_type @.1, @.1(%U) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %Class.type = import_ref Main//foo, inst+9, loaded [template = constants.%Class.1] // CHECK:STDOUT: %import_ref.2 = import_ref Main//foo, inst+20, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//foo, inst+432, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//foo, inst+413, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4 = import_ref Main//foo, inst+69, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+70, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+71, unloaded -// CHECK:STDOUT: %import_ref.7: type = import_ref Main//foo, inst+105, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.8: type = import_ref Main//foo, inst+106, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//foo, inst+107, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//foo, inst+86, unloaded -// CHECK:STDOUT: %import_ref.12: type = import_ref Main//foo, inst+117, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.13: type = import_ref Main//foo, inst+118, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] -// CHECK:STDOUT: %import_ref.14 = import_ref Main//foo, inst+119, unloaded -// CHECK:STDOUT: %import_ref.15: type = import_ref Main//foo, inst+147, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.16: type = import_ref Main//foo, inst+148, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.5)] -// CHECK:STDOUT: %import_ref.17 = import_ref Main//foo, inst+149, unloaded -// CHECK:STDOUT: %import_ref.18: type = import_ref Main//foo, inst+172, loaded [template = i32] -// CHECK:STDOUT: %import_ref.19: type = import_ref Main//foo, inst+173, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.20 = import_ref Main//foo, inst+174, unloaded -// CHECK:STDOUT: %import_ref.22: type = import_ref Main//foo, inst+185, loaded [symbolic = @impl.5.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.23: type = import_ref Main//foo, inst+186, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.24 = import_ref Main//foo, inst+187, unloaded -// CHECK:STDOUT: %import_ref.25: type = import_ref Main//foo, inst+212, loaded [symbolic = @impl.6.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.26: type = import_ref Main//foo, inst+213, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.27 = import_ref Main//foo, inst+214, unloaded -// CHECK:STDOUT: %import_ref.28 = import_ref Main//foo, inst+244, unloaded -// CHECK:STDOUT: %import_ref.29 = import_ref Main//foo, inst+245, unloaded -// CHECK:STDOUT: %import_ref.30 = import_ref Main//foo, inst+246, unloaded -// CHECK:STDOUT: %import_ref.31: type = import_ref Main//foo, inst+248, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.32: type = import_ref Main//foo, inst+249, loaded [template = constants.%As.type.3] -// CHECK:STDOUT: %import_ref.33 = import_ref Main//foo, inst+250, unloaded -// CHECK:STDOUT: %import_ref.34 = import_ref Main//foo, inst+265, unloaded -// CHECK:STDOUT: %import_ref.36: type = import_ref Main//foo, inst+287, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.37: type = import_ref Main//foo, inst+288, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] -// CHECK:STDOUT: %import_ref.38 = import_ref Main//foo, inst+289, unloaded -// CHECK:STDOUT: %import_ref.39: type = import_ref Main//foo, inst+316, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.40: type = import_ref Main//foo, inst+317, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] -// CHECK:STDOUT: %import_ref.41 = import_ref Main//foo, inst+318, unloaded -// CHECK:STDOUT: %import_ref.42: type = import_ref Main//foo, inst+341, loaded [template = i32] -// CHECK:STDOUT: %import_ref.43: type = import_ref Main//foo, inst+342, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.44 = import_ref Main//foo, inst+343, unloaded -// CHECK:STDOUT: %import_ref.46: type = import_ref Main//foo, inst+354, loaded [symbolic = @impl.11.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.47: type = import_ref Main//foo, inst+355, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.48 = import_ref Main//foo, inst+356, unloaded -// CHECK:STDOUT: %import_ref.49: type = import_ref Main//foo, inst+381, loaded [symbolic = @impl.12.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.50: type = import_ref Main//foo, inst+382, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.51 = import_ref Main//foo, inst+383, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//foo, inst+77, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+78, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+79, unloaded +// CHECK:STDOUT: %import_ref.7: type = import_ref Main//foo, inst+121, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.8: type = import_ref Main//foo, inst+122, loaded [symbolic = @impl.1.%ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//foo, inst+123, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//foo, inst+94, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref Main//foo, inst+151, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.12: type = import_ref Main//foo, inst+152, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %import_ref.13 = import_ref Main//foo, inst+153, unloaded +// CHECK:STDOUT: %import_ref.14: type = import_ref Main//foo, inst+180, loaded [symbolic = @impl.3.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.15: type = import_ref Main//foo, inst+181, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.16 = import_ref Main//foo, inst+182, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Main//foo, inst+212, loaded [symbolic = @impl.4.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.19: type = import_ref Main//foo, inst+213, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.20 = import_ref Main//foo, inst+214, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//foo, inst+244, unloaded +// CHECK:STDOUT: %import_ref.22 = import_ref Main//foo, inst+245, unloaded +// CHECK:STDOUT: %import_ref.23 = import_ref Main//foo, inst+246, unloaded +// CHECK:STDOUT: %import_ref.24: type = import_ref Main//foo, inst+252, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.25: type = import_ref Main//foo, inst+253, loaded [symbolic = @impl.5.%As.type (constants.%As.type.3)] +// CHECK:STDOUT: %import_ref.26 = import_ref Main//foo, inst+254, unloaded +// CHECK:STDOUT: %import_ref.27 = import_ref Main//foo, inst+269, unloaded +// CHECK:STDOUT: %import_ref.28: type = import_ref Main//foo, inst+306, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.29: type = import_ref Main//foo, inst+307, loaded [symbolic = @impl.6.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.30 = import_ref Main//foo, inst+308, unloaded +// CHECK:STDOUT: %import_ref.31: type = import_ref Main//foo, inst+335, loaded [symbolic = @impl.7.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.32: type = import_ref Main//foo, inst+336, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.33 = import_ref Main//foo, inst+337, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Main//foo, inst+367, loaded [symbolic = @impl.8.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.36: type = import_ref Main//foo, inst+368, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.37 = import_ref Main//foo, inst+369, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -2112,7 +2027,7 @@ class Class(U:! type) { // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.23] { +// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.17] { // CHECK:STDOUT: %U.patt.loc12_13.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc12_13.2 (constants.%U.patt)] // CHECK:STDOUT: %U.param_patt: type = value_param_pattern %U.patt.loc12_13.1, runtime_param [symbolic = %U.patt.loc12_13.2 (constants.%U.patt)] // CHECK:STDOUT: } { @@ -2148,168 +2063,148 @@ class Class(U:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] -// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.13)] -// CHECK:STDOUT: %.2: @As.%.1 (%.13) = assoc_entity element0, imports.%import_ref.34 [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.7) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %.2: @As.%.1 (%.9) = assoc_entity element0, imports.%import_ref.27 [symbolic = %.2 (constants.%.10)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.28 -// CHECK:STDOUT: .Convert = imports.%import_ref.29 -// CHECK:STDOUT: witness = (imports.%import_ref.30) +// CHECK:STDOUT: .Self = imports.%import_ref.21 +// CHECK:STDOUT: .Convert = imports.%import_ref.22 +// CHECK:STDOUT: witness = (imports.%import_ref.23) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.7 as imports.%import_ref.8 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.9 +// CHECK:STDOUT: generic impl @impl.1(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.1(%N) [symbolic = %Convert.type (constants.%Convert.type.2)] +// CHECK:STDOUT: %Convert: @impl.1.%Convert.type (%Convert.type.2) = struct_value () [symbolic = %Convert (constants.%Convert.2)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.7 as imports.%import_ref.8 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.9 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] // CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { +// CHECK:STDOUT: impl: imports.%import_ref.11 as imports.%import_ref.12 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.14 +// CHECK:STDOUT: witness = imports.%import_ref.13 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] // CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: impl: imports.%import_ref.14 as imports.%import_ref.15 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: witness = imports.%import_ref.16 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.18 as imports.%import_ref.19 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: generic impl @impl.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.4(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.4.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%iN)> [symbolic = %As.type (constants.%As.type.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] -// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.22 as imports.%import_ref.23 { +// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.24 +// CHECK:STDOUT: witness = imports.%import_ref.26 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%uN)> [symbolic = %As.type (constants.%As.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] -// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.9)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.25 as imports.%import_ref.26 { +// CHECK:STDOUT: impl: imports.%import_ref.28 as imports.%import_ref.29 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.27 +// CHECK:STDOUT: witness = imports.%import_ref.30 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.7: imports.%import_ref.31 as imports.%import_ref.32 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.33 +// CHECK:STDOUT: generic impl @impl.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.7(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.7.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.31 as imports.%import_ref.32 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.33 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] -// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.12)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.12) = struct_value () [symbolic = %Convert (constants.%Convert.12)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.36 as imports.%import_ref.37 { +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.38 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] -// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.39 as imports.%import_ref.40 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.41 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.10: imports.%import_ref.42 as imports.%import_ref.43 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.44 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] -// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.46 as imports.%import_ref.47 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.48 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] -// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.49 as imports.%import_ref.50 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.51 +// CHECK:STDOUT: witness = imports.%import_ref.37 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2332,7 +2227,7 @@ class Class(U:! type) { // CHECK:STDOUT: %.loc17: = complete_type_witness [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%.24 +// CHECK:STDOUT: .Self = constants.%.18 // CHECK:STDOUT: .x = %.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -2347,38 +2242,38 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { @@ -2391,38 +2286,38 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { @@ -2430,17 +2325,9 @@ class Class(U:! type) { // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 -// CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 -// CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.1 => constants.%.3 -// CHECK:STDOUT: %.2 => constants.%.4 +// CHECK:STDOUT: specific @ImplicitAs(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(%Dest) { @@ -2448,6 +2335,25 @@ class Class(U:! type) { // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.1.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -2459,62 +2365,38 @@ class Class(U:! type) { // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @ImplicitAs(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { @@ -2522,46 +2404,46 @@ class Class(U:! type) { // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5 // CHECK:STDOUT: %Convert => constants.%Convert.5 -// CHECK:STDOUT: %.1 => constants.%.9 -// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: specific @impl.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: specific @impl.3(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: specific @impl.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(%N) { +// CHECK:STDOUT: specific @impl.4(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.5(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%Dest) { @@ -2569,17 +2451,9 @@ class Class(U:! type) { // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.3 -// CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 -// CHECK:STDOUT: %Convert => constants.%Convert.9 -// CHECK:STDOUT: %.1 => constants.%.15 -// CHECK:STDOUT: %.2 => constants.%.16 +// CHECK:STDOUT: specific @As(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(%Dest) { @@ -2587,6 +2461,25 @@ class Class(U:! type) { // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.5.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @As(@Convert.6.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -2598,62 +2491,38 @@ class Class(U:! type) { // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.8.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.9.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(@impl.6.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: specific @impl.6(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(%N) { +// CHECK:STDOUT: specific @impl.6(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(Core.IntLiteral) { @@ -2661,46 +2530,46 @@ class Class(U:! type) { // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %As.type => constants.%As.type.5 // CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 -// CHECK:STDOUT: %Convert => constants.%Convert.12 -// CHECK:STDOUT: %.1 => constants.%.19 -// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.11 +// CHECK:STDOUT: %Convert => constants.%Convert.11 +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.2 => constants.%.15 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: specific @impl.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(%N) { +// CHECK:STDOUT: specific @impl.7(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.9(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: specific @impl.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(%N) { +// CHECK:STDOUT: specific @impl.8(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.10(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { diff --git a/toolchain/check/testdata/class/generic/init.carbon b/toolchain/check/testdata/class/generic/init.carbon index 745ffbcc123d..a2db729276b3 100644 --- a/toolchain/check/testdata/class/generic/init.carbon +++ b/toolchain/check/testdata/class/generic/init.carbon @@ -55,19 +55,21 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %.3: = complete_type_witness %.2 [symbolic] // CHECK:STDOUT: %InitFromStructGeneric.type: type = fn_type @InitFromStructGeneric [template] // CHECK:STDOUT: %InitFromStructGeneric: %InitFromStructGeneric.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.5 [template] // CHECK:STDOUT: %InitFromStructSpecific.type: type = fn_type @InitFromStructSpecific [template] // CHECK:STDOUT: %InitFromStructSpecific: %InitFromStructSpecific.type = struct_value () [template] -// CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(i32) [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Class.3, i32 [template] -// CHECK:STDOUT: %.6: type = struct_type {.k: i32} [template] -// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] +// CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(%i32) [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Class.3, %i32 [template] +// CHECK:STDOUT: %.7: type = struct_type {.k: %i32} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -106,21 +108,23 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %return: ref @InitFromStructGeneric.%T.loc8_26.2 (%T) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %InitFromStructSpecific.decl: %InitFromStructSpecific.type = fn_decl @InitFromStructSpecific [template = constants.%InitFromStructSpecific] { -// CHECK:STDOUT: %x.patt: i32 = binding_pattern x -// CHECK:STDOUT: %x.param_patt: i32 = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %x.patt: %i32 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %i32 = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc13_30: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_30.1: type = value_of_initializer %int.make_type_32.loc13_30 [template = i32] -// CHECK:STDOUT: %.loc13_30.2: type = converted %int.make_type_32.loc13_30, %.loc13_30.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_38: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_38.1: type = value_of_initializer %int.make_type_32.loc13_38 [template = i32] -// CHECK:STDOUT: %.loc13_38.2: type = converted %int.make_type_32.loc13_38, %.loc13_38.1 [template = i32] -// CHECK:STDOUT: %x.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %x: i32 = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc13_30.1: Core.IntLiteral = int_value 32 [template = constants.%.5] +// CHECK:STDOUT: %int.make_type_signed.loc13_30: init type = call constants.%Int(%.loc13_30.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_30.2: type = value_of_initializer %int.make_type_signed.loc13_30 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_30.3: type = converted %int.make_type_signed.loc13_30, %.loc13_30.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_38.1: Core.IntLiteral = int_value 32 [template = constants.%.5] +// CHECK:STDOUT: %int.make_type_signed.loc13_38: init type = call constants.%Int(%.loc13_38.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_38.2: type = value_of_initializer %int.make_type_signed.loc13_38 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_38.3: type = converted %int.make_type_signed.loc13_38, %.loc13_38.2 [template = constants.%i32] +// CHECK:STDOUT: %x.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %x: %i32 = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -176,26 +180,27 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @InitFromStructSpecific(%x.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @InitFromStructSpecific(%x.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_15.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] -// CHECK:STDOUT: %.loc14_15.2: type = converted %int.make_type_32.loc14, %.loc14_15.1 [template = i32] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(i32) [template = constants.%Class.3] +// CHECK:STDOUT: %.loc14_16: Core.IntLiteral = int_value 32 [template = constants.%.5] +// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%.loc14_16) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_15.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_15.2: type = converted %int.make_type_signed.loc14, %.loc14_15.1 [template = constants.%i32] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.3] // CHECK:STDOUT: %v.var: ref %Class.3 = var v // CHECK:STDOUT: %v: ref %Class.3 = bind_name v, %v.var -// CHECK:STDOUT: %x.ref: i32 = name_ref x, %x -// CHECK:STDOUT: %.loc14_30.1: %.6 = struct_literal (%x.ref) -// CHECK:STDOUT: %.loc14_30.2: ref i32 = class_element_access %v.var, element0 -// CHECK:STDOUT: %.loc14_30.3: init i32 = initialize_from %x.ref to %.loc14_30.2 +// CHECK:STDOUT: %x.ref: %i32 = name_ref x, %x +// CHECK:STDOUT: %.loc14_30.1: %.7 = struct_literal (%x.ref) +// CHECK:STDOUT: %.loc14_30.2: ref %i32 = class_element_access %v.var, element0 +// CHECK:STDOUT: %.loc14_30.3: init %i32 = initialize_from %x.ref to %.loc14_30.2 // CHECK:STDOUT: %.loc14_30.4: init %Class.3 = class_init (%.loc14_30.3), %v.var // CHECK:STDOUT: %.loc14_31: init %Class.3 = converted %.loc14_30.1, %.loc14_30.4 // CHECK:STDOUT: assign %v.var, %.loc14_31 // CHECK:STDOUT: %v.ref: ref %Class.3 = name_ref v, %v -// CHECK:STDOUT: %k.ref: %.5 = name_ref k, @Class.%.loc5_8.1 [template = @Class.%.loc5_8.1] -// CHECK:STDOUT: %.loc15_11.1: ref i32 = class_element_access %v.ref, element0 -// CHECK:STDOUT: %.loc15_11.2: i32 = bind_value %.loc15_11.1 +// CHECK:STDOUT: %k.ref: %.6 = name_ref k, @Class.%.loc5_8.1 [template = @Class.%.loc5_8.1] +// CHECK:STDOUT: %.loc15_11.1: ref %i32 = class_element_access %v.ref, element0 +// CHECK:STDOUT: %.loc15_11.2: %i32 = bind_value %.loc15_11.1 // CHECK:STDOUT: return %.loc15_11.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -225,15 +230,15 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(i32) { -// CHECK:STDOUT: %T.loc4_13.2 => i32 -// CHECK:STDOUT: %T.patt.loc4_13.2 => i32 +// CHECK:STDOUT: specific @Class(constants.%i32) { +// CHECK:STDOUT: %T.loc4_13.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.3 -// CHECK:STDOUT: %.loc5_8.2 => constants.%.5 -// CHECK:STDOUT: %.loc6_1.2 => constants.%.6 -// CHECK:STDOUT: %.loc6_1.3 => constants.%.7 +// CHECK:STDOUT: %.loc5_8.2 => constants.%.6 +// CHECK:STDOUT: %.loc6_1.2 => constants.%.7 +// CHECK:STDOUT: %.loc6_1.3 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- adapt.carbon @@ -247,17 +252,19 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %.1: = complete_type_witness %T [symbolic] // CHECK:STDOUT: %InitFromAdaptedGeneric.type: type = fn_type @InitFromAdaptedGeneric [template] // CHECK:STDOUT: %InitFromAdaptedGeneric: %InitFromAdaptedGeneric.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.2 [template] // CHECK:STDOUT: %InitFromAdaptedSpecific.type: type = fn_type @InitFromAdaptedSpecific [template] // CHECK:STDOUT: %InitFromAdaptedSpecific: %InitFromAdaptedSpecific.type = struct_value () [template] -// CHECK:STDOUT: %Adapt.3: type = class_type @Adapt, @Adapt(i32) [template] -// CHECK:STDOUT: %.2: = complete_type_witness i32 [template] +// CHECK:STDOUT: %Adapt.3: type = class_type @Adapt, @Adapt(%i32) [template] +// CHECK:STDOUT: %.3: = complete_type_witness %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -296,21 +303,23 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %return: ref @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %InitFromAdaptedSpecific.decl: %InitFromAdaptedSpecific.type = fn_decl @InitFromAdaptedSpecific [template = constants.%InitFromAdaptedSpecific] { -// CHECK:STDOUT: %x.patt: i32 = binding_pattern x -// CHECK:STDOUT: %x.param_patt: i32 = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %x.patt: %i32 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %i32 = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc12_31: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_31.1: type = value_of_initializer %int.make_type_32.loc12_31 [template = i32] -// CHECK:STDOUT: %.loc12_31.2: type = converted %int.make_type_32.loc12_31, %.loc12_31.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc12_39: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_39.1: type = value_of_initializer %int.make_type_32.loc12_39 [template = i32] -// CHECK:STDOUT: %.loc12_39.2: type = converted %int.make_type_32.loc12_39, %.loc12_39.1 [template = i32] -// CHECK:STDOUT: %x.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %x: i32 = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc12_31.1: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc12_31: init type = call constants.%Int(%.loc12_31.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_31.2: type = value_of_initializer %int.make_type_signed.loc12_31 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_31.3: type = converted %int.make_type_signed.loc12_31, %.loc12_31.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_39.1: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc12_39: init type = call constants.%Int(%.loc12_39.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_39.2: type = value_of_initializer %int.make_type_signed.loc12_39 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_39.3: type = converted %int.make_type_signed.loc12_39, %.loc12_39.2 [template = constants.%i32] +// CHECK:STDOUT: %x.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %x: %i32 = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -353,21 +362,23 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @InitFromAdaptedSpecific(%x.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @InitFromAdaptedSpecific(%x.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.ref: i32 = name_ref x, %x +// CHECK:STDOUT: %x.ref: %i32 = name_ref x, %x // CHECK:STDOUT: %Adapt.ref: %Adapt.type = name_ref Adapt, file.%Adapt.decl [template = constants.%Adapt.1] -// CHECK:STDOUT: %int.make_type_32.loc13_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_21.1: type = value_of_initializer %int.make_type_32.loc13_22 [template = i32] -// CHECK:STDOUT: %.loc13_21.2: type = converted %int.make_type_32.loc13_22, %.loc13_21.1 [template = i32] -// CHECK:STDOUT: %Adapt: type = class_type @Adapt, @Adapt(i32) [template = constants.%Adapt.3] +// CHECK:STDOUT: %.loc13_22: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc13_22: init type = call constants.%Int(%.loc13_22) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_21.1: type = value_of_initializer %int.make_type_signed.loc13_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_21.2: type = converted %int.make_type_signed.loc13_22, %.loc13_21.1 [template = constants.%i32] +// CHECK:STDOUT: %Adapt: type = class_type @Adapt, @Adapt(constants.%i32) [template = constants.%Adapt.3] // CHECK:STDOUT: %.loc13_13.1: %Adapt.3 = as_compatible %x.ref // CHECK:STDOUT: %.loc13_13.2: %Adapt.3 = converted %x.ref, %.loc13_13.1 -// CHECK:STDOUT: %int.make_type_32.loc13_31: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_32.loc13_31 [template = i32] -// CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_32.loc13_31, %.loc13_31.1 [template = i32] -// CHECK:STDOUT: %.loc13_28.1: i32 = as_compatible %.loc13_13.2 -// CHECK:STDOUT: %.loc13_28.2: i32 = converted %.loc13_13.2, %.loc13_28.1 +// CHECK:STDOUT: %.loc13_31.1: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc13_31: init type = call constants.%Int(%.loc13_31.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.2: type = value_of_initializer %int.make_type_signed.loc13_31 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.3: type = converted %int.make_type_signed.loc13_31, %.loc13_31.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_28.1: %i32 = as_compatible %.loc13_13.2 +// CHECK:STDOUT: %.loc13_28.2: %i32 = converted %.loc13_13.2, %.loc13_28.1 // CHECK:STDOUT: return %.loc13_28.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -389,11 +400,11 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Adapt(i32) { -// CHECK:STDOUT: %T.loc4_13.2 => i32 -// CHECK:STDOUT: %T.patt.loc4_13.2 => i32 +// CHECK:STDOUT: specific @Adapt(constants.%i32) { +// CHECK:STDOUT: %T.loc4_13.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc6_1.2 => constants.%.2 +// CHECK:STDOUT: %.loc6_1.2 => constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index fed8f391a171..f4ccfbd5f289 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -65,29 +65,31 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %GetAddr.1: %GetAddr.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.4: type = struct_type {.x: %T} [symbolic] // CHECK:STDOUT: %.5: = complete_type_witness %.4 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(i32) [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.7 [template] +// CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(%i32) [template] // CHECK:STDOUT: %DirectFieldAccess.type: type = fn_type @DirectFieldAccess [template] // CHECK:STDOUT: %DirectFieldAccess: %DirectFieldAccess.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = unbound_element_type %Class.3, i32 [template] -// CHECK:STDOUT: %Get.type.2: type = fn_type @Get, @Class(i32) [template] +// CHECK:STDOUT: %.8: type = unbound_element_type %Class.3, %i32 [template] +// CHECK:STDOUT: %Get.type.2: type = fn_type @Get, @Class(%i32) [template] // CHECK:STDOUT: %Get.2: %Get.type.2 = struct_value () [template] -// CHECK:STDOUT: %GetAddr.type.2: type = fn_type @GetAddr, @Class(i32) [template] +// CHECK:STDOUT: %GetAddr.type.2: type = fn_type @GetAddr, @Class(%i32) [template] // CHECK:STDOUT: %GetAddr.2: %GetAddr.type.2 = struct_value () [template] -// CHECK:STDOUT: %.8: type = struct_type {.x: i32} [template] -// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] +// CHECK:STDOUT: %.9: type = struct_type {.x: %i32} [template] +// CHECK:STDOUT: %.10: = complete_type_witness %.9 [template] // CHECK:STDOUT: %MethodCall.type: type = fn_type @MethodCall [template] // CHECK:STDOUT: %MethodCall: %MethodCall.type = struct_value () [template] -// CHECK:STDOUT: %.11: type = ptr_type %Class.3 [template] +// CHECK:STDOUT: %.12: type = ptr_type %Class.3 [template] // CHECK:STDOUT: %AddrMethodCall.type: type = fn_type @AddrMethodCall [template] // CHECK:STDOUT: %AddrMethodCall: %AddrMethodCall.type = struct_value () [template] -// CHECK:STDOUT: %.12: type = ptr_type i32 [template] +// CHECK:STDOUT: %.13: type = ptr_type %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -112,60 +114,66 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %DirectFieldAccess.decl: %DirectFieldAccess.type = fn_decl @DirectFieldAccess [template = constants.%DirectFieldAccess] { // CHECK:STDOUT: %x.patt: %Class.3 = binding_pattern x // CHECK:STDOUT: %x.param_patt: %Class.3 = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %int.make_type_32.loc10_31: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_30.1: type = value_of_initializer %int.make_type_32.loc10_31 [template = i32] -// CHECK:STDOUT: %.loc10_30.2: type = converted %int.make_type_32.loc10_31, %.loc10_30.1 [template = i32] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(i32) [template = constants.%Class.3] -// CHECK:STDOUT: %int.make_type_32.loc10_40: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_40.1: type = value_of_initializer %int.make_type_32.loc10_40 [template = i32] -// CHECK:STDOUT: %.loc10_40.2: type = converted %int.make_type_32.loc10_40, %.loc10_40.1 [template = i32] +// CHECK:STDOUT: %.loc10_31: Core.IntLiteral = int_value 32 [template = constants.%.7] +// CHECK:STDOUT: %int.make_type_signed.loc10_31: init type = call constants.%Int(%.loc10_31) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_30.1: type = value_of_initializer %int.make_type_signed.loc10_31 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_30.2: type = converted %int.make_type_signed.loc10_31, %.loc10_30.1 [template = constants.%i32] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.3] +// CHECK:STDOUT: %.loc10_40.1: Core.IntLiteral = int_value 32 [template = constants.%.7] +// CHECK:STDOUT: %int.make_type_signed.loc10_40: init type = call constants.%Int(%.loc10_40.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_40.2: type = value_of_initializer %int.make_type_signed.loc10_40 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_40.3: type = converted %int.make_type_signed.loc10_40, %.loc10_40.2 [template = constants.%i32] // CHECK:STDOUT: %x.param: %Class.3 = value_param runtime_param0 // CHECK:STDOUT: %x: %Class.3 = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %MethodCall.decl: %MethodCall.type = fn_decl @MethodCall [template = constants.%MethodCall] { // CHECK:STDOUT: %x.patt: %Class.3 = binding_pattern x // CHECK:STDOUT: %x.param_patt: %Class.3 = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %int.make_type_32.loc14_24: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_23.1: type = value_of_initializer %int.make_type_32.loc14_24 [template = i32] -// CHECK:STDOUT: %.loc14_23.2: type = converted %int.make_type_32.loc14_24, %.loc14_23.1 [template = i32] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(i32) [template = constants.%Class.3] -// CHECK:STDOUT: %int.make_type_32.loc14_33: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_33.1: type = value_of_initializer %int.make_type_32.loc14_33 [template = i32] -// CHECK:STDOUT: %.loc14_33.2: type = converted %int.make_type_32.loc14_33, %.loc14_33.1 [template = i32] +// CHECK:STDOUT: %.loc14_24: Core.IntLiteral = int_value 32 [template = constants.%.7] +// CHECK:STDOUT: %int.make_type_signed.loc14_24: init type = call constants.%Int(%.loc14_24) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_23.1: type = value_of_initializer %int.make_type_signed.loc14_24 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_23.2: type = converted %int.make_type_signed.loc14_24, %.loc14_23.1 [template = constants.%i32] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.3] +// CHECK:STDOUT: %.loc14_33.1: Core.IntLiteral = int_value 32 [template = constants.%.7] +// CHECK:STDOUT: %int.make_type_signed.loc14_33: init type = call constants.%Int(%.loc14_33.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_33.2: type = value_of_initializer %int.make_type_signed.loc14_33 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_33.3: type = converted %int.make_type_signed.loc14_33, %.loc14_33.2 [template = constants.%i32] // CHECK:STDOUT: %x.param: %Class.3 = value_param runtime_param0 // CHECK:STDOUT: %x: %Class.3 = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %AddrMethodCall.decl: %AddrMethodCall.type = fn_decl @AddrMethodCall [template = constants.%AddrMethodCall] { -// CHECK:STDOUT: %p.patt: %.11 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.11 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.12 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.12 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %int.make_type_32.loc18_28: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_27.1: type = value_of_initializer %int.make_type_32.loc18_28 [template = i32] -// CHECK:STDOUT: %.loc18_27.2: type = converted %int.make_type_32.loc18_28, %.loc18_27.1 [template = i32] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(i32) [template = constants.%Class.3] -// CHECK:STDOUT: %.loc18_32: type = ptr_type %Class.3 [template = constants.%.11] -// CHECK:STDOUT: %int.make_type_32.loc18_38: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_38.1: type = value_of_initializer %int.make_type_32.loc18_38 [template = i32] -// CHECK:STDOUT: %.loc18_38.2: type = converted %int.make_type_32.loc18_38, %.loc18_38.1 [template = i32] -// CHECK:STDOUT: %p.param: %.11 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.11 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc18_28: Core.IntLiteral = int_value 32 [template = constants.%.7] +// CHECK:STDOUT: %int.make_type_signed.loc18_28: init type = call constants.%Int(%.loc18_28) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_27.1: type = value_of_initializer %int.make_type_signed.loc18_28 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_27.2: type = converted %int.make_type_signed.loc18_28, %.loc18_27.1 [template = constants.%i32] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.3] +// CHECK:STDOUT: %.loc18_32: type = ptr_type %Class.3 [template = constants.%.12] +// CHECK:STDOUT: %.loc18_38.1: Core.IntLiteral = int_value 32 [template = constants.%.7] +// CHECK:STDOUT: %int.make_type_signed.loc18_38: init type = call constants.%Int(%.loc18_38.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_38.2: type = value_of_initializer %int.make_type_signed.loc18_38 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_38.3: type = converted %int.make_type_signed.loc18_38, %.loc18_38.2 [template = constants.%i32] +// CHECK:STDOUT: %p.param: %.12 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.12 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -264,42 +272,42 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @DirectFieldAccess(%x.param_patt: %Class.3) -> i32 { +// CHECK:STDOUT: fn @DirectFieldAccess(%x.param_patt: %Class.3) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref.loc11_10: %Class.3 = name_ref x, %x -// CHECK:STDOUT: %x.ref.loc11_11: %.7 = name_ref x, @Class.%.loc3_8.1 [template = @Class.%.loc3_8.1] -// CHECK:STDOUT: %.loc11_11.1: ref i32 = class_element_access %x.ref.loc11_10, element0 -// CHECK:STDOUT: %.loc11_11.2: i32 = bind_value %.loc11_11.1 +// CHECK:STDOUT: %x.ref.loc11_11: %.8 = name_ref x, @Class.%.loc3_8.1 [template = @Class.%.loc3_8.1] +// CHECK:STDOUT: %.loc11_11.1: ref %i32 = class_element_access %x.ref.loc11_10, element0 +// CHECK:STDOUT: %.loc11_11.2: %i32 = bind_value %.loc11_11.1 // CHECK:STDOUT: return %.loc11_11.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @MethodCall(%x.param_patt: %Class.3) -> i32 { +// CHECK:STDOUT: fn @MethodCall(%x.param_patt: %Class.3) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %Class.3 = name_ref x, %x -// CHECK:STDOUT: %.loc15_11.1: %Get.type.2 = specific_constant @Class.%Get.decl, @Class(i32) [template = constants.%Get.2] +// CHECK:STDOUT: %.loc15_11.1: %Get.type.2 = specific_constant @Class.%Get.decl, @Class(constants.%i32) [template = constants.%Get.2] // CHECK:STDOUT: %Get.ref: %Get.type.2 = name_ref Get, %.loc15_11.1 [template = constants.%Get.2] // CHECK:STDOUT: %.loc15_11.2: = bound_method %x.ref, %Get.ref -// CHECK:STDOUT: %.loc15_11.3: = specific_function %.loc15_11.2, @Get(i32) -// CHECK:STDOUT: %Get.call: init i32 = call %.loc15_11.3(%x.ref) -// CHECK:STDOUT: %.loc15_17.1: i32 = value_of_initializer %Get.call -// CHECK:STDOUT: %.loc15_17.2: i32 = converted %Get.call, %.loc15_17.1 +// CHECK:STDOUT: %.loc15_11.3: = specific_function %.loc15_11.2, @Get(constants.%i32) +// CHECK:STDOUT: %Get.call: init %i32 = call %.loc15_11.3(%x.ref) +// CHECK:STDOUT: %.loc15_17.1: %i32 = value_of_initializer %Get.call +// CHECK:STDOUT: %.loc15_17.2: %i32 = converted %Get.call, %.loc15_17.1 // CHECK:STDOUT: return %.loc15_17.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AddrMethodCall(%p.param_patt: %.11) -> i32 { +// CHECK:STDOUT: fn @AddrMethodCall(%p.param_patt: %.12) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.11 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.12 = name_ref p, %p // CHECK:STDOUT: %.loc19_12.1: ref %Class.3 = deref %p.ref -// CHECK:STDOUT: %.loc19_12.2: %GetAddr.type.2 = specific_constant @Class.%GetAddr.decl, @Class(i32) [template = constants.%GetAddr.2] +// CHECK:STDOUT: %.loc19_12.2: %GetAddr.type.2 = specific_constant @Class.%GetAddr.decl, @Class(constants.%i32) [template = constants.%GetAddr.2] // CHECK:STDOUT: %GetAddr.ref: %GetAddr.type.2 = name_ref GetAddr, %.loc19_12.2 [template = constants.%GetAddr.2] // CHECK:STDOUT: %.loc19_12.3: = bound_method %.loc19_12.1, %GetAddr.ref -// CHECK:STDOUT: %.loc19_12.4: = specific_function %.loc19_12.3, @GetAddr(i32) -// CHECK:STDOUT: %.loc19_12.5: %.11 = addr_of %.loc19_12.1 -// CHECK:STDOUT: %GetAddr.call: init %.12 = call %.loc19_12.4(%.loc19_12.5) -// CHECK:STDOUT: %.loc19_21.1: %.12 = value_of_initializer %GetAddr.call -// CHECK:STDOUT: %.loc19_21.2: %.12 = converted %GetAddr.call, %.loc19_21.1 -// CHECK:STDOUT: %.loc19_10.1: ref i32 = deref %.loc19_21.2 -// CHECK:STDOUT: %.loc19_10.2: i32 = bind_value %.loc19_10.1 +// CHECK:STDOUT: %.loc19_12.4: = specific_function %.loc19_12.3, @GetAddr(constants.%i32) +// CHECK:STDOUT: %.loc19_12.5: %.12 = addr_of %.loc19_12.1 +// CHECK:STDOUT: %GetAddr.call: init %.13 = call %.loc19_12.4(%.loc19_12.5) +// CHECK:STDOUT: %.loc19_21.1: %.13 = value_of_initializer %GetAddr.call +// CHECK:STDOUT: %.loc19_21.2: %.13 = converted %GetAddr.call, %.loc19_21.1 +// CHECK:STDOUT: %.loc19_10.1: ref %i32 = deref %.loc19_21.2 +// CHECK:STDOUT: %.loc19_10.2: %i32 = bind_value %.loc19_10.1 // CHECK:STDOUT: return %.loc19_10.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -345,37 +353,37 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(i32) { -// CHECK:STDOUT: %T.loc2_13.2 => i32 -// CHECK:STDOUT: %T.patt.loc2_13.2 => i32 +// CHECK:STDOUT: specific @Class(constants.%i32) { +// CHECK:STDOUT: %T.loc2_13.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.3 -// CHECK:STDOUT: %.loc3_8.2 => constants.%.7 +// CHECK:STDOUT: %.loc3_8.2 => constants.%.8 // CHECK:STDOUT: %Get.type => constants.%Get.type.2 // CHECK:STDOUT: %Get => constants.%Get.2 // CHECK:STDOUT: %GetAddr.type => constants.%GetAddr.type.2 // CHECK:STDOUT: %GetAddr => constants.%GetAddr.2 -// CHECK:STDOUT: %.loc8_1.2 => constants.%.8 -// CHECK:STDOUT: %.loc8_1.3 => constants.%.9 +// CHECK:STDOUT: %.loc8_1.2 => constants.%.9 +// CHECK:STDOUT: %.loc8_1.3 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Get(i32) { -// CHECK:STDOUT: %T => i32 +// CHECK:STDOUT: specific @Get(constants.%i32) { +// CHECK:STDOUT: %T => constants.%i32 // CHECK:STDOUT: %Class => constants.%Class.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc5_42.3 => constants.%.7 +// CHECK:STDOUT: %.loc5_42.3 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @GetAddr(i32) { -// CHECK:STDOUT: %T => i32 +// CHECK:STDOUT: specific @GetAddr(constants.%i32) { +// CHECK:STDOUT: %T => constants.%i32 // CHECK:STDOUT: %Class => constants.%Class.3 -// CHECK:STDOUT: %.loc7_29.1 => constants.%.11 -// CHECK:STDOUT: %.loc7_38.1 => constants.%.12 +// CHECK:STDOUT: %.loc7_29.1 => constants.%.12 +// CHECK:STDOUT: %.loc7_38.1 => constants.%.13 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc7_54.3 => constants.%.7 +// CHECK:STDOUT: %.loc7_54.3 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_static_member_fn_call.carbon diff --git a/toolchain/check/testdata/class/generic/redeclare.carbon b/toolchain/check/testdata/class/generic/redeclare.carbon index 5cac979d2ce8..2b7b5322c470 100644 --- a/toolchain/check/testdata/class/generic/redeclare.carbon +++ b/toolchain/check/testdata/class/generic/redeclare.carbon @@ -206,10 +206,12 @@ class E(U:! type) {} // CHECK:STDOUT: --- fail_mismatch_implicit_param_list.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt.1: i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %B.type: type = generic_class_type @B [template] // CHECK:STDOUT: %B.1: %B.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] @@ -217,15 +219,15 @@ class E(U:! type) {} // CHECK:STDOUT: %N.2: %T = bind_symbolic_name N, 1 [symbolic] // CHECK:STDOUT: %N.patt.2: %T = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] -// CHECK:STDOUT: %.1: %.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = class_type @.1, @.1(%T, %N.2) [symbolic] -// CHECK:STDOUT: %.3: type = struct_type {} [template] -// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.2: %.type = struct_value () [template] +// CHECK:STDOUT: %.3: type = class_type @.1, @.1(%T, %N.2) [symbolic] +// CHECK:STDOUT: %.4: type = struct_type {} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -238,16 +240,17 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %B.decl: %B.type = class_decl @B [template = constants.%B.1] { -// CHECK:STDOUT: %N.patt.loc4_9.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc4_9.1, runtime_param [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc4_9.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_9.1, runtime_param [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_32, %.loc4_13.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc4_9.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_9.2 (constants.%N.1)] +// CHECK:STDOUT: %.loc4_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_13.3: type = converted %int.make_type_signed, %.loc4_13.2 [template = constants.%i32] +// CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc4_9.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_9.2 (constants.%N.1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.1] { +// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { // CHECK:STDOUT: %T.patt.loc12_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc12_9.1, runtime_param [symbolic = %T.patt.loc12_9.2 (constants.%T.patt)] // CHECK:STDOUT: %N.patt.loc12_19.1: @.1.%T.loc12_9.2 (%T) = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc12_19.2 (constants.%N.patt.2)] @@ -261,9 +264,9 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @B(%N.loc4_9.1: i32) { -// CHECK:STDOUT: %N.loc4_9.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_9.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc4_9.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] +// CHECK:STDOUT: generic class @B(%N.loc4_9.1: %i32) { +// CHECK:STDOUT: %N.loc4_9.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_9.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc4_9.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } @@ -277,10 +280,10 @@ class E(U:! type) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc12: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc12: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%.2 +// CHECK:STDOUT: .Self = constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -303,20 +306,22 @@ class E(U:! type) {} // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %U: i32 = bind_symbolic_name U, 1 [symbolic] -// CHECK:STDOUT: %U.patt: i32 = symbolic_binding_pattern U, 1 [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %U: %i32 = bind_symbolic_name U, 1 [symbolic] +// CHECK:STDOUT: %U.patt: %i32 = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] -// CHECK:STDOUT: %.1: %.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = class_type @.1, @.1(%T, %U) [symbolic] -// CHECK:STDOUT: %.3: type = struct_type {} [template] -// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.2: %.type = struct_value () [template] +// CHECK:STDOUT: %.3: type = class_type @.1, @.1(%T, %U) [symbolic] +// CHECK:STDOUT: %.4: type = struct_type {} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -335,19 +340,20 @@ class E(U:! type) {} // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_9.2 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.1] { +// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { // CHECK:STDOUT: %T.patt.loc12_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc12_9.1, runtime_param [symbolic = %T.patt.loc12_9.2 (constants.%T.patt)] -// CHECK:STDOUT: %U.patt.loc12_19.1: i32 = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc12_19.2 (constants.%U.patt)] -// CHECK:STDOUT: %U.param_patt: i32 = value_param_pattern %U.patt.loc12_19.1, runtime_param [symbolic = %U.patt.loc12_19.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.patt.loc12_19.1: %i32 = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc12_19.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: %i32 = value_param_pattern %U.patt.loc12_19.1, runtime_param [symbolic = %U.patt.loc12_19.2 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_23.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_23.2: type = converted %int.make_type_32, %.loc12_23.1 [template = i32] +// CHECK:STDOUT: %.loc12_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_23.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_23.3: type = converted %int.make_type_signed, %.loc12_23.2 [template = constants.%i32] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc12_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_9.2 (constants.%T)] -// CHECK:STDOUT: %U.param: i32 = value_param runtime_param -// CHECK:STDOUT: %U.loc12_19.1: i32 = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc12_19.2 (constants.%U)] +// CHECK:STDOUT: %U.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %U.loc12_19.1: %i32 = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc12_19.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -358,19 +364,19 @@ class E(U:! type) {} // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(%T.loc12_9.1: type, %U.loc12_19.1: i32) { +// CHECK:STDOUT: generic class @.1(%T.loc12_9.1: type, %U.loc12_19.1: %i32) { // CHECK:STDOUT: %T.loc12_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc12_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt)] -// CHECK:STDOUT: %U.loc12_19.2: i32 = bind_symbolic_name U, 1 [symbolic = %U.loc12_19.2 (constants.%U)] -// CHECK:STDOUT: %U.patt.loc12_19.2: i32 = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc12_19.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.loc12_19.2: %i32 = bind_symbolic_name U, 1 [symbolic = %U.loc12_19.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc12_19.2: %i32 = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc12_19.2 (constants.%U.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc12_29: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_29: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%.2 +// CHECK:STDOUT: .Self = constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -393,20 +399,22 @@ class E(U:! type) {} // CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %D.type: type = generic_class_type @D [template] // CHECK:STDOUT: %D.1: %D.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %T.2: i32 = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %T.patt.2: i32 = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %T.2: %i32 = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.2: %i32 = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] -// CHECK:STDOUT: %.1: %.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = class_type @.1, @.1(%T.2) [symbolic] -// CHECK:STDOUT: %.3: type = struct_type {} [template] -// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.2: %.type = struct_value () [template] +// CHECK:STDOUT: %.3: type = class_type @.1, @.1(%T.2) [symbolic] +// CHECK:STDOUT: %.4: type = struct_type {} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -425,15 +433,16 @@ class E(U:! type) {} // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_9.2 (constants.%T.1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.1] { -// CHECK:STDOUT: %T.patt.loc12_9.1: i32 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt.2)] -// CHECK:STDOUT: %T.param_patt: i32 = value_param_pattern %T.patt.loc12_9.1, runtime_param [symbolic = %T.patt.loc12_9.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { +// CHECK:STDOUT: %T.patt.loc12_9.1: %i32 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: %i32 = value_param_pattern %T.patt.loc12_9.1, runtime_param [symbolic = %T.patt.loc12_9.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32, %.loc12_13.1 [template = i32] -// CHECK:STDOUT: %T.param: i32 = value_param runtime_param -// CHECK:STDOUT: %T.loc12_9.1: i32 = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_9.2 (constants.%T.2)] +// CHECK:STDOUT: %.loc12_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_signed, %.loc12_13.2 [template = constants.%i32] +// CHECK:STDOUT: %T.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %T.loc12_9.1: %i32 = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_9.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -444,17 +453,17 @@ class E(U:! type) {} // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(%T.loc12_9.1: i32) { -// CHECK:STDOUT: %T.loc12_9.2: i32 = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T.2)] -// CHECK:STDOUT: %T.patt.loc12_9.2: i32 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt.2)] +// CHECK:STDOUT: generic class @.1(%T.loc12_9.1: %i32) { +// CHECK:STDOUT: %T.loc12_9.2: %i32 = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T.2)] +// CHECK:STDOUT: %T.patt.loc12_9.2: %i32 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc12_19: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_19: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%.2 +// CHECK:STDOUT: .Self = constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index f6cc4cae0883..4c9c90895923 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -125,16 +125,18 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %Outer.3: type = class_type @Outer, @Outer(%.3) [template] // CHECK:STDOUT: %Inner.type.2: type = generic_class_type @Inner, @Outer(%.3) [template] // CHECK:STDOUT: %Inner.3: %Inner.type.2 = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] -// CHECK:STDOUT: %Inner.4: type = class_type @Inner, @Inner(%.3, %.5) [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.4 [template] +// CHECK:STDOUT: %.5: type = struct_type {.a: %i32} [template] +// CHECK:STDOUT: %.6: type = ptr_type %.5 [template] +// CHECK:STDOUT: %Inner.4: type = class_type @Inner, @Inner(%.3, %.6) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -170,12 +172,13 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %Outer.loc18: type = class_type @Outer, @Outer(constants.%.3) [template = constants.%Outer.3] // CHECK:STDOUT: %.loc18_18: %Inner.type.2 = specific_constant @Outer.%Inner.decl, @Outer(constants.%.3) [template = constants.%Inner.3] // CHECK:STDOUT: %Inner.ref: %Inner.type.2 = name_ref Inner, %.loc18_18 [template = constants.%Inner.3] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_30.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc18_30.2: type = converted %int.make_type_32, %.loc18_30.1 [template = i32] -// CHECK:STDOUT: %.loc18_33: type = struct_type {.a: i32} [template = constants.%.4] -// CHECK:STDOUT: %.loc18_34: type = ptr_type %.4 [template = constants.%.5] -// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(constants.%.3, constants.%.5) [template = constants.%Inner.4] +// CHECK:STDOUT: %.loc18_30.1: Core.IntLiteral = int_value 32 [template = constants.%.4] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc18_30.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_30.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc18_30.3: type = converted %int.make_type_signed, %.loc18_30.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_33: type = struct_type {.a: %i32} [template = constants.%.5] +// CHECK:STDOUT: %.loc18_34: type = ptr_type %.5 [template = constants.%.6] +// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(constants.%.3, constants.%.6) [template = constants.%Inner.4] // CHECK:STDOUT: %w.var: ref %Inner.4 = var w // CHECK:STDOUT: %w: ref %Inner.4 = bind_name w, %w.var // CHECK:STDOUT: } @@ -250,9 +253,9 @@ var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDOUT: %Inner => constants.%Inner.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Inner(constants.%.3, constants.%.5) { -// CHECK:STDOUT: %U.loc5_15.2 => constants.%.5 -// CHECK:STDOUT: %U.patt.loc5_15.2 => constants.%.5 +// CHECK:STDOUT: specific @Inner(constants.%.3, constants.%.6) { +// CHECK:STDOUT: %U.loc5_15.2 => constants.%.6 +// CHECK:STDOUT: %U.patt.loc5_15.2 => constants.%.6 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index 4912008aa7c1..a4a550452222 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -56,15 +56,17 @@ fn Run() { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Field: type = class_type @Field [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = unbound_element_type %Field, i32 [template] -// CHECK:STDOUT: %.4: type = struct_type {.x: i32} [template] -// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.3 [template] +// CHECK:STDOUT: %.4: type = unbound_element_type %Field, %i32 [template] +// CHECK:STDOUT: %.5: type = struct_type {.x: %i32} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %ForwardDeclared: type = class_type @ForwardDeclared [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = ptr_type %ForwardDeclared [template] +// CHECK:STDOUT: %.7: type = ptr_type %ForwardDeclared [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] @@ -72,7 +74,7 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -102,11 +104,12 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Field { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_10.2: type = converted %int.make_type_32, %.loc8_10.1 [template = i32] -// CHECK:STDOUT: %.loc8_8: %.3 = field_decl x, element0 [template] -// CHECK:STDOUT: %.loc9: = complete_type_witness %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc8_10.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_10.3: type = converted %int.make_type_signed, %.loc8_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8: %.4 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc9: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Field @@ -123,14 +126,14 @@ fn Run() { // CHECK:STDOUT: %self: %ForwardDeclared = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %self.patt: %.6 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %.6 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %self.patt: %.7 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.7 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc15_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%ForwardDeclared [template = constants.%ForwardDeclared] -// CHECK:STDOUT: %.loc15_23: type = ptr_type %ForwardDeclared [template = constants.%.6] -// CHECK:STDOUT: %self.param: %.6 = value_param runtime_param0 -// CHECK:STDOUT: %self: %.6 = bind_name self, %self.param +// CHECK:STDOUT: %.loc15_23: type = ptr_type %ForwardDeclared [template = constants.%.7] +// CHECK:STDOUT: %self.param: %.7 = value_param runtime_param0 +// CHECK:STDOUT: %self: %.7 = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc16: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: @@ -144,7 +147,7 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self.param_patt: %ForwardDeclared](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr %self.param_patt: %.6](); +// CHECK:STDOUT: fn @G[addr %self.param_patt: %.7](); // CHECK:STDOUT: // CHECK:STDOUT: --- b.carbon // CHECK:STDOUT: @@ -156,35 +159,39 @@ fn Run() { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %struct.1: %Empty = struct_value () [template] // CHECK:STDOUT: %Field: type = class_type @Field [template] -// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.8: type = struct_type {.x: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.33: = bound_method %.7, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 1 [template] -// CHECK:STDOUT: %struct.2: %Field = struct_value (%.34) [template] -// CHECK:STDOUT: %.35: type = unbound_element_type %Field, i32 [template] -// CHECK:STDOUT: %.36: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.37: = bound_method %.36, %Convert.15 [template] -// CHECK:STDOUT: %.38: i32 = int_value 2 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.4 [template] +// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.9: type = struct_type {.x: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.4) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.29: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.30: = bound_method %.8, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.4) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 1 [template] +// CHECK:STDOUT: %struct.2: %Field = struct_value (%.32) [template] +// CHECK:STDOUT: %.33: type = unbound_element_type %Field, %i32 [template] +// CHECK:STDOUT: %.34: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.35: = bound_method %.34, %Convert.14 [template] +// CHECK:STDOUT: %.36: = specific_function %.35, @Convert.2(%.4) [template] +// CHECK:STDOUT: %.37: %i32 = int_value 2 [template] // CHECK:STDOUT: %ForwardDeclared.1: type = class_type @ForwardDeclared.1 [template] // CHECK:STDOUT: %struct.3: %ForwardDeclared.1 = struct_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.39: type = ptr_type %ForwardDeclared.1 [template] +// CHECK:STDOUT: %.38: type = ptr_type %ForwardDeclared.1 [template] // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] -// CHECK:STDOUT: %.40: type = ptr_type %Incomplete [template] +// CHECK:STDOUT: %.39: type = ptr_type %Incomplete [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+3, loaded [template = constants.%Empty] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+8, loaded [template = constants.%Field] -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, inst+26, loaded [template = constants.%ForwardDeclared.1] -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+49, loaded [template = constants.%Incomplete] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, inst+33, loaded [template = constants.%ForwardDeclared.1] +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+56, loaded [template = constants.%Incomplete] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.8 // CHECK:STDOUT: import Core//prelude @@ -192,13 +199,13 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+4, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+9, unloaded -// CHECK:STDOUT: %import_ref.7: %.35 = import_ref Main//a, inst+22, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.57 = import_ref Main//a, inst+27, unloaded -// CHECK:STDOUT: %import_ref.58: %F.type = import_ref Main//a, inst+34, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.59: %G.type = import_ref Main//a, inst+45, loaded [template = constants.%G] -// CHECK:STDOUT: %import_ref.60 = import_ref Main//a, inst+27, unloaded -// CHECK:STDOUT: %import_ref.61 = import_ref Main//a, inst+34, unloaded -// CHECK:STDOUT: %import_ref.62 = import_ref Main//a, inst+45, unloaded +// CHECK:STDOUT: %import_ref.7: %.33 = import_ref Main//a, inst+29, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.44 = import_ref Main//a, inst+34, unloaded +// CHECK:STDOUT: %import_ref.45: %F.type = import_ref Main//a, inst+41, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.46: %G.type = import_ref Main//a, inst+52, loaded [template = constants.%G] +// CHECK:STDOUT: %import_ref.47 = import_ref Main//a, inst+34, unloaded +// CHECK:STDOUT: %import_ref.48 = import_ref Main//a, inst+41, unloaded +// CHECK:STDOUT: %import_ref.49 = import_ref Main//a, inst+52, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -228,16 +235,16 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardDeclared.1 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.57 -// CHECK:STDOUT: .F = imports.%import_ref.58 -// CHECK:STDOUT: .G = imports.%import_ref.59 +// CHECK:STDOUT: .Self = imports.%import_ref.44 +// CHECK:STDOUT: .F = imports.%import_ref.45 +// CHECK:STDOUT: .G = imports.%import_ref.46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardDeclared.2 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.60 -// CHECK:STDOUT: .F = imports.%import_ref.61 -// CHECK:STDOUT: .G = imports.%import_ref.62 +// CHECK:STDOUT: .Self = imports.%import_ref.47 +// CHECK:STDOUT: .F = imports.%import_ref.48 +// CHECK:STDOUT: .G = imports.%import_ref.49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Incomplete; @@ -254,26 +261,28 @@ fn Run() { // CHECK:STDOUT: %Field.ref: type = name_ref Field, imports.%import_ref.2 [template = constants.%Field] // CHECK:STDOUT: %b.var: ref %Field = var b // CHECK:STDOUT: %b: ref %Field = bind_name b, %b.var -// CHECK:STDOUT: %.loc9_24: Core.IntLiteral = int_value 1 [template = constants.%.7] -// CHECK:STDOUT: %.loc9_25.1: %.8 = struct_literal (%.loc9_24) -// CHECK:STDOUT: %.loc9_25.2: %Convert.type.2 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_25.3: = bound_method %.loc9_24, %.loc9_25.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc9: init i32 = call %.loc9_25.3(%.loc9_24) [template = constants.%.34] -// CHECK:STDOUT: %.loc9_25.4: init i32 = converted %.loc9_24, %int.convert_checked.loc9 [template = constants.%.34] -// CHECK:STDOUT: %.loc9_25.5: ref i32 = class_element_access %b.var, element0 -// CHECK:STDOUT: %.loc9_25.6: init i32 = initialize_from %.loc9_25.4 to %.loc9_25.5 [template = constants.%.34] -// CHECK:STDOUT: %.loc9_25.7: init %Field = class_init (%.loc9_25.6), %b.var [template = constants.%struct.2] -// CHECK:STDOUT: %.loc9_26: init %Field = converted %.loc9_25.1, %.loc9_25.7 [template = constants.%struct.2] +// CHECK:STDOUT: %.loc9_24: Core.IntLiteral = int_value 1 [template = constants.%.8] +// CHECK:STDOUT: %.loc9_25.1: %.9 = struct_literal (%.loc9_24) +// CHECK:STDOUT: %.loc9_25.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_25.3: = bound_method %.loc9_24, %.loc9_25.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc9_25.4: = specific_function %.loc9_25.3, @Convert.2(constants.%.4) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %.loc9_25.4(%.loc9_24) [template = constants.%.32] +// CHECK:STDOUT: %.loc9_25.5: init %i32 = converted %.loc9_24, %int.convert_checked.loc9 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_25.6: ref %i32 = class_element_access %b.var, element0 +// CHECK:STDOUT: %.loc9_25.7: init %i32 = initialize_from %.loc9_25.5 to %.loc9_25.6 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_25.8: init %Field = class_init (%.loc9_25.7), %b.var [template = constants.%struct.2] +// CHECK:STDOUT: %.loc9_26: init %Field = converted %.loc9_25.1, %.loc9_25.8 [template = constants.%struct.2] // CHECK:STDOUT: assign %b.var, %.loc9_26 // CHECK:STDOUT: %b.ref: ref %Field = name_ref b, %b -// CHECK:STDOUT: %x.ref: %.35 = name_ref x, imports.%import_ref.7 [template = imports.%.1] -// CHECK:STDOUT: %.loc10_4: ref i32 = class_element_access %b.ref, element0 -// CHECK:STDOUT: %.loc10_9: Core.IntLiteral = int_value 2 [template = constants.%.36] -// CHECK:STDOUT: %.loc10_7.1: %Convert.type.2 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_7.2: = bound_method %.loc10_9, %.loc10_7.1 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc10: init i32 = call %.loc10_7.2(%.loc10_9) [template = constants.%.38] -// CHECK:STDOUT: %.loc10_7.3: init i32 = converted %.loc10_9, %int.convert_checked.loc10 [template = constants.%.38] -// CHECK:STDOUT: assign %.loc10_4, %.loc10_7.3 +// CHECK:STDOUT: %x.ref: %.33 = name_ref x, imports.%import_ref.7 [template = imports.%.1] +// CHECK:STDOUT: %.loc10_4: ref %i32 = class_element_access %b.ref, element0 +// CHECK:STDOUT: %.loc10_9: Core.IntLiteral = int_value 2 [template = constants.%.34] +// CHECK:STDOUT: %.loc10_7.1: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_7.2: = bound_method %.loc10_9, %.loc10_7.1 [template = constants.%.35] +// CHECK:STDOUT: %.loc10_7.3: = specific_function %.loc10_7.2, @Convert.2(constants.%.4) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc10: init %i32 = call %.loc10_7.3(%.loc10_9) [template = constants.%.37] +// CHECK:STDOUT: %.loc10_7.4: init %i32 = converted %.loc10_9, %int.convert_checked.loc10 [template = constants.%.37] +// CHECK:STDOUT: assign %.loc10_4, %.loc10_7.4 // CHECK:STDOUT: %ForwardDeclared.ref.loc12: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%ForwardDeclared.1] // CHECK:STDOUT: %c.var: ref %ForwardDeclared.1 = var c // CHECK:STDOUT: %c: ref %ForwardDeclared.1 = bind_name c, %c.var @@ -282,30 +291,30 @@ fn Run() { // CHECK:STDOUT: %.loc12_30: init %ForwardDeclared.1 = converted %.loc12_29.1, %.loc12_29.2 [template = constants.%struct.3] // CHECK:STDOUT: assign %c.var, %.loc12_30 // CHECK:STDOUT: %c.ref.loc13: ref %ForwardDeclared.1 = name_ref c, %c -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.58 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.45 [template = constants.%F] // CHECK:STDOUT: %.loc13_4: = bound_method %c.ref.loc13, %F.ref // CHECK:STDOUT: %.loc13_3: %ForwardDeclared.1 = bind_value %c.ref.loc13 // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %.loc13_4(%.loc13_3) // CHECK:STDOUT: %c.ref.loc14: ref %ForwardDeclared.1 = name_ref c, %c -// CHECK:STDOUT: %G.ref: %G.type = name_ref G, imports.%import_ref.59 [template = constants.%G] +// CHECK:STDOUT: %G.ref: %G.type = name_ref G, imports.%import_ref.46 [template = constants.%G] // CHECK:STDOUT: %.loc14_4: = bound_method %c.ref.loc14, %G.ref -// CHECK:STDOUT: %.loc14_3: %.39 = addr_of %c.ref.loc14 +// CHECK:STDOUT: %.loc14_3: %.38 = addr_of %c.ref.loc14 // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %.loc14_4(%.loc14_3) // CHECK:STDOUT: %ForwardDeclared.ref.loc16: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%ForwardDeclared.1] -// CHECK:STDOUT: %.loc16_25: type = ptr_type %ForwardDeclared.1 [template = constants.%.39] -// CHECK:STDOUT: %d.var: ref %.39 = var d -// CHECK:STDOUT: %d: ref %.39 = bind_name d, %d.var +// CHECK:STDOUT: %.loc16_25: type = ptr_type %ForwardDeclared.1 [template = constants.%.38] +// CHECK:STDOUT: %d.var: ref %.38 = var d +// CHECK:STDOUT: %d: ref %.38 = bind_name d, %d.var // CHECK:STDOUT: %c.ref.loc16: ref %ForwardDeclared.1 = name_ref c, %c -// CHECK:STDOUT: %.loc16_29: %.39 = addr_of %c.ref.loc16 +// CHECK:STDOUT: %.loc16_29: %.38 = addr_of %c.ref.loc16 // CHECK:STDOUT: assign %d.var, %.loc16_29 // CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, imports.%import_ref.4 [template = constants.%Incomplete] -// CHECK:STDOUT: %.loc18: type = ptr_type %Incomplete [template = constants.%.40] -// CHECK:STDOUT: %e.var: ref %.40 = var e -// CHECK:STDOUT: %e: ref %.40 = bind_name e, %e.var +// CHECK:STDOUT: %.loc18: type = ptr_type %Incomplete [template = constants.%.39] +// CHECK:STDOUT: %e.var: ref %.39 = var e +// CHECK:STDOUT: %e: ref %.39 = bind_name e, %e.var // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self.param_patt: %ForwardDeclared.1](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr .inst+461: %.39](); +// CHECK:STDOUT: fn @G[addr .inst+437: %.38](); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index 075e349fa1c4..dcf412bd2e6e 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -44,20 +44,22 @@ fn Run() { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %Unused.type: type = fn_type @Unused [template] // CHECK:STDOUT: %Unused: %Unused.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Base, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.x: i32, .unused: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Base, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.x: %i32, .unused: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Child: type = class_type @Child [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Child, %Base [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %Base} [template] -// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Child, %Base [template] +// CHECK:STDOUT: %.7: type = struct_type {.base: %Base} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -91,15 +93,17 @@ fn Run() { // CHECK:STDOUT: %self.param: %Base = value_param runtime_param0 // CHECK:STDOUT: %self: %Base = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] -// CHECK:STDOUT: %.loc8_10.2: type = converted %int.make_type_32.loc8, %.loc8_10.1 [template = i32] -// CHECK:STDOUT: %.loc8_8: %.1 = field_decl x, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_15.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] -// CHECK:STDOUT: %.loc9_15.2: type = converted %int.make_type_32.loc9, %.loc9_15.1 [template = i32] -// CHECK:STDOUT: %.loc9_13: %.1 = field_decl unused, element1 [template] -// CHECK:STDOUT: %.loc10: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc8_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_10.2: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_10.3: type = converted %int.make_type_signed.loc8, %.loc8_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8: %.2 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc9_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%.loc9_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_15.2: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_15.3: type = converted %int.make_type_signed.loc9, %.loc9_15.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_13: %.2 = field_decl unused, element1 [template] +// CHECK:STDOUT: %.loc10: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -111,8 +115,8 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: class @Child { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc13: %.5 = base_decl %Base, element0 [template] -// CHECK:STDOUT: %.loc14: = complete_type_witness %.6 [template = constants.%.7] +// CHECK:STDOUT: %.loc13: %.6 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Child @@ -132,31 +136,36 @@ fn Run() { // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: %Child: type = class_type @Child [template] // CHECK:STDOUT: %Base: type = class_type @Base [template] -// CHECK:STDOUT: %.9: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.10: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.11: type = struct_type {.x: Core.IntLiteral, .unused: Core.IntLiteral} [template] -// CHECK:STDOUT: %.12: type = struct_type {.base: %.11} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.36: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.37: = bound_method %.9, %Convert.15 [template] -// CHECK:STDOUT: %.38: i32 = int_value 0 [template] -// CHECK:STDOUT: %.39: = bound_method %.10, %Convert.15 [template] -// CHECK:STDOUT: %.40: i32 = int_value 1 [template] -// CHECK:STDOUT: %struct.1: %Base = struct_value (%.38, %.40) [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.10: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.11: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.12: type = struct_type {.x: Core.IntLiteral, .unused: Core.IntLiteral} [template] +// CHECK:STDOUT: %.13: type = struct_type {.base: %.12} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.33: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.34: = bound_method %.10, %Convert.14 [template] +// CHECK:STDOUT: %.35: = specific_function %.34, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.36: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.37: = bound_method %.11, %Convert.14 [template] +// CHECK:STDOUT: %.38: = specific_function %.37, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.39: %i32 = int_value 1 [template] +// CHECK:STDOUT: %struct.1: %Base = struct_value (%.36, %.39) [template] // CHECK:STDOUT: %struct.2: %Child = struct_value (%struct.1) [template] -// CHECK:STDOUT: %.41: type = unbound_element_type %Base, i32 [template] -// CHECK:STDOUT: %.42: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.43: = bound_method %.42, %Convert.15 [template] -// CHECK:STDOUT: %.44: i32 = int_value 2 [template] +// CHECK:STDOUT: %.40: type = unbound_element_type %Base, %i32 [template] +// CHECK:STDOUT: %.41: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.42: = bound_method %.41, %Convert.14 [template] +// CHECK:STDOUT: %.43: = specific_function %.42, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.44: %i32 = int_value 2 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//a, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+41, loaded [template = constants.%Child] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+49, loaded [template = constants.%Child] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.10 // CHECK:STDOUT: import Core//prelude @@ -165,10 +174,10 @@ fn Run() { // CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded // CHECK:STDOUT: %import_ref.4: %F.type = import_ref Main//a, inst+10, loaded [template = constants.%F] // CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+19, unloaded -// CHECK:STDOUT: %import_ref.6: %.41 = import_ref Main//a, inst+33, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//a, inst+37, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst+42, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//a, inst+46, unloaded +// CHECK:STDOUT: %import_ref.6: %.40 = import_ref Main//a, inst+40, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//a, inst+45, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst+50, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//a, inst+54, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -204,39 +213,42 @@ fn Run() { // CHECK:STDOUT: %Child.ref: type = name_ref Child, imports.%import_ref.2 [template = constants.%Child] // CHECK:STDOUT: %a.var: ref %Child = var a // CHECK:STDOUT: %a: ref %Child = bind_name a, %a.var -// CHECK:STDOUT: %.loc7_33: Core.IntLiteral = int_value 0 [template = constants.%.9] -// CHECK:STDOUT: %.loc7_46: Core.IntLiteral = int_value 1 [template = constants.%.10] -// CHECK:STDOUT: %.loc7_47.1: %.11 = struct_literal (%.loc7_33, %.loc7_46) -// CHECK:STDOUT: %.loc7_48.1: %.12 = struct_literal (%.loc7_47.1) -// CHECK:STDOUT: %.loc7_47.2: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_47.3: = bound_method %.loc7_33, %.loc7_47.2 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc7_47.1: init i32 = call %.loc7_47.3(%.loc7_33) [template = constants.%.38] -// CHECK:STDOUT: %.loc7_47.4: init i32 = converted %.loc7_33, %int.convert_checked.loc7_47.1 [template = constants.%.38] +// CHECK:STDOUT: %.loc7_33: Core.IntLiteral = int_value 0 [template = constants.%.10] +// CHECK:STDOUT: %.loc7_46: Core.IntLiteral = int_value 1 [template = constants.%.11] +// CHECK:STDOUT: %.loc7_47.1: %.12 = struct_literal (%.loc7_33, %.loc7_46) +// CHECK:STDOUT: %.loc7_48.1: %.13 = struct_literal (%.loc7_47.1) +// CHECK:STDOUT: %.loc7_47.2: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_47.3: = bound_method %.loc7_33, %.loc7_47.2 [template = constants.%.34] +// CHECK:STDOUT: %.loc7_47.4: = specific_function %.loc7_47.3, @Convert.2(constants.%.1) [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc7_47.1: init %i32 = call %.loc7_47.4(%.loc7_33) [template = constants.%.36] +// CHECK:STDOUT: %.loc7_47.5: init %i32 = converted %.loc7_33, %int.convert_checked.loc7_47.1 [template = constants.%.36] // CHECK:STDOUT: %.loc7_48.2: ref %Base = class_element_access %a.var, element0 -// CHECK:STDOUT: %.loc7_47.5: ref i32 = class_element_access %.loc7_48.2, element0 -// CHECK:STDOUT: %.loc7_47.6: init i32 = initialize_from %.loc7_47.4 to %.loc7_47.5 [template = constants.%.38] -// CHECK:STDOUT: %.loc7_47.7: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_47.8: = bound_method %.loc7_46, %.loc7_47.7 [template = constants.%.39] -// CHECK:STDOUT: %int.convert_checked.loc7_47.2: init i32 = call %.loc7_47.8(%.loc7_46) [template = constants.%.40] -// CHECK:STDOUT: %.loc7_47.9: init i32 = converted %.loc7_46, %int.convert_checked.loc7_47.2 [template = constants.%.40] -// CHECK:STDOUT: %.loc7_47.10: ref i32 = class_element_access %.loc7_48.2, element1 -// CHECK:STDOUT: %.loc7_47.11: init i32 = initialize_from %.loc7_47.9 to %.loc7_47.10 [template = constants.%.40] -// CHECK:STDOUT: %.loc7_47.12: init %Base = class_init (%.loc7_47.6, %.loc7_47.11), %.loc7_48.2 [template = constants.%struct.1] -// CHECK:STDOUT: %.loc7_48.3: init %Base = converted %.loc7_47.1, %.loc7_47.12 [template = constants.%struct.1] +// CHECK:STDOUT: %.loc7_47.6: ref %i32 = class_element_access %.loc7_48.2, element0 +// CHECK:STDOUT: %.loc7_47.7: init %i32 = initialize_from %.loc7_47.5 to %.loc7_47.6 [template = constants.%.36] +// CHECK:STDOUT: %.loc7_47.8: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_47.9: = bound_method %.loc7_46, %.loc7_47.8 [template = constants.%.37] +// CHECK:STDOUT: %.loc7_47.10: = specific_function %.loc7_47.9, @Convert.2(constants.%.1) [template = constants.%.38] +// CHECK:STDOUT: %int.convert_checked.loc7_47.2: init %i32 = call %.loc7_47.10(%.loc7_46) [template = constants.%.39] +// CHECK:STDOUT: %.loc7_47.11: init %i32 = converted %.loc7_46, %int.convert_checked.loc7_47.2 [template = constants.%.39] +// CHECK:STDOUT: %.loc7_47.12: ref %i32 = class_element_access %.loc7_48.2, element1 +// CHECK:STDOUT: %.loc7_47.13: init %i32 = initialize_from %.loc7_47.11 to %.loc7_47.12 [template = constants.%.39] +// CHECK:STDOUT: %.loc7_47.14: init %Base = class_init (%.loc7_47.7, %.loc7_47.13), %.loc7_48.2 [template = constants.%struct.1] +// CHECK:STDOUT: %.loc7_48.3: init %Base = converted %.loc7_47.1, %.loc7_47.14 [template = constants.%struct.1] // CHECK:STDOUT: %.loc7_48.4: init %Child = class_init (%.loc7_48.3), %a.var [template = constants.%struct.2] // CHECK:STDOUT: %.loc7_49: init %Child = converted %.loc7_48.1, %.loc7_48.4 [template = constants.%struct.2] // CHECK:STDOUT: assign %a.var, %.loc7_49 // CHECK:STDOUT: %a.ref.loc8: ref %Child = name_ref a, %a -// CHECK:STDOUT: %x.ref: %.41 = name_ref x, imports.%import_ref.6 [template = imports.%.1] +// CHECK:STDOUT: %x.ref: %.40 = name_ref x, imports.%import_ref.6 [template = imports.%.1] // CHECK:STDOUT: %.loc8_4.1: ref %Base = class_element_access %a.ref.loc8, element0 // CHECK:STDOUT: %.loc8_4.2: ref %Base = converted %a.ref.loc8, %.loc8_4.1 -// CHECK:STDOUT: %.loc8_4.3: ref i32 = class_element_access %.loc8_4.2, element0 -// CHECK:STDOUT: %.loc8_9: Core.IntLiteral = int_value 2 [template = constants.%.42] -// CHECK:STDOUT: %.loc8_7.1: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_7.2: = bound_method %.loc8_9, %.loc8_7.1 [template = constants.%.43] -// CHECK:STDOUT: %int.convert_checked.loc8: init i32 = call %.loc8_7.2(%.loc8_9) [template = constants.%.44] -// CHECK:STDOUT: %.loc8_7.3: init i32 = converted %.loc8_9, %int.convert_checked.loc8 [template = constants.%.44] -// CHECK:STDOUT: assign %.loc8_4.3, %.loc8_7.3 +// CHECK:STDOUT: %.loc8_4.3: ref %i32 = class_element_access %.loc8_4.2, element0 +// CHECK:STDOUT: %.loc8_9: Core.IntLiteral = int_value 2 [template = constants.%.41] +// CHECK:STDOUT: %.loc8_7.1: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_7.2: = bound_method %.loc8_9, %.loc8_7.1 [template = constants.%.42] +// CHECK:STDOUT: %.loc8_7.3: = specific_function %.loc8_7.2, @Convert.2(constants.%.1) [template = constants.%.43] +// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %.loc8_7.3(%.loc8_9) [template = constants.%.44] +// CHECK:STDOUT: %.loc8_7.4: init %i32 = converted %.loc8_9, %int.convert_checked.loc8 [template = constants.%.44] +// CHECK:STDOUT: assign %.loc8_4.3, %.loc8_7.4 // CHECK:STDOUT: %a.ref.loc9: ref %Child = name_ref a, %a // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] // CHECK:STDOUT: %.loc9_4: = bound_method %a.ref.loc9, %F.ref diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index e4f374c27435..63ebbd3d08ae 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -230,24 +230,26 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Shape: type = class_type @Shape [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Shape, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.x: i32, .y: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Shape, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.x: %i32, .y: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Circle: type = class_type @Circle [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Circle, %Shape [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Circle, %Shape [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %GetPosition.type: type = fn_type @GetPosition [template] // CHECK:STDOUT: %GetPosition: %GetPosition.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %Shape} [template] -// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] +// CHECK:STDOUT: %.7: type = struct_type {.base: %Shape} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -265,15 +267,17 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Shape { -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_20.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_20.2: type = converted %int.make_type_32.loc5, %.loc5_20.1 [template = i32] -// CHECK:STDOUT: %.loc5_18: %.1 = field_decl x, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_20.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_20.2: type = converted %int.make_type_32.loc6, %.loc6_20.1 [template = i32] -// CHECK:STDOUT: %.loc6_18: %.1 = field_decl y, element1 [template] -// CHECK:STDOUT: %.loc7: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_20.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_20.3: type = converted %int.make_type_signed.loc5, %.loc5_20.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_18: %.2 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc6_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_20.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_20.3: type = converted %int.make_type_signed.loc6, %.loc6_20.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_18: %.2 = field_decl y, element1 [template] +// CHECK:STDOUT: %.loc7: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Shape @@ -283,7 +287,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @Circle { // CHECK:STDOUT: %Shape.ref: type = name_ref Shape, file.%Shape.decl [template = constants.%Shape] -// CHECK:STDOUT: %.loc10: %.5 = base_decl %Shape, element0 [template] +// CHECK:STDOUT: %.loc10: %.6 = base_decl %Shape, element0 [template] // CHECK:STDOUT: %GetPosition.decl: %GetPosition.type = fn_decl @GetPosition [template = constants.%GetPosition] { // CHECK:STDOUT: %self.patt: %Circle = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Circle = value_param_pattern %self.patt, runtime_param0 @@ -291,20 +295,22 @@ class B { // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] -// CHECK:STDOUT: %int.make_type_32.loc12_36: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc12_41: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_44.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc12_36, %int.make_type_32.loc12_41) -// CHECK:STDOUT: %.loc12_44.2: type = value_of_initializer %int.make_type_32.loc12_36 [template = i32] -// CHECK:STDOUT: %.loc12_44.3: type = converted %int.make_type_32.loc12_36, %.loc12_44.2 [template = i32] -// CHECK:STDOUT: %.loc12_44.4: type = value_of_initializer %int.make_type_32.loc12_41 [template = i32] -// CHECK:STDOUT: %.loc12_44.5: type = converted %int.make_type_32.loc12_41, %.loc12_44.4 [template = i32] +// CHECK:STDOUT: %.loc12_36: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_36: init type = call constants.%Int(%.loc12_36) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_41: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_41: init type = call constants.%Int(%.loc12_41) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_44.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc12_36, %int.make_type_signed.loc12_41) +// CHECK:STDOUT: %.loc12_44.2: type = value_of_initializer %int.make_type_signed.loc12_36 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_44.3: type = converted %int.make_type_signed.loc12_36, %.loc12_44.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_44.4: type = value_of_initializer %int.make_type_signed.loc12_41 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_44.5: type = converted %int.make_type_signed.loc12_41, %.loc12_44.4 [template = constants.%i32] // CHECK:STDOUT: %.loc12_44.6: type = converted %.loc12_44.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %self.param: %Circle = value_param runtime_param0 // CHECK:STDOUT: %self: %Circle = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15: = complete_type_witness %.6 [template = constants.%.7] +// CHECK:STDOUT: %.loc15: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Circle @@ -316,22 +322,22 @@ class B { // CHECK:STDOUT: fn @GetPosition[%self.param_patt: %Circle]() -> %return: %tuple.type.2 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref.loc13_13: %Circle = name_ref self, %self -// CHECK:STDOUT: %x.ref: %.1 = name_ref x, @Shape.%.loc5_18 [template = @Shape.%.loc5_18] +// CHECK:STDOUT: %x.ref: %.2 = name_ref x, @Shape.%.loc5_18 [template = @Shape.%.loc5_18] // CHECK:STDOUT: %.loc13_17.1: ref %Shape = class_element_access %self.ref.loc13_13, element0 // CHECK:STDOUT: %.loc13_17.2: ref %Shape = converted %self.ref.loc13_13, %.loc13_17.1 -// CHECK:STDOUT: %.loc13_17.3: ref i32 = class_element_access %.loc13_17.2, element0 +// CHECK:STDOUT: %.loc13_17.3: ref %i32 = class_element_access %.loc13_17.2, element0 // CHECK:STDOUT: %self.ref.loc13_21: %Circle = name_ref self, %self -// CHECK:STDOUT: %y.ref: %.1 = name_ref y, @Shape.%.loc6_18 [template = @Shape.%.loc6_18] +// CHECK:STDOUT: %y.ref: %.2 = name_ref y, @Shape.%.loc6_18 [template = @Shape.%.loc6_18] // CHECK:STDOUT: %.loc13_25.1: ref %Shape = class_element_access %self.ref.loc13_21, element0 // CHECK:STDOUT: %.loc13_25.2: ref %Shape = converted %self.ref.loc13_21, %.loc13_25.1 -// CHECK:STDOUT: %.loc13_25.3: ref i32 = class_element_access %.loc13_25.2, element1 +// CHECK:STDOUT: %.loc13_25.3: ref %i32 = class_element_access %.loc13_25.2, element1 // CHECK:STDOUT: %.loc13_27.1: %tuple.type.2 = tuple_literal (%.loc13_17.3, %.loc13_25.3) -// CHECK:STDOUT: %.loc13_17.4: i32 = bind_value %.loc13_17.3 -// CHECK:STDOUT: %.loc13_27.2: ref i32 = tuple_access %return, element0 -// CHECK:STDOUT: %.loc13_27.3: init i32 = initialize_from %.loc13_17.4 to %.loc13_27.2 -// CHECK:STDOUT: %.loc13_25.4: i32 = bind_value %.loc13_25.3 -// CHECK:STDOUT: %.loc13_27.4: ref i32 = tuple_access %return, element1 -// CHECK:STDOUT: %.loc13_27.5: init i32 = initialize_from %.loc13_25.4 to %.loc13_27.4 +// CHECK:STDOUT: %.loc13_17.4: %i32 = bind_value %.loc13_17.3 +// CHECK:STDOUT: %.loc13_27.2: ref %i32 = tuple_access %return, element0 +// CHECK:STDOUT: %.loc13_27.3: init %i32 = initialize_from %.loc13_17.4 to %.loc13_27.2 +// CHECK:STDOUT: %.loc13_25.4: %i32 = bind_value %.loc13_25.3 +// CHECK:STDOUT: %.loc13_27.4: ref %i32 = tuple_access %return, element1 +// CHECK:STDOUT: %.loc13_27.5: init %i32 = initialize_from %.loc13_25.4 to %.loc13_27.4 // CHECK:STDOUT: %.loc13_27.6: init %tuple.type.2 = tuple_init (%.loc13_27.3, %.loc13_27.5) to %return // CHECK:STDOUT: %.loc13_28: init %tuple.type.2 = converted %.loc13_27.1, %.loc13_27.6 // CHECK:STDOUT: return %.loc13_28 to %return @@ -348,24 +354,26 @@ class B { // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %.4: type = unbound_element_type %B, %A [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.5 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.5: type = struct_type {.base: %A} [template] -// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] +// CHECK:STDOUT: %.6: type = struct_type {.base: %A} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %.9: type = unbound_element_type %C, %B [template] +// CHECK:STDOUT: %.10: type = unbound_element_type %C, %B [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = struct_type {.base: %B} [template] -// CHECK:STDOUT: %.11: = complete_type_witness %.10 [template] +// CHECK:STDOUT: %.11: type = struct_type {.base: %B} [template] +// CHECK:STDOUT: %.12: = complete_type_witness %.11 [template] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -397,16 +405,17 @@ class B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc9: %.4 = base_decl %A, element0 [template] // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_21.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc10_21.2: type = converted %int.make_type_32, %.loc10_21.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc10_21.1: Core.IntLiteral = int_value 32 [template = constants.%.5] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc10_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_21.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc10_21.3: type = converted %int.make_type_signed, %.loc10_21.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11: = complete_type_witness %.5 [template = constants.%.6] +// CHECK:STDOUT: %.loc11: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -417,7 +426,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc14: %.9 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc14: %.10 = base_decl %B, element0 [template] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 @@ -432,7 +441,7 @@ class B { // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param1 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc16: = complete_type_witness %.10 [template = constants.%.11] +// CHECK:STDOUT: %.loc16: = complete_type_witness %.11 [template = constants.%.12] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -443,7 +452,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.1(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2() -> i32; +// CHECK:STDOUT: fn @F.2() -> %i32; // CHECK:STDOUT: // CHECK:STDOUT: fn @G[%self.param_patt: %C]() -> %empty_tuple.type { // CHECK:STDOUT: !entry: @@ -461,32 +470,35 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 5 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 5 [template] // CHECK:STDOUT: %SomeProtectedFunction.type: type = fn_type @SomeProtectedFunction [template] // CHECK:STDOUT: %SomeProtectedFunction: %SomeProtectedFunction.type = struct_value () [template] -// CHECK:STDOUT: %.28: type = struct_type {} [template] -// CHECK:STDOUT: %.29: = complete_type_witness %.28 [template] +// CHECK:STDOUT: %.26: type = struct_type {} [template] +// CHECK:STDOUT: %.27: = complete_type_witness %.26 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.31: type = unbound_element_type %B, %A [template] +// CHECK:STDOUT: %.29: type = unbound_element_type %B, %A [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] -// CHECK:STDOUT: %.32: type = struct_type {.base: %A} [template] -// CHECK:STDOUT: %.33: = complete_type_witness %.32 [template] +// CHECK:STDOUT: %.30: type = struct_type {.base: %A} [template] +// CHECK:STDOUT: %.31: = complete_type_witness %.30 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -505,27 +517,30 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_32.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc5_32.2: type = converted %int.make_type_32, %.loc5_32.1 [template = i32] -// CHECK:STDOUT: %.loc5_38: Core.IntLiteral = int_value 5 [template = constants.%.1] -// CHECK:STDOUT: %.loc5_39.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc5_39.2: = bound_method %.loc5_38, %.loc5_39.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc5_39.2(%.loc5_38) [template = constants.%.27] -// CHECK:STDOUT: %.loc5_39.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc5_39.4: i32 = converted %.loc5_38, %.loc5_39.3 [template = constants.%.27] -// CHECK:STDOUT: %SOME_CONSTANT: i32 = bind_name SOME_CONSTANT, %.loc5_39.4 +// CHECK:STDOUT: %.loc5_32.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc5_32.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_32.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc5_32.3: type = converted %int.make_type_signed, %.loc5_32.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_38: Core.IntLiteral = int_value 5 [template = constants.%.2] +// CHECK:STDOUT: %.loc5_39.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc5_39.2: = bound_method %.loc5_38, %.loc5_39.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc5_39.3: = specific_function %.loc5_39.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc5_39.3(%.loc5_38) [template = constants.%.25] +// CHECK:STDOUT: %.loc5_39.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc5_39.5: %i32 = converted %.loc5_38, %.loc5_39.4 [template = constants.%.25] +// CHECK:STDOUT: %SOME_CONSTANT: %i32 = bind_name SOME_CONSTANT, %.loc5_39.5 // CHECK:STDOUT: %SomeProtectedFunction.decl: %SomeProtectedFunction.type = fn_decl @SomeProtectedFunction [template = constants.%SomeProtectedFunction] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_43.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc6_43.2: type = converted %int.make_type_32, %.loc6_43.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc6_43.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc6_43.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_43.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc6_43.3: type = converted %int.make_type_signed, %.loc6_43.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc9: = complete_type_witness %.28 [template = constants.%.29] +// CHECK:STDOUT: %.loc9: = complete_type_witness %.26 [template = constants.%.27] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -535,28 +550,30 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc12: %.31 = base_decl %A, element0 [template] +// CHECK:STDOUT: %.loc12: %.29 = base_decl %A, element0 [template] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32, %.loc14_13.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc14_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_13.3: type = converted %int.make_type_signed, %.loc14_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc18_13.2: type = converted %int.make_type_32, %.loc18_13.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc18_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc18_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc18_13.3: type = converted %int.make_type_signed, %.loc18_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc21: = complete_type_witness %.32 [template = constants.%.33] +// CHECK:STDOUT: %.loc21: = complete_type_witness %.30 [template = constants.%.31] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -566,31 +583,32 @@ class B { // CHECK:STDOUT: extend %A.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SomeProtectedFunction() -> i32 { +// CHECK:STDOUT: fn @SomeProtectedFunction() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc7_12: Core.IntLiteral = int_value 5 [template = constants.%.1] -// CHECK:STDOUT: %.loc7_13.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_13.2: = bound_method %.loc7_12, %.loc7_13.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc7_13.2(%.loc7_12) [template = constants.%.27] -// CHECK:STDOUT: %.loc7_13.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc7_13.4: i32 = converted %.loc7_12, %.loc7_13.3 [template = constants.%.27] -// CHECK:STDOUT: return %.loc7_13.4 +// CHECK:STDOUT: %.loc7_12: Core.IntLiteral = int_value 5 [template = constants.%.2] +// CHECK:STDOUT: %.loc7_13.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_13.2: = bound_method %.loc7_12, %.loc7_13.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc7_13.3: = specific_function %.loc7_13.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc7_13.3(%.loc7_12) [template = constants.%.25] +// CHECK:STDOUT: %.loc7_13.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc7_13.5: %i32 = converted %.loc7_12, %.loc7_13.4 [template = constants.%.25] +// CHECK:STDOUT: return %.loc7_13.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> i32 { +// CHECK:STDOUT: fn @G() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %SOME_CONSTANT.ref: i32 = name_ref SOME_CONSTANT, @A.%SOME_CONSTANT +// CHECK:STDOUT: %SOME_CONSTANT.ref: %i32 = name_ref SOME_CONSTANT, @A.%SOME_CONSTANT // CHECK:STDOUT: return %SOME_CONSTANT.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @H() -> i32 { +// CHECK:STDOUT: fn @H() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %SomeProtectedFunction.ref: %SomeProtectedFunction.type = name_ref SomeProtectedFunction, @A.%SomeProtectedFunction.decl [template = constants.%SomeProtectedFunction] -// CHECK:STDOUT: %SomeProtectedFunction.call: init i32 = call %SomeProtectedFunction.ref() -// CHECK:STDOUT: %.loc19_37.1: i32 = value_of_initializer %SomeProtectedFunction.call -// CHECK:STDOUT: %.loc19_37.2: i32 = converted %SomeProtectedFunction.call, %.loc19_37.1 +// CHECK:STDOUT: %SomeProtectedFunction.call: init %i32 = call %SomeProtectedFunction.ref() +// CHECK:STDOUT: %.loc19_37.1: %i32 = value_of_initializer %SomeProtectedFunction.call +// CHECK:STDOUT: %.loc19_37.2: %i32 = converted %SomeProtectedFunction.call, %.loc19_37.1 // CHECK:STDOUT: return %.loc19_37.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -598,22 +616,24 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Shape: type = class_type @Shape [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Shape, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.y: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Shape, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.y: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Square: type = class_type @Square [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Square, %Shape [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Square, %Shape [template] // CHECK:STDOUT: %GetPosition.type: type = fn_type @GetPosition [template] // CHECK:STDOUT: %GetPosition: %GetPosition.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %Shape} [template] -// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] +// CHECK:STDOUT: %.7: type = struct_type {.base: %Shape} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -631,11 +651,12 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Shape { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc5_18.2: type = converted %int.make_type_32, %.loc5_18.1 [template = i32] -// CHECK:STDOUT: %.loc5_16: %.1 = field_decl y, element0 [template] -// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc5_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_18.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc5_18.3: type = converted %int.make_type_signed, %.loc5_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_16: %.2 = field_decl y, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Shape @@ -644,23 +665,24 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @Square { // CHECK:STDOUT: %Shape.ref: type = name_ref Shape, file.%Shape.decl [template = constants.%Shape] -// CHECK:STDOUT: %.loc9: %.5 = base_decl %Shape, element0 [template] +// CHECK:STDOUT: %.loc9: %.6 = base_decl %Shape, element0 [template] // CHECK:STDOUT: %GetPosition.decl: %GetPosition.type = fn_decl @GetPosition [template = constants.%GetPosition] { // CHECK:STDOUT: %self.patt: %Square = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Square = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Square [template = constants.%Square] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_35.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_35.2: type = converted %int.make_type_32, %.loc11_35.1 [template = i32] +// CHECK:STDOUT: %.loc11_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_35.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_35.3: type = converted %int.make_type_signed, %.loc11_35.2 [template = constants.%i32] // CHECK:STDOUT: %self.param: %Square = value_param runtime_param0 // CHECK:STDOUT: %self: %Square = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc21: = complete_type_witness %.6 [template = constants.%.7] +// CHECK:STDOUT: %.loc21: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Square @@ -669,7 +691,7 @@ class B { // CHECK:STDOUT: extend %Shape.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @GetPosition[%self.param_patt: %Square]() -> i32 { +// CHECK:STDOUT: fn @GetPosition[%self.param_patt: %Square]() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Square = name_ref self, %self // CHECK:STDOUT: %y.ref: = name_ref y, [template = ] @@ -924,31 +946,34 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 5 [template] -// CHECK:STDOUT: %.28: type = struct_type {} [template] -// CHECK:STDOUT: %.29: = complete_type_witness %.28 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 5 [template] +// CHECK:STDOUT: %.26: type = struct_type {} [template] +// CHECK:STDOUT: %.27: = complete_type_witness %.26 [template] // CHECK:STDOUT: %Internal: type = class_type @Internal [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.31: type = unbound_element_type %B, %Internal [template] +// CHECK:STDOUT: %.29: type = unbound_element_type %B, %Internal [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %SomeFunc.type: type = fn_type @SomeFunc [template] // CHECK:STDOUT: %SomeFunc: %SomeFunc.type = struct_value () [template] -// CHECK:STDOUT: %.32: type = struct_type {.internal: %Internal} [template] -// CHECK:STDOUT: %.33: = complete_type_witness %.32 [template] +// CHECK:STDOUT: %.30: type = struct_type {.internal: %Internal} [template] +// CHECK:STDOUT: %.31: = complete_type_witness %.30 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -969,27 +994,31 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_42.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_42.2: type = converted %int.make_type_32.loc5, %.loc5_42.1 [template = i32] -// CHECK:STDOUT: %.loc5_48: Core.IntLiteral = int_value 5 [template = constants.%.1] -// CHECK:STDOUT: %.loc5_49.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc5_49.2: = bound_method %.loc5_48, %.loc5_49.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc5: init i32 = call %.loc5_49.2(%.loc5_48) [template = constants.%.27] -// CHECK:STDOUT: %.loc5_49.3: i32 = value_of_initializer %int.convert_checked.loc5 [template = constants.%.27] -// CHECK:STDOUT: %.loc5_49.4: i32 = converted %.loc5_48, %.loc5_49.3 [template = constants.%.27] -// CHECK:STDOUT: %SOME_PROTECTED_CONSTANT: i32 = bind_name SOME_PROTECTED_CONSTANT, %.loc5_49.4 -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_38.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_38.2: type = converted %int.make_type_32.loc6, %.loc6_38.1 [template = i32] -// CHECK:STDOUT: %.loc6_44: Core.IntLiteral = int_value 5 [template = constants.%.1] -// CHECK:STDOUT: %.loc6_45.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_45.2: = bound_method %.loc6_44, %.loc6_45.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc6: init i32 = call %.loc6_45.2(%.loc6_44) [template = constants.%.27] -// CHECK:STDOUT: %.loc6_45.3: i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%.27] -// CHECK:STDOUT: %.loc6_45.4: i32 = converted %.loc6_44, %.loc6_45.3 [template = constants.%.27] -// CHECK:STDOUT: %SOME_PRIVATE_CONSTANT: i32 = bind_name SOME_PRIVATE_CONSTANT, %.loc6_45.4 -// CHECK:STDOUT: %.loc7: = complete_type_witness %.28 [template = constants.%.29] +// CHECK:STDOUT: %.loc5_42.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_42.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_42.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_42.3: type = converted %int.make_type_signed.loc5, %.loc5_42.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_48: Core.IntLiteral = int_value 5 [template = constants.%.2] +// CHECK:STDOUT: %.loc5_49.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc5_49.2: = bound_method %.loc5_48, %.loc5_49.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc5_49.3: = specific_function %.loc5_49.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %.loc5_49.3(%.loc5_48) [template = constants.%.25] +// CHECK:STDOUT: %.loc5_49.4: %i32 = value_of_initializer %int.convert_checked.loc5 [template = constants.%.25] +// CHECK:STDOUT: %.loc5_49.5: %i32 = converted %.loc5_48, %.loc5_49.4 [template = constants.%.25] +// CHECK:STDOUT: %SOME_PROTECTED_CONSTANT: %i32 = bind_name SOME_PROTECTED_CONSTANT, %.loc5_49.5 +// CHECK:STDOUT: %.loc6_38.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_38.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_38.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_38.3: type = converted %int.make_type_signed.loc6, %.loc6_38.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_44: Core.IntLiteral = int_value 5 [template = constants.%.2] +// CHECK:STDOUT: %.loc6_45.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_45.2: = bound_method %.loc6_44, %.loc6_45.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc6_45.3: = specific_function %.loc6_45.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %.loc6_45.3(%.loc6_44) [template = constants.%.25] +// CHECK:STDOUT: %.loc6_45.4: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%.25] +// CHECK:STDOUT: %.loc6_45.5: %i32 = converted %.loc6_44, %.loc6_45.4 [template = constants.%.25] +// CHECK:STDOUT: %SOME_PRIVATE_CONSTANT: %i32 = bind_name SOME_PRIVATE_CONSTANT, %.loc6_45.5 +// CHECK:STDOUT: %.loc7: = complete_type_witness %.26 [template = constants.%.27] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -998,17 +1027,19 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Internal { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_36.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc10_36.2: type = converted %int.make_type_32, %.loc10_36.1 [template = i32] -// CHECK:STDOUT: %.loc10_42: Core.IntLiteral = int_value 5 [template = constants.%.1] -// CHECK:STDOUT: %.loc10_43.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_43.2: = bound_method %.loc10_42, %.loc10_43.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc10_43.2(%.loc10_42) [template = constants.%.27] -// CHECK:STDOUT: %.loc10_43.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc10_43.4: i32 = converted %.loc10_42, %.loc10_43.3 [template = constants.%.27] -// CHECK:STDOUT: %INTERNAL_CONSTANT: i32 = bind_name INTERNAL_CONSTANT, %.loc10_43.4 -// CHECK:STDOUT: %.loc11: = complete_type_witness %.28 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_36.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc10_36.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_36.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc10_36.3: type = converted %int.make_type_signed, %.loc10_36.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_42: Core.IntLiteral = int_value 5 [template = constants.%.2] +// CHECK:STDOUT: %.loc10_43.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_43.2: = bound_method %.loc10_42, %.loc10_43.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc10_43.3: = specific_function %.loc10_43.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc10_43.3(%.loc10_42) [template = constants.%.25] +// CHECK:STDOUT: %.loc10_43.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc10_43.5: %i32 = converted %.loc10_42, %.loc10_43.4 [template = constants.%.25] +// CHECK:STDOUT: %INTERNAL_CONSTANT: %i32 = bind_name INTERNAL_CONSTANT, %.loc10_43.5 +// CHECK:STDOUT: %.loc11: = complete_type_witness %.26 [template = constants.%.27] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Internal @@ -1017,33 +1048,35 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %Internal.ref: type = name_ref Internal, file.%Internal.decl [template = constants.%Internal] -// CHECK:STDOUT: %.loc14: %.31 = field_decl internal, element0 [template] +// CHECK:STDOUT: %.loc14: %.29 = field_decl internal, element0 [template] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_32, %.loc16_13.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc16_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc16_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc16_13.3: type = converted %int.make_type_signed, %.loc16_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %SomeFunc.decl: %SomeFunc.type = fn_decl @SomeFunc [template = constants.%SomeFunc] { // CHECK:STDOUT: %self.patt: %B = binding_pattern self // CHECK:STDOUT: %self.param_patt: %B = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc36_32.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc36_32.2: type = converted %int.make_type_32, %.loc36_32.1 [template = i32] +// CHECK:STDOUT: %.loc36_32.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc36_32.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc36_32.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc36_32.3: type = converted %int.make_type_signed, %.loc36_32.2 [template = constants.%i32] // CHECK:STDOUT: %self.param: %B = value_param runtime_param0 // CHECK:STDOUT: %self: %B = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc46: = complete_type_witness %.32 [template = constants.%.33] +// CHECK:STDOUT: %.loc46: = complete_type_witness %.30 [template = constants.%.31] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -1052,7 +1085,7 @@ class B { // CHECK:STDOUT: .SomeFunc = %SomeFunc.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> i32 { +// CHECK:STDOUT: fn @G() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %A.ref.loc24: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %SOME_PRIVATE_CONSTANT.ref: = name_ref SOME_PRIVATE_CONSTANT, [template = ] @@ -1061,10 +1094,10 @@ class B { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SomeFunc[%self.param_patt: %B]() -> i32 { +// CHECK:STDOUT: fn @SomeFunc[%self.param_patt: %B]() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %B = name_ref self, %self -// CHECK:STDOUT: %internal.ref: %.31 = name_ref internal, @B.%.loc14 [template = @B.%.loc14] +// CHECK:STDOUT: %internal.ref: %.29 = name_ref internal, @B.%.loc14 [template = @B.%.loc14] // CHECK:STDOUT: %.loc44_16.1: ref %Internal = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc44_16.2: %Internal = bind_value %.loc44_16.1 // CHECK:STDOUT: %INTERNAL_CONSTANT.ref: = name_ref INTERNAL_CONSTANT, [template = ] @@ -1075,22 +1108,24 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %A, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.x: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %A, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.x: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %B, %A [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %B, %A [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %A} [template] -// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] +// CHECK:STDOUT: %.7: type = struct_type {.base: %A} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1108,11 +1143,12 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc5_18.2: type = converted %int.make_type_32, %.loc5_18.1 [template = i32] -// CHECK:STDOUT: %.loc5_16: %.1 = field_decl x, element0 [template] -// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc5_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_18.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc5_18.3: type = converted %int.make_type_signed, %.loc5_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_16: %.2 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -1121,7 +1157,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc9: %.5 = base_decl %A, element0 [template] +// CHECK:STDOUT: %.loc9: %.6 = base_decl %A, element0 [template] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %B = binding_pattern self // CHECK:STDOUT: %self.param_patt: %B = value_param_pattern %self.patt, runtime_param0 @@ -1130,7 +1166,7 @@ class B { // CHECK:STDOUT: %self.param: %B = value_param runtime_param0 // CHECK:STDOUT: %self: %B = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19: = complete_type_witness %.6 [template = constants.%.7] +// CHECK:STDOUT: %.loc19: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -1151,22 +1187,24 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %A, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.x: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %A, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.x: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %B, %A [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %B, %A [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %A} [template] -// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] +// CHECK:STDOUT: %.7: type = struct_type {.base: %A} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1184,11 +1222,12 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc5_20.2: type = converted %int.make_type_32, %.loc5_20.1 [template = i32] -// CHECK:STDOUT: %.loc5_18: %.1 = field_decl x, element0 [template] -// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc5_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc5_20.3: type = converted %int.make_type_signed, %.loc5_20.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_18: %.2 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -1197,7 +1236,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc9: %.5 = base_decl %A, element0 [template] +// CHECK:STDOUT: %.loc9: %.6 = base_decl %A, element0 [template] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %B = binding_pattern self // CHECK:STDOUT: %self.param_patt: %B = value_param_pattern %self.patt, runtime_param0 @@ -1206,7 +1245,7 @@ class B { // CHECK:STDOUT: %self.param: %B = value_param runtime_param0 // CHECK:STDOUT: %self: %B = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc14: = complete_type_witness %.6 [template = constants.%.7] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -1219,10 +1258,10 @@ class B { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %B = name_ref self, %self // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %x.ref: %.1 = name_ref x, @A.%.loc5_18 [template = @A.%.loc5_18] +// CHECK:STDOUT: %x.ref: %.2 = name_ref x, @A.%.loc5_18 [template = @A.%.loc5_18] // CHECK:STDOUT: %.loc12_9.1: ref %A = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc12_9.2: ref %A = converted %self.ref, %.loc12_9.1 -// CHECK:STDOUT: %.loc12_9.3: ref i32 = class_element_access %.loc12_9.2, element0 +// CHECK:STDOUT: %.loc12_9.3: ref %i32 = class_element_access %.loc12_9.2, element0 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/init.carbon b/toolchain/check/testdata/class/init.carbon index 1e419bd235e2..5559263891fb 100644 --- a/toolchain/check/testdata/class/init.carbon +++ b/toolchain/check/testdata/class/init.carbon @@ -25,23 +25,25 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Class, i32 [template] -// CHECK:STDOUT: %.2: type = ptr_type %Class [template] -// CHECK:STDOUT: %.3: type = unbound_element_type %Class, %.2 [template] -// CHECK:STDOUT: %.4: type = struct_type {.n: i32, .next: %.2} [template] -// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Class, %i32 [template] +// CHECK:STDOUT: %.3: type = ptr_type %Class [template] +// CHECK:STDOUT: %.4: type = unbound_element_type %Class, %.3 [template] +// CHECK:STDOUT: %.5: type = struct_type {.n: %i32, .next: %.3} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] // CHECK:STDOUT: %MakeReorder.type: type = fn_type @MakeReorder [template] // CHECK:STDOUT: %MakeReorder: %MakeReorder.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = struct_type {.next: %.2, .n: i32} [template] +// CHECK:STDOUT: %.8: type = struct_type {.next: %.3, .n: %i32} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -57,58 +59,61 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %next.patt: %.2 = binding_pattern next -// CHECK:STDOUT: %next.param_patt: %.2 = value_param_pattern %next.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %next.patt: %.3 = binding_pattern next +// CHECK:STDOUT: %next.param_patt: %.3 = value_param_pattern %next.patt, runtime_param1 // CHECK:STDOUT: %return.patt: %Class = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %Class = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_12.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_12.2: type = converted %int.make_type_32, %.loc16_12.1 [template = i32] +// CHECK:STDOUT: %.loc16_12.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc16_12.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_12.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc16_12.3: type = converted %int.make_type_signed, %.loc16_12.2 [template = constants.%i32] // CHECK:STDOUT: %Class.ref.loc16_23: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %.loc16_28: type = ptr_type %Class [template = constants.%.2] +// CHECK:STDOUT: %.loc16_28: type = ptr_type %Class [template = constants.%.3] // CHECK:STDOUT: %Class.ref.loc16_34: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param -// CHECK:STDOUT: %next.param: %.2 = value_param runtime_param1 -// CHECK:STDOUT: %next: %.2 = bind_name next, %next.param +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param +// CHECK:STDOUT: %next.param: %.3 = value_param runtime_param1 +// CHECK:STDOUT: %next: %.3 = bind_name next, %next.param // CHECK:STDOUT: %return.param: ref %Class = out_param runtime_param2 // CHECK:STDOUT: %return: ref %Class = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %MakeReorder.decl: %MakeReorder.type = fn_decl @MakeReorder [template = constants.%MakeReorder] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %next.patt: %.2 = binding_pattern next -// CHECK:STDOUT: %next.param_patt: %.2 = value_param_pattern %next.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %next.patt: %.3 = binding_pattern next +// CHECK:STDOUT: %next.param_patt: %.3 = value_param_pattern %next.patt, runtime_param1 // CHECK:STDOUT: %return.patt: %Class = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %Class = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc20_19.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc20_19.2: type = converted %int.make_type_32, %.loc20_19.1 [template = i32] +// CHECK:STDOUT: %.loc20_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc20_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc20_19.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc20_19.3: type = converted %int.make_type_signed, %.loc20_19.2 [template = constants.%i32] // CHECK:STDOUT: %Class.ref.loc20_30: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %.loc20_35: type = ptr_type %Class [template = constants.%.2] +// CHECK:STDOUT: %.loc20_35: type = ptr_type %Class [template = constants.%.3] // CHECK:STDOUT: %Class.ref.loc20_41: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param -// CHECK:STDOUT: %next.param: %.2 = value_param runtime_param1 -// CHECK:STDOUT: %next: %.2 = bind_name next, %next.param +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param +// CHECK:STDOUT: %next.param: %.3 = value_param runtime_param1 +// CHECK:STDOUT: %next: %.3 = bind_name next, %next.param // CHECK:STDOUT: %return.param: ref %Class = out_param runtime_param2 // CHECK:STDOUT: %return: ref %Class = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl n, element0 [template] // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %.loc13_18: type = ptr_type %Class [template = constants.%.2] -// CHECK:STDOUT: %.loc13_11: %.3 = field_decl next, element1 [template] -// CHECK:STDOUT: %.loc14: = complete_type_witness %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc13_18: type = ptr_type %Class [template = constants.%.3] +// CHECK:STDOUT: %.loc13_11: %.4 = field_decl next, element1 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -116,29 +121,29 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: .next = %.loc13_11 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Make(%n.param_patt: i32, %next.param_patt: %.2) -> %return: %Class { +// CHECK:STDOUT: fn @Make(%n.param_patt: %i32, %next.param_patt: %.3) -> %return: %Class { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n -// CHECK:STDOUT: %next.ref: %.2 = name_ref next, %next -// CHECK:STDOUT: %.loc17_31.1: %.4 = struct_literal (%n.ref, %next.ref) -// CHECK:STDOUT: %.loc17_31.2: ref i32 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc17_31.3: init i32 = initialize_from %n.ref to %.loc17_31.2 -// CHECK:STDOUT: %.loc17_31.4: ref %.2 = class_element_access %return, element1 -// CHECK:STDOUT: %.loc17_31.5: init %.2 = initialize_from %next.ref to %.loc17_31.4 +// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n +// CHECK:STDOUT: %next.ref: %.3 = name_ref next, %next +// CHECK:STDOUT: %.loc17_31.1: %.5 = struct_literal (%n.ref, %next.ref) +// CHECK:STDOUT: %.loc17_31.2: ref %i32 = class_element_access %return, element0 +// CHECK:STDOUT: %.loc17_31.3: init %i32 = initialize_from %n.ref to %.loc17_31.2 +// CHECK:STDOUT: %.loc17_31.4: ref %.3 = class_element_access %return, element1 +// CHECK:STDOUT: %.loc17_31.5: init %.3 = initialize_from %next.ref to %.loc17_31.4 // CHECK:STDOUT: %.loc17_31.6: init %Class = class_init (%.loc17_31.3, %.loc17_31.5), %return // CHECK:STDOUT: %.loc17_32: init %Class = converted %.loc17_31.1, %.loc17_31.6 // CHECK:STDOUT: return %.loc17_32 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @MakeReorder(%n.param_patt: i32, %next.param_patt: %.2) -> %return: %Class { +// CHECK:STDOUT: fn @MakeReorder(%n.param_patt: %i32, %next.param_patt: %.3) -> %return: %Class { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %next.ref: %.2 = name_ref next, %next -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n -// CHECK:STDOUT: %.loc21_31.1: %.7 = struct_literal (%next.ref, %n.ref) -// CHECK:STDOUT: %.loc21_31.2: ref i32 = class_element_access %return, element1 -// CHECK:STDOUT: %.loc21_31.3: init i32 = initialize_from %n.ref to %.loc21_31.2 -// CHECK:STDOUT: %.loc21_31.4: ref %.2 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc21_31.5: init %.2 = initialize_from %next.ref to %.loc21_31.4 +// CHECK:STDOUT: %next.ref: %.3 = name_ref next, %next +// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n +// CHECK:STDOUT: %.loc21_31.1: %.8 = struct_literal (%next.ref, %n.ref) +// CHECK:STDOUT: %.loc21_31.2: ref %i32 = class_element_access %return, element1 +// CHECK:STDOUT: %.loc21_31.3: init %i32 = initialize_from %n.ref to %.loc21_31.2 +// CHECK:STDOUT: %.loc21_31.4: ref %.3 = class_element_access %return, element0 +// CHECK:STDOUT: %.loc21_31.5: init %.3 = initialize_from %next.ref to %.loc21_31.4 // CHECK:STDOUT: %.loc21_31.6: init %Class = class_init (%.loc21_31.3, %.loc21_31.5), %return // CHECK:STDOUT: %.loc21_32: init %Class = converted %.loc21_31.1, %.loc21_31.6 // CHECK:STDOUT: return %.loc21_32 to %return diff --git a/toolchain/check/testdata/class/init_adapt.carbon b/toolchain/check/testdata/class/init_adapt.carbon index a94bb105297b..783456bc5bdc 100644 --- a/toolchain/check/testdata/class/init_adapt.carbon +++ b/toolchain/check/testdata/class/init_adapt.carbon @@ -95,25 +95,29 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %C, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %C, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %AdaptC: type = class_type @AdaptC [template] -// CHECK:STDOUT: %.5: = complete_type_witness %C [template] -// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.8: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.33: = bound_method %.6, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 1 [template] -// CHECK:STDOUT: %.35: = bound_method %.7, %Convert.15 [template] -// CHECK:STDOUT: %.36: i32 = int_value 2 [template] -// CHECK:STDOUT: %struct: %C = struct_value (%.34, %.36) [template] +// CHECK:STDOUT: %.6: = complete_type_witness %C [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.9: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.29: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.30: = bound_method %.7, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.33: = bound_method %.8, %Convert.14 [template] +// CHECK:STDOUT: %.34: = specific_function %.33, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.35: %i32 = int_value 2 [template] +// CHECK:STDOUT: %struct: %C = struct_value (%.32, %.35) [template] // CHECK:STDOUT: %MakeC.type: type = fn_type @MakeC [template] // CHECK:STDOUT: %MakeC: %MakeC.type = struct_value () [template] // CHECK:STDOUT: %MakeAdaptC.type: type = fn_type @MakeAdaptC [template] @@ -122,7 +126,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -173,15 +177,17 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_32.loc5, %.loc5_10.1 [template = i32] -// CHECK:STDOUT: %.loc5_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_32.loc6, %.loc6_10.1 [template = i32] -// CHECK:STDOUT: %.loc6_8: %.1 = field_decl b, element1 [template] -// CHECK:STDOUT: %.loc7: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.3: type = converted %int.make_type_signed.loc5, %.loc5_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc6_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_10.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_10.3: type = converted %int.make_type_signed.loc6, %.loc6_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc7: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -192,7 +198,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: class @AdaptC { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: adapt_decl %C -// CHECK:STDOUT: %.loc11: = complete_type_witness %C [template = constants.%.5] +// CHECK:STDOUT: %.loc11: = complete_type_witness %C [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptC @@ -204,25 +210,27 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc13_18: Core.IntLiteral = int_value 1 [template = constants.%.6] -// CHECK:STDOUT: %.loc13_26: Core.IntLiteral = int_value 2 [template = constants.%.7] -// CHECK:STDOUT: %.loc13_27.1: %.8 = struct_literal (%.loc13_18, %.loc13_26) -// CHECK:STDOUT: %.loc13_27.2: %Convert.type.2 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_27.3: = bound_method %.loc13_18, %.loc13_27.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc13_27.1: init i32 = call %.loc13_27.3(%.loc13_18) [template = constants.%.34] -// CHECK:STDOUT: %.loc13_27.4: init i32 = converted %.loc13_18, %int.convert_checked.loc13_27.1 [template = constants.%.34] -// CHECK:STDOUT: %.loc13_27.5: ref %C = temporary_storage -// CHECK:STDOUT: %.loc13_27.6: ref i32 = class_element_access %.loc13_27.5, element0 -// CHECK:STDOUT: %.loc13_27.7: init i32 = initialize_from %.loc13_27.4 to %.loc13_27.6 [template = constants.%.34] -// CHECK:STDOUT: %.loc13_27.8: %Convert.type.2 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_27.9: = bound_method %.loc13_26, %.loc13_27.8 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc13_27.2: init i32 = call %.loc13_27.9(%.loc13_26) [template = constants.%.36] -// CHECK:STDOUT: %.loc13_27.10: init i32 = converted %.loc13_26, %int.convert_checked.loc13_27.2 [template = constants.%.36] -// CHECK:STDOUT: %.loc13_27.11: ref i32 = class_element_access %.loc13_27.5, element1 -// CHECK:STDOUT: %.loc13_27.12: init i32 = initialize_from %.loc13_27.10 to %.loc13_27.11 [template = constants.%.36] -// CHECK:STDOUT: %.loc13_27.13: init %C = class_init (%.loc13_27.7, %.loc13_27.12), %.loc13_27.5 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_27.14: ref %C = temporary %.loc13_27.5, %.loc13_27.13 -// CHECK:STDOUT: %.loc13_28.1: ref %C = converted %.loc13_27.1, %.loc13_27.14 +// CHECK:STDOUT: %.loc13_18: Core.IntLiteral = int_value 1 [template = constants.%.7] +// CHECK:STDOUT: %.loc13_26: Core.IntLiteral = int_value 2 [template = constants.%.8] +// CHECK:STDOUT: %.loc13_27.1: %.9 = struct_literal (%.loc13_18, %.loc13_26) +// CHECK:STDOUT: %.loc13_27.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_27.3: = bound_method %.loc13_18, %.loc13_27.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc13_27.4: = specific_function %.loc13_27.3, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc13_27.1: init %i32 = call %.loc13_27.4(%.loc13_18) [template = constants.%.32] +// CHECK:STDOUT: %.loc13_27.5: init %i32 = converted %.loc13_18, %int.convert_checked.loc13_27.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc13_27.6: ref %C = temporary_storage +// CHECK:STDOUT: %.loc13_27.7: ref %i32 = class_element_access %.loc13_27.6, element0 +// CHECK:STDOUT: %.loc13_27.8: init %i32 = initialize_from %.loc13_27.5 to %.loc13_27.7 [template = constants.%.32] +// CHECK:STDOUT: %.loc13_27.9: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_27.10: = bound_method %.loc13_26, %.loc13_27.9 [template = constants.%.33] +// CHECK:STDOUT: %.loc13_27.11: = specific_function %.loc13_27.10, @Convert.2(constants.%.1) [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked.loc13_27.2: init %i32 = call %.loc13_27.11(%.loc13_26) [template = constants.%.35] +// CHECK:STDOUT: %.loc13_27.12: init %i32 = converted %.loc13_26, %int.convert_checked.loc13_27.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc13_27.13: ref %i32 = class_element_access %.loc13_27.6, element1 +// CHECK:STDOUT: %.loc13_27.14: init %i32 = initialize_from %.loc13_27.12 to %.loc13_27.13 [template = constants.%.35] +// CHECK:STDOUT: %.loc13_27.15: init %C = class_init (%.loc13_27.8, %.loc13_27.14), %.loc13_27.6 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_27.16: ref %C = temporary %.loc13_27.6, %.loc13_27.15 +// CHECK:STDOUT: %.loc13_28.1: ref %C = converted %.loc13_27.1, %.loc13_27.16 // CHECK:STDOUT: %.loc13_28.2: %C = bind_value %.loc13_28.1 // CHECK:STDOUT: %a: %C = bind_name a, %.loc13_28.2 // CHECK:STDOUT: %a.ref: %C = name_ref a, %a @@ -256,25 +264,29 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %C, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %C, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %AdaptC: type = class_type @AdaptC [template] -// CHECK:STDOUT: %.5: = complete_type_witness %C [template] -// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.8: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.33: = bound_method %.6, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 1 [template] -// CHECK:STDOUT: %.35: = bound_method %.7, %Convert.15 [template] -// CHECK:STDOUT: %.36: i32 = int_value 2 [template] -// CHECK:STDOUT: %struct: %C = struct_value (%.34, %.36) [template] +// CHECK:STDOUT: %.6: = complete_type_witness %C [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.9: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.29: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.30: = bound_method %.7, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.33: = bound_method %.8, %Convert.14 [template] +// CHECK:STDOUT: %.34: = specific_function %.33, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.35: %i32 = int_value 2 [template] +// CHECK:STDOUT: %struct: %C = struct_value (%.32, %.35) [template] // CHECK:STDOUT: %MakeC.type: type = fn_type @MakeC [template] // CHECK:STDOUT: %MakeC: %MakeC.type = struct_value () [template] // CHECK:STDOUT: %MakeAdaptC.type: type = fn_type @MakeAdaptC [template] @@ -283,7 +295,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -334,15 +346,17 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_32.loc5, %.loc5_10.1 [template = i32] -// CHECK:STDOUT: %.loc5_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_32.loc6, %.loc6_10.1 [template = i32] -// CHECK:STDOUT: %.loc6_8: %.1 = field_decl b, element1 [template] -// CHECK:STDOUT: %.loc7: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc5_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_10.3: type = converted %int.make_type_signed.loc5, %.loc5_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc6_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_10.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_10.3: type = converted %int.make_type_signed.loc6, %.loc6_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc7: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -353,7 +367,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: class @AdaptC { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: adapt_decl %C -// CHECK:STDOUT: %.loc11: = complete_type_witness %C [template = constants.%.5] +// CHECK:STDOUT: %.loc11: = complete_type_witness %C [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptC @@ -365,25 +379,27 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc13_18: Core.IntLiteral = int_value 1 [template = constants.%.6] -// CHECK:STDOUT: %.loc13_26: Core.IntLiteral = int_value 2 [template = constants.%.7] -// CHECK:STDOUT: %.loc13_27.1: %.8 = struct_literal (%.loc13_18, %.loc13_26) -// CHECK:STDOUT: %.loc13_27.2: %Convert.type.2 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_27.3: = bound_method %.loc13_18, %.loc13_27.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc13_27.1: init i32 = call %.loc13_27.3(%.loc13_18) [template = constants.%.34] -// CHECK:STDOUT: %.loc13_27.4: init i32 = converted %.loc13_18, %int.convert_checked.loc13_27.1 [template = constants.%.34] -// CHECK:STDOUT: %.loc13_27.5: ref %C = temporary_storage -// CHECK:STDOUT: %.loc13_27.6: ref i32 = class_element_access %.loc13_27.5, element0 -// CHECK:STDOUT: %.loc13_27.7: init i32 = initialize_from %.loc13_27.4 to %.loc13_27.6 [template = constants.%.34] -// CHECK:STDOUT: %.loc13_27.8: %Convert.type.2 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_27.9: = bound_method %.loc13_26, %.loc13_27.8 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc13_27.2: init i32 = call %.loc13_27.9(%.loc13_26) [template = constants.%.36] -// CHECK:STDOUT: %.loc13_27.10: init i32 = converted %.loc13_26, %int.convert_checked.loc13_27.2 [template = constants.%.36] -// CHECK:STDOUT: %.loc13_27.11: ref i32 = class_element_access %.loc13_27.5, element1 -// CHECK:STDOUT: %.loc13_27.12: init i32 = initialize_from %.loc13_27.10 to %.loc13_27.11 [template = constants.%.36] -// CHECK:STDOUT: %.loc13_27.13: init %C = class_init (%.loc13_27.7, %.loc13_27.12), %.loc13_27.5 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_27.14: ref %C = temporary %.loc13_27.5, %.loc13_27.13 -// CHECK:STDOUT: %.loc13_28.1: ref %C = converted %.loc13_27.1, %.loc13_27.14 +// CHECK:STDOUT: %.loc13_18: Core.IntLiteral = int_value 1 [template = constants.%.7] +// CHECK:STDOUT: %.loc13_26: Core.IntLiteral = int_value 2 [template = constants.%.8] +// CHECK:STDOUT: %.loc13_27.1: %.9 = struct_literal (%.loc13_18, %.loc13_26) +// CHECK:STDOUT: %.loc13_27.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_27.3: = bound_method %.loc13_18, %.loc13_27.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc13_27.4: = specific_function %.loc13_27.3, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc13_27.1: init %i32 = call %.loc13_27.4(%.loc13_18) [template = constants.%.32] +// CHECK:STDOUT: %.loc13_27.5: init %i32 = converted %.loc13_18, %int.convert_checked.loc13_27.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc13_27.6: ref %C = temporary_storage +// CHECK:STDOUT: %.loc13_27.7: ref %i32 = class_element_access %.loc13_27.6, element0 +// CHECK:STDOUT: %.loc13_27.8: init %i32 = initialize_from %.loc13_27.5 to %.loc13_27.7 [template = constants.%.32] +// CHECK:STDOUT: %.loc13_27.9: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_27.10: = bound_method %.loc13_26, %.loc13_27.9 [template = constants.%.33] +// CHECK:STDOUT: %.loc13_27.11: = specific_function %.loc13_27.10, @Convert.2(constants.%.1) [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked.loc13_27.2: init %i32 = call %.loc13_27.11(%.loc13_26) [template = constants.%.35] +// CHECK:STDOUT: %.loc13_27.12: init %i32 = converted %.loc13_26, %int.convert_checked.loc13_27.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc13_27.13: ref %i32 = class_element_access %.loc13_27.6, element1 +// CHECK:STDOUT: %.loc13_27.14: init %i32 = initialize_from %.loc13_27.12 to %.loc13_27.13 [template = constants.%.35] +// CHECK:STDOUT: %.loc13_27.15: init %C = class_init (%.loc13_27.8, %.loc13_27.14), %.loc13_27.6 [template = constants.%struct] +// CHECK:STDOUT: %.loc13_27.16: ref %C = temporary %.loc13_27.6, %.loc13_27.15 +// CHECK:STDOUT: %.loc13_28.1: ref %C = converted %.loc13_27.1, %.loc13_27.16 // CHECK:STDOUT: %.loc13_28.2: %C = bind_value %.loc13_28.1 // CHECK:STDOUT: %a: %C = bind_name a, %.loc13_28.2 // CHECK:STDOUT: %a.ref: %C = name_ref a, %a diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index e91a29f703bb..33a948223d8a 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -21,30 +21,34 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Class, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Class, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.6: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.32: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 1 [template] -// CHECK:STDOUT: %.34: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.35: i32 = int_value 2 [template] -// CHECK:STDOUT: %struct: %Class = struct_value (%.33, %.35) [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.7: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.28: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.29: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.30: = specific_function %.29, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.31: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.32: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 2 [template] +// CHECK:STDOUT: %struct: %Class = struct_value (%.31, %.34) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -60,27 +64,30 @@ fn F() -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_11.2: type = converted %int.make_type_32, %.loc16_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc16_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc16_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc16_11.3: type = converted %int.make_type_signed, %.loc16_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] -// CHECK:STDOUT: %.loc13_8: %.1 = field_decl b, element1 [template] -// CHECK:STDOUT: %.loc14: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed.loc12, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc13_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.3: type = converted %int.make_type_signed.loc13, %.loc13_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -88,31 +95,33 @@ fn F() -> i32 { // CHECK:STDOUT: .b = %.loc13_8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32 { +// CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc17_17: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc17_25: Core.IntLiteral = int_value 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc17_26.1: %.6 = struct_literal (%.loc17_17, %.loc17_25) +// CHECK:STDOUT: %.loc17_17: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc17_25: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc17_26.1: %.7 = struct_literal (%.loc17_17, %.loc17_25) // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %.loc17_26.2: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc17_26.3: = bound_method %.loc17_17, %.loc17_26.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc17_26.1: init i32 = call %.loc17_26.3(%.loc17_17) [template = constants.%.33] -// CHECK:STDOUT: %.loc17_26.4: init i32 = converted %.loc17_17, %int.convert_checked.loc17_26.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc17_26.5: ref %Class = temporary_storage -// CHECK:STDOUT: %.loc17_26.6: ref i32 = class_element_access %.loc17_26.5, element0 -// CHECK:STDOUT: %.loc17_26.7: init i32 = initialize_from %.loc17_26.4 to %.loc17_26.6 [template = constants.%.33] -// CHECK:STDOUT: %.loc17_26.8: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc17_26.9: = bound_method %.loc17_25, %.loc17_26.8 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc17_26.2: init i32 = call %.loc17_26.9(%.loc17_25) [template = constants.%.35] -// CHECK:STDOUT: %.loc17_26.10: init i32 = converted %.loc17_25, %int.convert_checked.loc17_26.2 [template = constants.%.35] -// CHECK:STDOUT: %.loc17_26.11: ref i32 = class_element_access %.loc17_26.5, element1 -// CHECK:STDOUT: %.loc17_26.12: init i32 = initialize_from %.loc17_26.10 to %.loc17_26.11 [template = constants.%.35] -// CHECK:STDOUT: %.loc17_26.13: init %Class = class_init (%.loc17_26.7, %.loc17_26.12), %.loc17_26.5 [template = constants.%struct] -// CHECK:STDOUT: %.loc17_26.14: ref %Class = temporary %.loc17_26.5, %.loc17_26.13 -// CHECK:STDOUT: %.loc17_28: ref %Class = converted %.loc17_26.1, %.loc17_26.14 -// CHECK:STDOUT: %a.ref: %.1 = name_ref a, @Class.%.loc12_8 [template = @Class.%.loc12_8] -// CHECK:STDOUT: %.loc17_37.1: ref i32 = class_element_access %.loc17_28, element0 -// CHECK:STDOUT: %.loc17_37.2: i32 = bind_value %.loc17_37.1 +// CHECK:STDOUT: %.loc17_26.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc17_26.3: = bound_method %.loc17_17, %.loc17_26.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc17_26.4: = specific_function %.loc17_26.3, @Convert.2(constants.%.1) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc17_26.1: init %i32 = call %.loc17_26.4(%.loc17_17) [template = constants.%.31] +// CHECK:STDOUT: %.loc17_26.5: init %i32 = converted %.loc17_17, %int.convert_checked.loc17_26.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc17_26.6: ref %Class = temporary_storage +// CHECK:STDOUT: %.loc17_26.7: ref %i32 = class_element_access %.loc17_26.6, element0 +// CHECK:STDOUT: %.loc17_26.8: init %i32 = initialize_from %.loc17_26.5 to %.loc17_26.7 [template = constants.%.31] +// CHECK:STDOUT: %.loc17_26.9: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc17_26.10: = bound_method %.loc17_25, %.loc17_26.9 [template = constants.%.32] +// CHECK:STDOUT: %.loc17_26.11: = specific_function %.loc17_26.10, @Convert.2(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc17_26.2: init %i32 = call %.loc17_26.11(%.loc17_25) [template = constants.%.34] +// CHECK:STDOUT: %.loc17_26.12: init %i32 = converted %.loc17_25, %int.convert_checked.loc17_26.2 [template = constants.%.34] +// CHECK:STDOUT: %.loc17_26.13: ref %i32 = class_element_access %.loc17_26.6, element1 +// CHECK:STDOUT: %.loc17_26.14: init %i32 = initialize_from %.loc17_26.12 to %.loc17_26.13 [template = constants.%.34] +// CHECK:STDOUT: %.loc17_26.15: init %Class = class_init (%.loc17_26.8, %.loc17_26.14), %.loc17_26.6 [template = constants.%struct] +// CHECK:STDOUT: %.loc17_26.16: ref %Class = temporary %.loc17_26.6, %.loc17_26.15 +// CHECK:STDOUT: %.loc17_28: ref %Class = converted %.loc17_26.1, %.loc17_26.16 +// CHECK:STDOUT: %a.ref: %.2 = name_ref a, @Class.%.loc12_8 [template = @Class.%.loc12_8] +// CHECK:STDOUT: %.loc17_37.1: ref %i32 = class_element_access %.loc17_28, element0 +// CHECK:STDOUT: %.loc17_37.2: %i32 = bind_value %.loc17_37.1 // CHECK:STDOUT: return %.loc17_37.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/init_nested.carbon b/toolchain/check/testdata/class/init_nested.carbon index eae8563f24f1..1408aa9da6c6 100644 --- a/toolchain/check/testdata/class/init_nested.carbon +++ b/toolchain/check/testdata/class/init_nested.carbon @@ -28,24 +28,26 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Inner: type = class_type @Inner [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Inner, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Inner, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %MakeInner.type: type = fn_type @MakeInner [template] // CHECK:STDOUT: %MakeInner: %MakeInner.type = struct_value () [template] // CHECK:STDOUT: %Outer: type = class_type @Outer [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Outer, %Inner [template] -// CHECK:STDOUT: %.6: type = struct_type {.c: %Inner, .d: %Inner} [template] -// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Outer, %Inner [template] +// CHECK:STDOUT: %.7: type = struct_type {.c: %Inner, .d: %Inner} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] // CHECK:STDOUT: %MakeOuter.type: type = fn_type @MakeOuter [template] // CHECK:STDOUT: %MakeOuter: %MakeOuter.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -81,15 +83,17 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Inner { -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] -// CHECK:STDOUT: %.loc13_8: %.1 = field_decl b, element1 [template] -// CHECK:STDOUT: %.loc14: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed.loc12, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc13_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.3: type = converted %int.make_type_signed.loc13, %.loc13_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Inner @@ -99,10 +103,10 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: // CHECK:STDOUT: class @Outer { // CHECK:STDOUT: %Inner.ref.loc19: type = name_ref Inner, file.%Inner.decl [template = constants.%Inner] -// CHECK:STDOUT: %.loc19: %.5 = field_decl c, element0 [template] +// CHECK:STDOUT: %.loc19: %.6 = field_decl c, element0 [template] // CHECK:STDOUT: %Inner.ref.loc20: type = name_ref Inner, file.%Inner.decl [template = constants.%Inner] -// CHECK:STDOUT: %.loc20: %.5 = field_decl d, element1 [template] -// CHECK:STDOUT: %.loc21: = complete_type_witness %.6 [template = constants.%.7] +// CHECK:STDOUT: %.loc20: %.6 = field_decl d, element1 [template] +// CHECK:STDOUT: %.loc21: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Outer @@ -120,7 +124,7 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: %MakeInner.ref.loc24_34: %MakeInner.type = name_ref MakeInner, file.%MakeInner.decl [template = constants.%MakeInner] // CHECK:STDOUT: %.loc24_45.2: ref %Inner = class_element_access %return, element1 // CHECK:STDOUT: %MakeInner.call.loc24_43: init %Inner = call %MakeInner.ref.loc24_34() to %.loc24_45.2 -// CHECK:STDOUT: %.loc24_45.3: %.6 = struct_literal (%MakeInner.call.loc24_25, %MakeInner.call.loc24_43) +// CHECK:STDOUT: %.loc24_45.3: %.7 = struct_literal (%MakeInner.call.loc24_25, %MakeInner.call.loc24_43) // CHECK:STDOUT: %.loc24_45.4: init %Outer = class_init (%MakeInner.call.loc24_25, %MakeInner.call.loc24_43), %return // CHECK:STDOUT: %.loc24_46: init %Outer = converted %.loc24_45.3, %.loc24_45.4 // CHECK:STDOUT: return %.loc24_46 to %return diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index 89cb9aba07b1..3361a3fb7e3a 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -62,31 +62,34 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = ptr_type %Class [template] +// CHECK:STDOUT: %.2: type = ptr_type %Class [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = unbound_element_type %Class, i32 [template] -// CHECK:STDOUT: %.3: type = struct_type {.k: i32} [template] -// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.3: type = unbound_element_type %Class, %i32 [template] +// CHECK:STDOUT: %.4: type = struct_type {.k: %i32} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: %Call.type: type = fn_type @Call [template] // CHECK:STDOUT: %Call: %Call.type = struct_value () [template] // CHECK:STDOUT: %CallAlias.type: type = fn_type @CallAlias [template] // CHECK:STDOUT: %CallAlias: %CallAlias.type = struct_value () [template] // CHECK:STDOUT: %CallOnConstBoundMethod.type: type = fn_type @CallOnConstBoundMethod [template] // CHECK:STDOUT: %CallOnConstBoundMethod: %CallOnConstBoundMethod.type = struct_value () [template] -// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.7: type = struct_type {.k: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.32: = bound_method %.6, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 1 [template] -// CHECK:STDOUT: %struct: %Class = struct_value (%.33) [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.8: type = struct_type {.k: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.28: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.29: = bound_method %.7, %Convert.14 [template] +// CHECK:STDOUT: %.30: = specific_function %.29, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.31: %i32 = int_value 1 [template] +// CHECK:STDOUT: %struct: %Class = struct_value (%.31) [template] // CHECK:STDOUT: %CallWithAddr.type: type = fn_type @CallWithAddr [template] // CHECK:STDOUT: %CallWithAddr: %CallWithAddr.type = struct_value () [template] // CHECK:STDOUT: %CallFThroughPointer.type: type = fn_type @CallFThroughPointer [template] @@ -103,7 +106,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -129,99 +132,106 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Class = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc20_29.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32] -// CHECK:STDOUT: %.loc20_29.2: type = converted %int.make_type_32.loc20, %.loc20_29.1 [template = i32] +// CHECK:STDOUT: %.loc20_29.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%.loc20_29.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc20_29.2: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] +// CHECK:STDOUT: %.loc20_29.3: type = converted %int.make_type_signed.loc20, %.loc20_29.2 [template = constants.%i32] // CHECK:STDOUT: %self.param.loc20: %Class = value_param runtime_param0 // CHECK:STDOUT: %self.loc20: %Class = bind_name self, %self.param.loc20 -// CHECK:STDOUT: %return.param.loc20: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param.loc20 +// CHECK:STDOUT: %return.param.loc20: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param.loc20 // CHECK:STDOUT: } // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { // CHECK:STDOUT: %c.patt: %Class = binding_pattern c // CHECK:STDOUT: %c.param_patt: %Class = value_param_pattern %c.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc24_22.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc24_22.2: type = converted %int.make_type_32, %.loc24_22.1 [template = i32] +// CHECK:STDOUT: %.loc24_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc24_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc24_22.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc24_22.3: type = converted %int.make_type_signed, %.loc24_22.2 [template = constants.%i32] // CHECK:STDOUT: %c.param: %Class = value_param runtime_param0 // CHECK:STDOUT: %c: %Class = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallAlias.decl: %CallAlias.type = fn_decl @CallAlias [template = constants.%CallAlias] { // CHECK:STDOUT: %c.patt: %Class = binding_pattern c // CHECK:STDOUT: %c.param_patt: %Class = value_param_pattern %c.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc30_27.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc30_27.2: type = converted %int.make_type_32, %.loc30_27.1 [template = i32] +// CHECK:STDOUT: %.loc30_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc30_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc30_27.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc30_27.3: type = converted %int.make_type_signed, %.loc30_27.2 [template = constants.%i32] // CHECK:STDOUT: %c.param: %Class = value_param runtime_param0 // CHECK:STDOUT: %c: %Class = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallOnConstBoundMethod.decl: %CallOnConstBoundMethod.type = fn_decl @CallOnConstBoundMethod [template = constants.%CallOnConstBoundMethod] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc34_32.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc34_32.2: type = converted %int.make_type_32, %.loc34_32.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc34_32.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc34_32.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc34_32.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc34_32.3: type = converted %int.make_type_signed, %.loc34_32.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallWithAddr.decl: %CallWithAddr.type = fn_decl @CallWithAddr [template = constants.%CallWithAddr] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc38_22.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc38_22.2: type = converted %int.make_type_32, %.loc38_22.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc38_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc38_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc38_22.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc38_22.3: type = converted %int.make_type_signed, %.loc38_22.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallFThroughPointer.decl: %CallFThroughPointer.type = fn_decl @CallFThroughPointer [template = constants.%CallFThroughPointer] { -// CHECK:STDOUT: %p.patt: %.1 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.1 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.2 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.2 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %.loc43_32: type = ptr_type %Class [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc43_38.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc43_38.2: type = converted %int.make_type_32, %.loc43_38.1 [template = i32] -// CHECK:STDOUT: %p.param: %.1 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.1 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc43_32: type = ptr_type %Class [template = constants.%.2] +// CHECK:STDOUT: %.loc43_38.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc43_38.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc43_38.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc43_38.3: type = converted %int.make_type_signed, %.loc43_38.2 [template = constants.%i32] +// CHECK:STDOUT: %p.param: %.2 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.2 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallGThroughPointer.decl: %CallGThroughPointer.type = fn_decl @CallGThroughPointer [template = constants.%CallGThroughPointer] { -// CHECK:STDOUT: %p.patt: %.1 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.1 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.2 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.2 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %.loc47_32: type = ptr_type %Class [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc47_38.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc47_38.2: type = converted %int.make_type_32, %.loc47_38.1 [template = i32] -// CHECK:STDOUT: %p.param: %.1 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.1 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc47_32: type = ptr_type %Class [template = constants.%.2] +// CHECK:STDOUT: %.loc47_38.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc47_38.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc47_38.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc47_38.3: type = converted %int.make_type_signed, %.loc47_38.2 [template = constants.%i32] +// CHECK:STDOUT: %p.param: %.2 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.2 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { // CHECK:STDOUT: %return.patt: %Class = return_slot_pattern @@ -232,24 +242,26 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %return: ref %Class = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallFOnInitializingExpr.decl: %CallFOnInitializingExpr.type = fn_decl @CallFOnInitializingExpr [template = constants.%CallFOnInitializingExpr] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc53_33.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc53_33.2: type = converted %int.make_type_32, %.loc53_33.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc53_33.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc53_33.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc53_33.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc53_33.3: type = converted %int.make_type_signed, %.loc53_33.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallGOnInitializingExpr.decl: %CallGOnInitializingExpr.type = fn_decl @CallGOnInitializingExpr [template = constants.%CallGOnInitializingExpr] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc57_33.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc57_33.2: type = converted %int.make_type_32, %.loc57_33.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc57_33.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc57_33.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc57_33.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc57_33.3: type = converted %int.make_type_signed, %.loc57_33.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -257,42 +269,45 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Class = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_25.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_25.2: type = converted %int.make_type_32.loc12, %.loc12_25.1 [template = i32] +// CHECK:STDOUT: %.loc12_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_25.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_25.3: type = converted %int.make_type_signed.loc12, %.loc12_25.2 [template = constants.%i32] // CHECK:STDOUT: %self.param.loc12: %Class = value_param runtime_param0 // CHECK:STDOUT: %self.loc12: %Class = bind_name self, %self.param.loc12 -// CHECK:STDOUT: %return.param.loc12: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %.loc12_22: ref i32 = return_slot %return.param.loc12 +// CHECK:STDOUT: %return.param.loc12: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %.loc12_22: ref %i32 = return_slot %return.param.loc12 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %self.patt: %.1 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %.1 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %self.patt: %.2 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.2 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc13_8: auto = addr_pattern %self.param_patt -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %.loc13_23: type = ptr_type %Class [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_32, %.loc13_31.1 [template = i32] -// CHECK:STDOUT: %self.param: %.1 = value_param runtime_param0 -// CHECK:STDOUT: %self: %.1 = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc13_23: type = ptr_type %Class [template = constants.%.2] +// CHECK:STDOUT: %.loc13_31.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_31.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.3: type = converted %int.make_type_signed, %.loc13_31.2 [template = constants.%i32] +// CHECK:STDOUT: %self.param: %.2 = value_param runtime_param0 +// CHECK:STDOUT: %self: %.2 = bind_name self, %self.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %F.ref: %F.type = name_ref F, %F.decl [template = constants.%F] // CHECK:STDOUT: %A: %F.type = bind_alias A, %F.decl [template = constants.%F] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc17_10.2: type = converted %int.make_type_32, %.loc17_10.1 [template = i32] -// CHECK:STDOUT: %.loc17_8: %.2 = field_decl k, element0 [template] -// CHECK:STDOUT: %.loc18: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc17_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc17_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc17_10.3: type = converted %int.make_type_signed, %.loc17_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_8: %.3 = field_decl k, element0 [template] +// CHECK:STDOUT: %.loc18: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -302,64 +317,65 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: .k = %.loc17_8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[%self.param_patt: %Class]() -> i32 { +// CHECK:STDOUT: fn @F[%self.param_patt: %Class]() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Class = name_ref self, %self.loc20 -// CHECK:STDOUT: %k.ref: %.2 = name_ref k, @Class.%.loc17_8 [template = @Class.%.loc17_8] -// CHECK:STDOUT: %.loc21_14.1: ref i32 = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc21_14.2: i32 = bind_value %.loc21_14.1 +// CHECK:STDOUT: %k.ref: %.3 = name_ref k, @Class.%.loc17_8 [template = @Class.%.loc17_8] +// CHECK:STDOUT: %.loc21_14.1: ref %i32 = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc21_14.2: %i32 = bind_value %.loc21_14.1 // CHECK:STDOUT: return %.loc21_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr %self.param_patt: %.1]() -> i32; +// CHECK:STDOUT: fn @G[addr %self.param_patt: %.2]() -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Call(%c.param_patt: %Class) -> i32 { +// CHECK:STDOUT: fn @Call(%c.param_patt: %Class) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %Class = name_ref c, %c // CHECK:STDOUT: %F.ref: %F.type = name_ref F, @Class.%F.decl [template = constants.%F] // CHECK:STDOUT: %.loc27_11: = bound_method %c.ref, %F.ref -// CHECK:STDOUT: %F.call: init i32 = call %.loc27_11(%c.ref) -// CHECK:STDOUT: %.loc27_15.1: i32 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc27_15.2: i32 = converted %F.call, %.loc27_15.1 +// CHECK:STDOUT: %F.call: init %i32 = call %.loc27_11(%c.ref) +// CHECK:STDOUT: %.loc27_15.1: %i32 = value_of_initializer %F.call +// CHECK:STDOUT: %.loc27_15.2: %i32 = converted %F.call, %.loc27_15.1 // CHECK:STDOUT: return %.loc27_15.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallAlias(%c.param_patt: %Class) -> i32 { +// CHECK:STDOUT: fn @CallAlias(%c.param_patt: %Class) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %Class = name_ref c, %c // CHECK:STDOUT: %A.ref: %F.type = name_ref A, @Class.%A [template = constants.%F] // CHECK:STDOUT: %.loc31_11: = bound_method %c.ref, %A.ref -// CHECK:STDOUT: %F.call: init i32 = call %.loc31_11(%c.ref) -// CHECK:STDOUT: %.loc31_15.1: i32 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc31_15.2: i32 = converted %F.call, %.loc31_15.1 +// CHECK:STDOUT: %F.call: init %i32 = call %.loc31_11(%c.ref) +// CHECK:STDOUT: %.loc31_15.1: %i32 = value_of_initializer %F.call +// CHECK:STDOUT: %.loc31_15.2: %i32 = converted %F.call, %.loc31_15.1 // CHECK:STDOUT: return %.loc31_15.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallOnConstBoundMethod() -> i32 { +// CHECK:STDOUT: fn @CallOnConstBoundMethod() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc35_17: Core.IntLiteral = int_value 1 [template = constants.%.6] -// CHECK:STDOUT: %.loc35_18.1: %.7 = struct_literal (%.loc35_17) +// CHECK:STDOUT: %.loc35_17: Core.IntLiteral = int_value 1 [template = constants.%.7] +// CHECK:STDOUT: %.loc35_18.1: %.8 = struct_literal (%.loc35_17) // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %.loc35_18.2: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc35_18.3: = bound_method %.loc35_17, %.loc35_18.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc35_18.3(%.loc35_17) [template = constants.%.33] -// CHECK:STDOUT: %.loc35_18.4: init i32 = converted %.loc35_17, %int.convert_checked [template = constants.%.33] -// CHECK:STDOUT: %.loc35_18.5: ref %Class = temporary_storage -// CHECK:STDOUT: %.loc35_18.6: ref i32 = class_element_access %.loc35_18.5, element0 -// CHECK:STDOUT: %.loc35_18.7: init i32 = initialize_from %.loc35_18.4 to %.loc35_18.6 [template = constants.%.33] -// CHECK:STDOUT: %.loc35_18.8: init %Class = class_init (%.loc35_18.7), %.loc35_18.5 [template = constants.%struct] -// CHECK:STDOUT: %.loc35_18.9: ref %Class = temporary %.loc35_18.5, %.loc35_18.8 -// CHECK:STDOUT: %.loc35_20.1: ref %Class = converted %.loc35_18.1, %.loc35_18.9 +// CHECK:STDOUT: %.loc35_18.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc35_18.3: = bound_method %.loc35_17, %.loc35_18.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc35_18.4: = specific_function %.loc35_18.3, @Convert.2(constants.%.1) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc35_18.4(%.loc35_17) [template = constants.%.31] +// CHECK:STDOUT: %.loc35_18.5: init %i32 = converted %.loc35_17, %int.convert_checked [template = constants.%.31] +// CHECK:STDOUT: %.loc35_18.6: ref %Class = temporary_storage +// CHECK:STDOUT: %.loc35_18.7: ref %i32 = class_element_access %.loc35_18.6, element0 +// CHECK:STDOUT: %.loc35_18.8: init %i32 = initialize_from %.loc35_18.5 to %.loc35_18.7 [template = constants.%.31] +// CHECK:STDOUT: %.loc35_18.9: init %Class = class_init (%.loc35_18.8), %.loc35_18.6 [template = constants.%struct] +// CHECK:STDOUT: %.loc35_18.10: ref %Class = temporary %.loc35_18.6, %.loc35_18.9 +// CHECK:STDOUT: %.loc35_20.1: ref %Class = converted %.loc35_18.1, %.loc35_18.10 // CHECK:STDOUT: %F.ref: %F.type = name_ref F, @Class.%F.decl [template = constants.%F] // CHECK:STDOUT: %.loc35_29: = bound_method %.loc35_20.1, %F.ref // CHECK:STDOUT: %.loc35_20.2: %Class = bind_value %.loc35_20.1 -// CHECK:STDOUT: %F.call: init i32 = call %.loc35_29(%.loc35_20.2) -// CHECK:STDOUT: %.loc35_33.1: i32 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc35_33.2: i32 = converted %F.call, %.loc35_33.1 +// CHECK:STDOUT: %F.call: init %i32 = call %.loc35_29(%.loc35_20.2) +// CHECK:STDOUT: %.loc35_33.1: %i32 = value_of_initializer %F.call +// CHECK:STDOUT: %.loc35_33.2: %i32 = converted %F.call, %.loc35_33.1 // CHECK:STDOUT: return %.loc35_33.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallWithAddr() -> i32 { +// CHECK:STDOUT: fn @CallWithAddr() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %c.var: ref %Class = var c @@ -367,42 +383,42 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %c.ref: ref %Class = name_ref c, %c // CHECK:STDOUT: %G.ref: %G.type = name_ref G, @Class.%G.decl [template = constants.%G] // CHECK:STDOUT: %.loc40_11: = bound_method %c.ref, %G.ref -// CHECK:STDOUT: %.loc40_10: %.1 = addr_of %c.ref -// CHECK:STDOUT: %G.call: init i32 = call %.loc40_11(%.loc40_10) -// CHECK:STDOUT: %.loc40_15.1: i32 = value_of_initializer %G.call -// CHECK:STDOUT: %.loc40_15.2: i32 = converted %G.call, %.loc40_15.1 +// CHECK:STDOUT: %.loc40_10: %.2 = addr_of %c.ref +// CHECK:STDOUT: %G.call: init %i32 = call %.loc40_11(%.loc40_10) +// CHECK:STDOUT: %.loc40_15.1: %i32 = value_of_initializer %G.call +// CHECK:STDOUT: %.loc40_15.2: %i32 = converted %G.call, %.loc40_15.1 // CHECK:STDOUT: return %.loc40_15.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallFThroughPointer(%p.param_patt: %.1) -> i32 { +// CHECK:STDOUT: fn @CallFThroughPointer(%p.param_patt: %.2) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.1 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.2 = name_ref p, %p // CHECK:STDOUT: %.loc44_11.1: ref %Class = deref %p.ref // CHECK:STDOUT: %F.ref: %F.type = name_ref F, @Class.%F.decl [template = constants.%F] // CHECK:STDOUT: %.loc44_14: = bound_method %.loc44_11.1, %F.ref // CHECK:STDOUT: %.loc44_11.2: %Class = bind_value %.loc44_11.1 -// CHECK:STDOUT: %F.call: init i32 = call %.loc44_14(%.loc44_11.2) -// CHECK:STDOUT: %.loc44_18.1: i32 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc44_18.2: i32 = converted %F.call, %.loc44_18.1 +// CHECK:STDOUT: %F.call: init %i32 = call %.loc44_14(%.loc44_11.2) +// CHECK:STDOUT: %.loc44_18.1: %i32 = value_of_initializer %F.call +// CHECK:STDOUT: %.loc44_18.2: %i32 = converted %F.call, %.loc44_18.1 // CHECK:STDOUT: return %.loc44_18.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallGThroughPointer(%p.param_patt: %.1) -> i32 { +// CHECK:STDOUT: fn @CallGThroughPointer(%p.param_patt: %.2) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.1 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.2 = name_ref p, %p // CHECK:STDOUT: %.loc48_11.1: ref %Class = deref %p.ref // CHECK:STDOUT: %G.ref: %G.type = name_ref G, @Class.%G.decl [template = constants.%G] // CHECK:STDOUT: %.loc48_14: = bound_method %.loc48_11.1, %G.ref -// CHECK:STDOUT: %.loc48_11.2: %.1 = addr_of %.loc48_11.1 -// CHECK:STDOUT: %G.call: init i32 = call %.loc48_14(%.loc48_11.2) -// CHECK:STDOUT: %.loc48_18.1: i32 = value_of_initializer %G.call -// CHECK:STDOUT: %.loc48_18.2: i32 = converted %G.call, %.loc48_18.1 +// CHECK:STDOUT: %.loc48_11.2: %.2 = addr_of %.loc48_11.1 +// CHECK:STDOUT: %G.call: init %i32 = call %.loc48_14(%.loc48_11.2) +// CHECK:STDOUT: %.loc48_18.1: %i32 = value_of_initializer %G.call +// CHECK:STDOUT: %.loc48_18.2: %i32 = converted %G.call, %.loc48_18.1 // CHECK:STDOUT: return %.loc48_18.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Make() -> %Class; // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallFOnInitializingExpr() -> i32 { +// CHECK:STDOUT: fn @CallFOnInitializingExpr() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [template = constants.%Make] // CHECK:STDOUT: %.loc54_14.1: ref %Class = temporary_storage @@ -411,13 +427,13 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, @Class.%F.decl [template = constants.%F] // CHECK:STDOUT: %.loc54_16: = bound_method %.loc54_14.2, %F.ref // CHECK:STDOUT: %.loc54_14.3: %Class = bind_value %.loc54_14.2 -// CHECK:STDOUT: %F.call: init i32 = call %.loc54_16(%.loc54_14.3) -// CHECK:STDOUT: %.loc54_20.1: i32 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc54_20.2: i32 = converted %F.call, %.loc54_20.1 +// CHECK:STDOUT: %F.call: init %i32 = call %.loc54_16(%.loc54_14.3) +// CHECK:STDOUT: %.loc54_20.1: %i32 = value_of_initializer %F.call +// CHECK:STDOUT: %.loc54_20.2: %i32 = converted %F.call, %.loc54_20.1 // CHECK:STDOUT: return %.loc54_20.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallGOnInitializingExpr() -> i32 { +// CHECK:STDOUT: fn @CallGOnInitializingExpr() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [template = constants.%Make] // CHECK:STDOUT: %.loc58_14.1: ref %Class = temporary_storage @@ -425,10 +441,10 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %.loc58_14.2: ref %Class = temporary %.loc58_14.1, %Make.call // CHECK:STDOUT: %G.ref: %G.type = name_ref G, @Class.%G.decl [template = constants.%G] // CHECK:STDOUT: %.loc58_16: = bound_method %.loc58_14.2, %G.ref -// CHECK:STDOUT: %.loc58_14.3: %.1 = addr_of %.loc58_14.2 -// CHECK:STDOUT: %G.call: init i32 = call %.loc58_16(%.loc58_14.3) -// CHECK:STDOUT: %.loc58_20.1: i32 = value_of_initializer %G.call -// CHECK:STDOUT: %.loc58_20.2: i32 = converted %G.call, %.loc58_20.1 +// CHECK:STDOUT: %.loc58_14.3: %.2 = addr_of %.loc58_14.2 +// CHECK:STDOUT: %G.call: init %i32 = call %.loc58_16(%.loc58_14.3) +// CHECK:STDOUT: %.loc58_20.1: %i32 = value_of_initializer %G.call +// CHECK:STDOUT: %.loc58_20.2: %i32 = converted %G.call, %.loc58_20.1 // CHECK:STDOUT: return %.loc58_20.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/nested_name.carbon b/toolchain/check/testdata/class/nested_name.carbon index a571426bd768..149a13595694 100644 --- a/toolchain/check/testdata/class/nested_name.carbon +++ b/toolchain/check/testdata/class/nested_name.carbon @@ -27,13 +27,15 @@ fn G(o: Outer) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Outer: type = class_type @Outer [template] // CHECK:STDOUT: %Inner: type = class_type @Inner [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Inner, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.n: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] -// CHECK:STDOUT: %.4: type = struct_type {} [template] -// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Inner, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.n: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.5: type = struct_type {} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -42,7 +44,7 @@ fn G(o: Outer) { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -60,18 +62,19 @@ fn G(o: Outer) { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %oi.patt: %Inner = binding_pattern oi // CHECK:STDOUT: %oi.param_patt: %Inner = value_param_pattern %oi.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [template = constants.%Inner] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_26.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc17_26.2: type = converted %int.make_type_32, %.loc17_26.1 [template = i32] +// CHECK:STDOUT: %.loc17_26.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc17_26.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_26.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc17_26.3: type = converted %int.make_type_signed, %.loc17_26.2 [template = constants.%i32] // CHECK:STDOUT: %oi.param: %Inner = value_param runtime_param0 // CHECK:STDOUT: %oi: %Inner = bind_name oi, %oi.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %o.patt: %Outer = binding_pattern o @@ -85,7 +88,7 @@ fn G(o: Outer) { // CHECK:STDOUT: // CHECK:STDOUT: class @Outer { // CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [template = constants.%Inner] {} {} -// CHECK:STDOUT: %.loc15: = complete_type_witness %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc15: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Outer @@ -93,23 +96,24 @@ fn G(o: Outer) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Inner { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_12.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_12.2: type = converted %int.make_type_32, %.loc13_12.1 [template = i32] -// CHECK:STDOUT: %.loc13_10: %.1 = field_decl n, element0 [template] -// CHECK:STDOUT: %.loc14: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc13_12.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_12.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_12.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_12.3: type = converted %int.make_type_signed, %.loc13_12.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10: %.2 = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Inner // CHECK:STDOUT: .n = %.loc13_10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%oi.param_patt: %Inner) -> i32 { +// CHECK:STDOUT: fn @F(%oi.param_patt: %Inner) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %oi.ref: %Inner = name_ref oi, %oi -// CHECK:STDOUT: %n.ref: %.1 = name_ref n, @Inner.%.loc13_10 [template = @Inner.%.loc13_10] -// CHECK:STDOUT: %.loc18_12.1: ref i32 = class_element_access %oi.ref, element0 -// CHECK:STDOUT: %.loc18_12.2: i32 = bind_value %.loc18_12.1 +// CHECK:STDOUT: %n.ref: %.2 = name_ref n, @Inner.%.loc13_10 [template = @Inner.%.loc13_10] +// CHECK:STDOUT: %.loc18_12.1: ref %i32 = class_element_access %oi.ref, element0 +// CHECK:STDOUT: %.loc18_12.2: %i32 = bind_value %.loc18_12.1 // CHECK:STDOUT: return %.loc18_12.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/raw_self.carbon b/toolchain/check/testdata/class/raw_self.carbon index 362025d63582..4cc8f9df033c 100644 --- a/toolchain/check/testdata/class/raw_self.carbon +++ b/toolchain/check/testdata/class/raw_self.carbon @@ -27,22 +27,24 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %.1: type = ptr_type %Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.2 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = unbound_element_type %Class, i32 [template] -// CHECK:STDOUT: %.3: type = struct_type {.n: i32} [template] -// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.3: type = unbound_element_type %Class, %i32 [template] +// CHECK:STDOUT: %.4: type = struct_type {.n: %i32} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -59,43 +61,47 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %self.patt.loc17_17: %.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt.loc17_21: %.1 = value_param_pattern %self.patt.loc17_17, runtime_param0 // CHECK:STDOUT: %.loc17_12: auto = addr_pattern %self.param_patt.loc17_21 -// CHECK:STDOUT: %self.patt.loc17_30: i32 = binding_pattern r#self -// CHECK:STDOUT: %self.param_patt.loc17_36: i32 = value_param_pattern %self.patt.loc17_30, runtime_param1 +// CHECK:STDOUT: %self.patt.loc17_30: %i32 = binding_pattern r#self +// CHECK:STDOUT: %self.param_patt.loc17_36: %i32 = value_param_pattern %self.patt.loc17_30, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %.loc17_27: type = ptr_type %Class [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_38.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] -// CHECK:STDOUT: %.loc17_38.2: type = converted %int.make_type_32.loc17, %.loc17_38.1 [template = i32] +// CHECK:STDOUT: %.loc17_38.1: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%.loc17_38.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_38.2: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_38.3: type = converted %int.make_type_signed.loc17, %.loc17_38.2 [template = constants.%i32] // CHECK:STDOUT: %self.param.loc17_21: %.1 = value_param runtime_param0 // CHECK:STDOUT: %self.loc17_17: %.1 = bind_name self, %self.param.loc17_21 -// CHECK:STDOUT: %self.param.loc17_36: i32 = value_param runtime_param1 -// CHECK:STDOUT: %self.loc17_30: i32 = bind_name r#self, %self.param.loc17_36 +// CHECK:STDOUT: %self.param.loc17_36: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %self.loc17_30: %i32 = bind_name r#self, %self.param.loc17_36 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt.loc21_12: %Class = binding_pattern self // CHECK:STDOUT: %self.param_patt.loc21_16: %Class = value_param_pattern %self.patt.loc21_12, runtime_param0 -// CHECK:STDOUT: %self.patt.loc21_24: i32 = binding_pattern r#self -// CHECK:STDOUT: %self.param_patt.loc21_30: i32 = value_param_pattern %self.patt.loc21_24, runtime_param1 +// CHECK:STDOUT: %self.patt.loc21_24: %i32 = binding_pattern r#self +// CHECK:STDOUT: %self.param_patt.loc21_30: %i32 = value_param_pattern %self.patt.loc21_24, runtime_param1 // CHECK:STDOUT: %return.patt: %tuple.type.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc21: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %int.make_type_32.loc21_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_32.1: type = value_of_initializer %int.make_type_32.loc21_32 [template = i32] -// CHECK:STDOUT: %.loc21_32.2: type = converted %int.make_type_32.loc21_32, %.loc21_32.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc21_41: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc21_46: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_49.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc21_41, %int.make_type_32.loc21_46) -// CHECK:STDOUT: %.loc21_49.2: type = value_of_initializer %int.make_type_32.loc21_41 [template = i32] -// CHECK:STDOUT: %.loc21_49.3: type = converted %int.make_type_32.loc21_41, %.loc21_49.2 [template = i32] -// CHECK:STDOUT: %.loc21_49.4: type = value_of_initializer %int.make_type_32.loc21_46 [template = i32] -// CHECK:STDOUT: %.loc21_49.5: type = converted %int.make_type_32.loc21_46, %.loc21_49.4 [template = i32] +// CHECK:STDOUT: %.loc21_32.1: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc21_32: init type = call constants.%Int(%.loc21_32.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_32.2: type = value_of_initializer %int.make_type_signed.loc21_32 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_32.3: type = converted %int.make_type_signed.loc21_32, %.loc21_32.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_41: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc21_41: init type = call constants.%Int(%.loc21_41) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_46: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc21_46: init type = call constants.%Int(%.loc21_46) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_49.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc21_41, %int.make_type_signed.loc21_46) +// CHECK:STDOUT: %.loc21_49.2: type = value_of_initializer %int.make_type_signed.loc21_41 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_49.3: type = converted %int.make_type_signed.loc21_41, %.loc21_49.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_49.4: type = value_of_initializer %int.make_type_signed.loc21_46 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_49.5: type = converted %int.make_type_signed.loc21_46, %.loc21_49.4 [template = constants.%i32] // CHECK:STDOUT: %.loc21_49.6: type = converted %.loc21_49.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %self.param.loc21_16: %Class = value_param runtime_param0 // CHECK:STDOUT: %self.loc21_12: %Class = bind_name self, %self.param.loc21_16 -// CHECK:STDOUT: %self.param.loc21_30: i32 = value_param runtime_param1 -// CHECK:STDOUT: %self.loc21_24: i32 = bind_name r#self, %self.param.loc21_30 +// CHECK:STDOUT: %self.param.loc21_30: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %self.loc21_24: %i32 = bind_name r#self, %self.param.loc21_30 // CHECK:STDOUT: %return.param.loc21: ref %tuple.type.2 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param.loc21 // CHECK:STDOUT: } @@ -106,51 +112,56 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %self.patt.loc17_17: %.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt.loc17_21: %.1 = value_param_pattern %self.patt.loc17_17, runtime_param0 // CHECK:STDOUT: %.loc17_12: auto = addr_pattern %self.param_patt.loc17_21 -// CHECK:STDOUT: %self.patt.loc17_30: i32 = binding_pattern r#self -// CHECK:STDOUT: %self.param_patt.loc17_36: i32 = value_param_pattern %self.patt.loc17_30, runtime_param1 +// CHECK:STDOUT: %self.patt.loc17_30: %i32 = binding_pattern r#self +// CHECK:STDOUT: %self.param_patt.loc17_36: %i32 = value_param_pattern %self.patt.loc17_30, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %.loc12_23: type = ptr_type %Class [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_34.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_34.2: type = converted %int.make_type_32.loc12, %.loc12_34.1 [template = i32] +// CHECK:STDOUT: %.loc12_34.1: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_34.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_34.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_34.3: type = converted %int.make_type_signed.loc12, %.loc12_34.2 [template = constants.%i32] // CHECK:STDOUT: %self.param.loc12_17: %.1 = value_param runtime_param0 // CHECK:STDOUT: %self.loc12_13: %.1 = bind_name self, %self.param.loc12_17 -// CHECK:STDOUT: %self.param.loc12_32: i32 = value_param runtime_param1 -// CHECK:STDOUT: %self.loc12_26: i32 = bind_name r#self, %self.param.loc12_32 +// CHECK:STDOUT: %self.param.loc12_32: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %self.loc12_26: %i32 = bind_name r#self, %self.param.loc12_32 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt.loc21_12: %Class = binding_pattern self // CHECK:STDOUT: %self.param_patt.loc21_16: %Class = value_param_pattern %self.patt.loc21_12, runtime_param0 -// CHECK:STDOUT: %self.patt.loc21_24: i32 = binding_pattern r#self -// CHECK:STDOUT: %self.param_patt.loc21_30: i32 = value_param_pattern %self.patt.loc21_24, runtime_param1 +// CHECK:STDOUT: %self.patt.loc21_24: %i32 = binding_pattern r#self +// CHECK:STDOUT: %self.param_patt.loc21_30: %i32 = value_param_pattern %self.patt.loc21_24, runtime_param1 // CHECK:STDOUT: %return.patt: %tuple.type.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %int.make_type_32.loc13_28: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_28.1: type = value_of_initializer %int.make_type_32.loc13_28 [template = i32] -// CHECK:STDOUT: %.loc13_28.2: type = converted %int.make_type_32.loc13_28, %.loc13_28.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_37: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_42: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_45.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc13_37, %int.make_type_32.loc13_42) -// CHECK:STDOUT: %.loc13_45.2: type = value_of_initializer %int.make_type_32.loc13_37 [template = i32] -// CHECK:STDOUT: %.loc13_45.3: type = converted %int.make_type_32.loc13_37, %.loc13_45.2 [template = i32] -// CHECK:STDOUT: %.loc13_45.4: type = value_of_initializer %int.make_type_32.loc13_42 [template = i32] -// CHECK:STDOUT: %.loc13_45.5: type = converted %int.make_type_32.loc13_42, %.loc13_45.4 [template = i32] +// CHECK:STDOUT: %.loc13_28.1: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc13_28: init type = call constants.%Int(%.loc13_28.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_28.2: type = value_of_initializer %int.make_type_signed.loc13_28 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_28.3: type = converted %int.make_type_signed.loc13_28, %.loc13_28.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_37: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc13_37: init type = call constants.%Int(%.loc13_37) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_42: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc13_42: init type = call constants.%Int(%.loc13_42) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_45.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc13_37, %int.make_type_signed.loc13_42) +// CHECK:STDOUT: %.loc13_45.2: type = value_of_initializer %int.make_type_signed.loc13_37 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_45.3: type = converted %int.make_type_signed.loc13_37, %.loc13_45.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_45.4: type = value_of_initializer %int.make_type_signed.loc13_42 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_45.5: type = converted %int.make_type_signed.loc13_42, %.loc13_45.4 [template = constants.%i32] // CHECK:STDOUT: %.loc13_45.6: type = converted %.loc13_45.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %self.param.loc13_12: %Class = value_param runtime_param0 // CHECK:STDOUT: %self.loc13_8: %Class = bind_name self, %self.param.loc13_12 -// CHECK:STDOUT: %self.param.loc13_26: i32 = value_param runtime_param1 -// CHECK:STDOUT: %self.loc13_20: i32 = bind_name r#self, %self.param.loc13_26 +// CHECK:STDOUT: %self.param.loc13_26: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %self.loc13_20: %i32 = bind_name r#self, %self.param.loc13_26 // CHECK:STDOUT: %return.param.loc13: ref %tuple.type.2 = out_param runtime_param2 // CHECK:STDOUT: %.loc13_33: ref %tuple.type.2 = return_slot %return.param.loc13 // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_32, %.loc14_10.1 [template = i32] -// CHECK:STDOUT: %.loc14_8: %.2 = field_decl n, element0 [template] -// CHECK:STDOUT: %.loc15: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc14_10.1: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_10.3: type = converted %int.make_type_signed, %.loc14_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_8: %.3 = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc15: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -159,29 +170,29 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: .n = %.loc14_8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[addr %self.param_patt.loc17_21: %.1](%self.param_patt.loc17_36: i32) { +// CHECK:STDOUT: fn @F[addr %self.param_patt.loc17_21: %.1](%self.param_patt.loc17_36: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref.loc18_5: %.1 = name_ref self, %self.loc17_17 // CHECK:STDOUT: %.loc18_4: ref %Class = deref %self.ref.loc18_5 -// CHECK:STDOUT: %n.ref: %.2 = name_ref n, @Class.%.loc14_8 [template = @Class.%.loc14_8] -// CHECK:STDOUT: %.loc18_10: ref i32 = class_element_access %.loc18_4, element0 -// CHECK:STDOUT: %self.ref.loc18_15: i32 = name_ref r#self, %self.loc17_30 +// CHECK:STDOUT: %n.ref: %.3 = name_ref n, @Class.%.loc14_8 [template = @Class.%.loc14_8] +// CHECK:STDOUT: %.loc18_10: ref %i32 = class_element_access %.loc18_4, element0 +// CHECK:STDOUT: %self.ref.loc18_15: %i32 = name_ref r#self, %self.loc17_30 // CHECK:STDOUT: assign %.loc18_10, %self.ref.loc18_15 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[%self.param_patt.loc21_16: %Class](%self.param_patt.loc21_30: i32) -> %return: %tuple.type.2 { +// CHECK:STDOUT: fn @G[%self.param_patt.loc21_16: %Class](%self.param_patt.loc21_30: %i32) -> %return: %tuple.type.2 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref.loc22_11: %Class = name_ref self, %self.loc21_12 -// CHECK:STDOUT: %n.ref: %.2 = name_ref n, @Class.%.loc14_8 [template = @Class.%.loc14_8] -// CHECK:STDOUT: %.loc22_15.1: ref i32 = class_element_access %self.ref.loc22_11, element0 -// CHECK:STDOUT: %.loc22_15.2: i32 = bind_value %.loc22_15.1 -// CHECK:STDOUT: %self.ref.loc22_19: i32 = name_ref r#self, %self.loc21_24 +// CHECK:STDOUT: %n.ref: %.3 = name_ref n, @Class.%.loc14_8 [template = @Class.%.loc14_8] +// CHECK:STDOUT: %.loc22_15.1: ref %i32 = class_element_access %self.ref.loc22_11, element0 +// CHECK:STDOUT: %.loc22_15.2: %i32 = bind_value %.loc22_15.1 +// CHECK:STDOUT: %self.ref.loc22_19: %i32 = name_ref r#self, %self.loc21_24 // CHECK:STDOUT: %.loc22_25.1: %tuple.type.2 = tuple_literal (%.loc22_15.2, %self.ref.loc22_19) -// CHECK:STDOUT: %.loc22_25.2: ref i32 = tuple_access %return, element0 -// CHECK:STDOUT: %.loc22_25.3: init i32 = initialize_from %.loc22_15.2 to %.loc22_25.2 -// CHECK:STDOUT: %.loc22_25.4: ref i32 = tuple_access %return, element1 -// CHECK:STDOUT: %.loc22_25.5: init i32 = initialize_from %self.ref.loc22_19 to %.loc22_25.4 +// CHECK:STDOUT: %.loc22_25.2: ref %i32 = tuple_access %return, element0 +// CHECK:STDOUT: %.loc22_25.3: init %i32 = initialize_from %.loc22_15.2 to %.loc22_25.2 +// CHECK:STDOUT: %.loc22_25.4: ref %i32 = tuple_access %return, element1 +// CHECK:STDOUT: %.loc22_25.5: init %i32 = initialize_from %self.ref.loc22_19 to %.loc22_25.4 // CHECK:STDOUT: %.loc22_25.6: init %tuple.type.2 = tuple_init (%.loc22_25.3, %.loc22_25.5) to %return // CHECK:STDOUT: %.loc22_26: init %tuple.type.2 = converted %.loc22_25.1, %.loc22_25.6 // CHECK:STDOUT: return %.loc22_26 to %return diff --git a/toolchain/check/testdata/class/reenter_scope.carbon b/toolchain/check/testdata/class/reenter_scope.carbon index 1d577be16c5d..0901d7c07f39 100644 --- a/toolchain/check/testdata/class/reenter_scope.carbon +++ b/toolchain/check/testdata/class/reenter_scope.carbon @@ -22,19 +22,21 @@ fn Class.F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -48,39 +50,42 @@ fn Class.F() -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_17.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] -// CHECK:STDOUT: %.loc16_17.2: type = converted %int.make_type_32.loc16, %.loc16_17.1 [template = i32] -// CHECK:STDOUT: %return.param.loc16: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param.loc16 +// CHECK:STDOUT: %.loc16_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%.loc16_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_17.2: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_17.3: type = converted %int.make_type_signed.loc16, %.loc16_17.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param.loc16: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32.loc12, %.loc12_13.1 [template = i32] -// CHECK:STDOUT: %return.param.loc12: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %.loc12_10: ref i32 = return_slot %return.param.loc12 +// CHECK:STDOUT: %.loc12_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_signed.loc12, %.loc12_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param.loc12: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %.loc12_10: ref %i32 = return_slot %return.param.loc12 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32, %.loc13_13.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc13_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_13.3: type = converted %int.make_type_signed, %.loc13_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc14: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -88,17 +93,17 @@ fn Class.F() -> i32 { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32 { +// CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %G.ref.loc17: %G.type = name_ref G, @Class.%G.decl [template = constants.%G] -// CHECK:STDOUT: %G.call.loc17: init i32 = call %G.ref.loc17() +// CHECK:STDOUT: %G.call.loc17: init %i32 = call %G.ref.loc17() // CHECK:STDOUT: %G.ref.loc18: %G.type = name_ref G, @Class.%G.decl [template = constants.%G] -// CHECK:STDOUT: %G.call.loc18: init i32 = call %G.ref.loc18() -// CHECK:STDOUT: %.loc18_13.1: i32 = value_of_initializer %G.call.loc18 -// CHECK:STDOUT: %.loc18_13.2: i32 = converted %G.call.loc18, %.loc18_13.1 +// CHECK:STDOUT: %G.call.loc18: init %i32 = call %G.ref.loc18() +// CHECK:STDOUT: %.loc18_13.1: %i32 = value_of_initializer %G.call.loc18 +// CHECK:STDOUT: %.loc18_13.2: %i32 = converted %G.call.loc18, %.loc18_13.1 // CHECK:STDOUT: return %.loc18_13.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> i32; +// CHECK:STDOUT: fn @G() -> %i32; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/reorder.carbon b/toolchain/check/testdata/class/reorder.carbon index d6c39c865708..1c56492877ba 100644 --- a/toolchain/check/testdata/class/reorder.carbon +++ b/toolchain/check/testdata/class/reorder.carbon @@ -22,26 +22,29 @@ class Class { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.29: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 1 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.26: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.27: = specific_function %.26, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.28: %i32 = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -59,26 +62,28 @@ class Class { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32, %.loc12_13.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc12_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_signed, %.loc12_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_32, %.loc16_13.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc16_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc16_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc16_13.3: type = converted %int.make_type_signed, %.loc16_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc19: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -86,24 +91,25 @@ class Class { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> i32 { +// CHECK:STDOUT: fn @G() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %F.ref: %F.type = name_ref F, @Class.%F.decl [template = constants.%F] -// CHECK:STDOUT: %F.call: init i32 = call %F.ref() -// CHECK:STDOUT: %.loc13_21.1: i32 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc13_21.2: i32 = converted %F.call, %.loc13_21.1 +// CHECK:STDOUT: %F.call: init %i32 = call %F.ref() +// CHECK:STDOUT: %.loc13_21.1: %i32 = value_of_initializer %F.call +// CHECK:STDOUT: %.loc13_21.2: %i32 = converted %F.call, %.loc13_21.1 // CHECK:STDOUT: return %.loc13_21.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32 { +// CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc17_12: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc17_13.1: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc17_13.2: = bound_method %.loc17_12, %.loc17_13.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc17_13.2(%.loc17_12) [template = constants.%.30] -// CHECK:STDOUT: %.loc17_13.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.30] -// CHECK:STDOUT: %.loc17_13.4: i32 = converted %.loc17_12, %.loc17_13.3 [template = constants.%.30] -// CHECK:STDOUT: return %.loc17_13.4 +// CHECK:STDOUT: %.loc17_12: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc17_13.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc17_13.2: = bound_method %.loc17_12, %.loc17_13.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc17_13.3: = specific_function %.loc17_13.2, @Convert.2(constants.%.1) [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc17_13.3(%.loc17_12) [template = constants.%.28] +// CHECK:STDOUT: %.loc17_13.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.28] +// CHECK:STDOUT: %.loc17_13.5: %i32 = converted %.loc17_12, %.loc17_13.4 [template = constants.%.28] +// CHECK:STDOUT: return %.loc17_13.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/reorder_qualified.carbon b/toolchain/check/testdata/class/reorder_qualified.carbon index 33f813f3c4d8..30712a778cac 100644 --- a/toolchain/check/testdata/class/reorder_qualified.carbon +++ b/toolchain/check/testdata/class/reorder_qualified.carbon @@ -55,58 +55,64 @@ class A { // CHECK:STDOUT: %BF.type: type = fn_type @BF [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %BF: %BF.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %B, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.b: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %B, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.b: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %DF.type: type = fn_type @DF [template] // CHECK:STDOUT: %DF: %DF.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %D, i32 [template] -// CHECK:STDOUT: %.5: type = struct_type {.d: i32} [template] -// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %D, %i32 [template] +// CHECK:STDOUT: %.6: type = struct_type {.d: %i32} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: %CF.type: type = fn_type @CF [template] // CHECK:STDOUT: %CF: %CF.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = unbound_element_type %C, i32 [template] -// CHECK:STDOUT: %.8: type = struct_type {.c: i32} [template] -// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] +// CHECK:STDOUT: %.8: type = unbound_element_type %C, %i32 [template] +// CHECK:STDOUT: %.9: type = struct_type {.c: %i32} [template] +// CHECK:STDOUT: %.10: = complete_type_witness %.9 [template] // CHECK:STDOUT: %AF.type: type = fn_type @AF [template] // CHECK:STDOUT: %AF: %AF.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = unbound_element_type %A, i32 [template] -// CHECK:STDOUT: %.11: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.12: = complete_type_witness %.11 [template] -// CHECK:STDOUT: %.14: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.15: type = struct_type {.a: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.39: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.40: = bound_method %.14, %Convert.15 [template] -// CHECK:STDOUT: %.41: i32 = int_value 1 [template] -// CHECK:STDOUT: %struct.1: %A = struct_value (%.41) [template] -// CHECK:STDOUT: %.43: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.44: type = struct_type {.b: Core.IntLiteral} [template] -// CHECK:STDOUT: %.45: = bound_method %.43, %Convert.15 [template] -// CHECK:STDOUT: %.46: i32 = int_value 2 [template] -// CHECK:STDOUT: %struct.2: %B = struct_value (%.46) [template] -// CHECK:STDOUT: %.48: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.49: type = struct_type {.c: Core.IntLiteral} [template] -// CHECK:STDOUT: %.50: = bound_method %.48, %Convert.15 [template] -// CHECK:STDOUT: %.51: i32 = int_value 3 [template] +// CHECK:STDOUT: %.11: type = unbound_element_type %A, %i32 [template] +// CHECK:STDOUT: %.12: type = struct_type {.a: %i32} [template] +// CHECK:STDOUT: %.13: = complete_type_witness %.12 [template] +// CHECK:STDOUT: %.15: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.16: type = struct_type {.a: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.36: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.37: = bound_method %.15, %Convert.14 [template] +// CHECK:STDOUT: %.38: = specific_function %.37, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.39: %i32 = int_value 1 [template] +// CHECK:STDOUT: %struct.1: %A = struct_value (%.39) [template] +// CHECK:STDOUT: %.41: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.42: type = struct_type {.b: Core.IntLiteral} [template] +// CHECK:STDOUT: %.43: = bound_method %.41, %Convert.14 [template] +// CHECK:STDOUT: %.44: = specific_function %.43, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.45: %i32 = int_value 2 [template] +// CHECK:STDOUT: %struct.2: %B = struct_value (%.45) [template] +// CHECK:STDOUT: %.47: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.48: type = struct_type {.c: Core.IntLiteral} [template] +// CHECK:STDOUT: %.49: = bound_method %.47, %Convert.14 [template] +// CHECK:STDOUT: %.50: = specific_function %.49, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.51: %i32 = int_value 3 [template] // CHECK:STDOUT: %struct.3: %C = struct_value (%.51) [template] // CHECK:STDOUT: %.53: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %.54: type = struct_type {.d: Core.IntLiteral} [template] -// CHECK:STDOUT: %.55: = bound_method %.53, %Convert.15 [template] -// CHECK:STDOUT: %.56: i32 = int_value 4 [template] -// CHECK:STDOUT: %struct.4: %D = struct_value (%.56) [template] +// CHECK:STDOUT: %.55: = bound_method %.53, %Convert.14 [template] +// CHECK:STDOUT: %.56: = specific_function %.55, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.57: %i32 = int_value 4 [template] +// CHECK:STDOUT: %struct.4: %D = struct_value (%.57) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -126,11 +132,12 @@ class A { // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %AF.decl: %AF.type = fn_decl @AF [template = constants.%AF] {} {} -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc46_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc46_10.2: type = converted %int.make_type_32, %.loc46_10.1 [template = i32] -// CHECK:STDOUT: %.loc46_8: %.10 = field_decl a, element0 [template] -// CHECK:STDOUT: %.loc47: = complete_type_witness %.11 [template = constants.%.12] +// CHECK:STDOUT: %.loc46_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc46_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc46_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc46_10.3: type = converted %int.make_type_signed, %.loc46_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc46_8: %.11 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc47: = complete_type_witness %.12 [template = constants.%.13] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -142,11 +149,12 @@ class A { // CHECK:STDOUT: class @B { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %BF.decl: %BF.type = fn_decl @BF [template = constants.%BF] {} {} -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_12.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_12.2: type = converted %int.make_type_32, %.loc16_12.1 [template = i32] -// CHECK:STDOUT: %.loc16_10: %.1 = field_decl b, element0 [template] -// CHECK:STDOUT: %.loc17: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc16_12.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc16_12.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_12.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc16_12.3: type = converted %int.make_type_signed, %.loc16_12.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_10: %.2 = field_decl b, element0 [template] +// CHECK:STDOUT: %.loc17: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -159,11 +167,12 @@ class A { // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %DF.decl: %DF.type = fn_decl @DF [template = constants.%DF] {} {} // CHECK:STDOUT: %CF.decl: %CF.type = fn_decl @CF [template = constants.%CF] {} {} -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc42_12.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc42_12.2: type = converted %int.make_type_32, %.loc42_12.1 [template = i32] -// CHECK:STDOUT: %.loc42_10: %.7 = field_decl c, element0 [template] -// CHECK:STDOUT: %.loc43: = complete_type_witness %.8 [template = constants.%.9] +// CHECK:STDOUT: %.loc42_12.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc42_12.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc42_12.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc42_12.3: type = converted %int.make_type_signed, %.loc42_12.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc42_10: %.8 = field_decl c, element0 [template] +// CHECK:STDOUT: %.loc43: = complete_type_witness %.9 [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -175,11 +184,12 @@ class A { // CHECK:STDOUT: class @D { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %DF.decl: %DF.type = fn_decl @DF [template = constants.%DF] {} {} -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc24_14.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc24_14.2: type = converted %int.make_type_32, %.loc24_14.1 [template = i32] -// CHECK:STDOUT: %.loc24_12: %.4 = field_decl d, element0 [template] -// CHECK:STDOUT: %.loc25: = complete_type_witness %.5 [template = constants.%.6] +// CHECK:STDOUT: %.loc24_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc24_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc24_14.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc24_14.3: type = converted %int.make_type_signed, %.loc24_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc24_12: %.5 = field_decl d, element0 [template] +// CHECK:STDOUT: %.loc25: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D @@ -197,58 +207,62 @@ class A { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %a.var: ref %A = var a // CHECK:STDOUT: %a: ref %A = bind_name a, %a.var -// CHECK:STDOUT: %.loc29_24: Core.IntLiteral = int_value 1 [template = constants.%.14] -// CHECK:STDOUT: %.loc29_25.1: %.15 = struct_literal (%.loc29_24) -// CHECK:STDOUT: %.loc29_25.2: %Convert.type.2 = interface_witness_access constants.%.39, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc29_25.3: = bound_method %.loc29_24, %.loc29_25.2 [template = constants.%.40] -// CHECK:STDOUT: %int.convert_checked.loc29: init i32 = call %.loc29_25.3(%.loc29_24) [template = constants.%.41] -// CHECK:STDOUT: %.loc29_25.4: init i32 = converted %.loc29_24, %int.convert_checked.loc29 [template = constants.%.41] -// CHECK:STDOUT: %.loc29_25.5: ref i32 = class_element_access %a.var, element0 -// CHECK:STDOUT: %.loc29_25.6: init i32 = initialize_from %.loc29_25.4 to %.loc29_25.5 [template = constants.%.41] -// CHECK:STDOUT: %.loc29_25.7: init %A = class_init (%.loc29_25.6), %a.var [template = constants.%struct.1] -// CHECK:STDOUT: %.loc29_26: init %A = converted %.loc29_25.1, %.loc29_25.7 [template = constants.%struct.1] +// CHECK:STDOUT: %.loc29_24: Core.IntLiteral = int_value 1 [template = constants.%.15] +// CHECK:STDOUT: %.loc29_25.1: %.16 = struct_literal (%.loc29_24) +// CHECK:STDOUT: %.loc29_25.2: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc29_25.3: = bound_method %.loc29_24, %.loc29_25.2 [template = constants.%.37] +// CHECK:STDOUT: %.loc29_25.4: = specific_function %.loc29_25.3, @Convert.2(constants.%.1) [template = constants.%.38] +// CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %.loc29_25.4(%.loc29_24) [template = constants.%.39] +// CHECK:STDOUT: %.loc29_25.5: init %i32 = converted %.loc29_24, %int.convert_checked.loc29 [template = constants.%.39] +// CHECK:STDOUT: %.loc29_25.6: ref %i32 = class_element_access %a.var, element0 +// CHECK:STDOUT: %.loc29_25.7: init %i32 = initialize_from %.loc29_25.5 to %.loc29_25.6 [template = constants.%.39] +// CHECK:STDOUT: %.loc29_25.8: init %A = class_init (%.loc29_25.7), %a.var [template = constants.%struct.1] +// CHECK:STDOUT: %.loc29_26: init %A = converted %.loc29_25.1, %.loc29_25.8 [template = constants.%struct.1] // CHECK:STDOUT: assign %a.var, %.loc29_26 // CHECK:STDOUT: %B.ref: type = name_ref B, @A.%B.decl [template = constants.%B] // CHECK:STDOUT: %b.var: ref %B = var b // CHECK:STDOUT: %b: ref %B = bind_name b, %b.var -// CHECK:STDOUT: %.loc30_24: Core.IntLiteral = int_value 2 [template = constants.%.43] -// CHECK:STDOUT: %.loc30_25.1: %.44 = struct_literal (%.loc30_24) -// CHECK:STDOUT: %.loc30_25.2: %Convert.type.2 = interface_witness_access constants.%.39, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc30_25.3: = bound_method %.loc30_24, %.loc30_25.2 [template = constants.%.45] -// CHECK:STDOUT: %int.convert_checked.loc30: init i32 = call %.loc30_25.3(%.loc30_24) [template = constants.%.46] -// CHECK:STDOUT: %.loc30_25.4: init i32 = converted %.loc30_24, %int.convert_checked.loc30 [template = constants.%.46] -// CHECK:STDOUT: %.loc30_25.5: ref i32 = class_element_access %b.var, element0 -// CHECK:STDOUT: %.loc30_25.6: init i32 = initialize_from %.loc30_25.4 to %.loc30_25.5 [template = constants.%.46] -// CHECK:STDOUT: %.loc30_25.7: init %B = class_init (%.loc30_25.6), %b.var [template = constants.%struct.2] -// CHECK:STDOUT: %.loc30_26: init %B = converted %.loc30_25.1, %.loc30_25.7 [template = constants.%struct.2] +// CHECK:STDOUT: %.loc30_24: Core.IntLiteral = int_value 2 [template = constants.%.41] +// CHECK:STDOUT: %.loc30_25.1: %.42 = struct_literal (%.loc30_24) +// CHECK:STDOUT: %.loc30_25.2: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc30_25.3: = bound_method %.loc30_24, %.loc30_25.2 [template = constants.%.43] +// CHECK:STDOUT: %.loc30_25.4: = specific_function %.loc30_25.3, @Convert.2(constants.%.1) [template = constants.%.44] +// CHECK:STDOUT: %int.convert_checked.loc30: init %i32 = call %.loc30_25.4(%.loc30_24) [template = constants.%.45] +// CHECK:STDOUT: %.loc30_25.5: init %i32 = converted %.loc30_24, %int.convert_checked.loc30 [template = constants.%.45] +// CHECK:STDOUT: %.loc30_25.6: ref %i32 = class_element_access %b.var, element0 +// CHECK:STDOUT: %.loc30_25.7: init %i32 = initialize_from %.loc30_25.5 to %.loc30_25.6 [template = constants.%.45] +// CHECK:STDOUT: %.loc30_25.8: init %B = class_init (%.loc30_25.7), %b.var [template = constants.%struct.2] +// CHECK:STDOUT: %.loc30_26: init %B = converted %.loc30_25.1, %.loc30_25.8 [template = constants.%struct.2] // CHECK:STDOUT: assign %b.var, %.loc30_26 // CHECK:STDOUT: %C.ref: type = name_ref C, @B.%C.decl [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var -// CHECK:STDOUT: %.loc31_24: Core.IntLiteral = int_value 3 [template = constants.%.48] -// CHECK:STDOUT: %.loc31_25.1: %.49 = struct_literal (%.loc31_24) -// CHECK:STDOUT: %.loc31_25.2: %Convert.type.2 = interface_witness_access constants.%.39, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc31_25.3: = bound_method %.loc31_24, %.loc31_25.2 [template = constants.%.50] -// CHECK:STDOUT: %int.convert_checked.loc31: init i32 = call %.loc31_25.3(%.loc31_24) [template = constants.%.51] -// CHECK:STDOUT: %.loc31_25.4: init i32 = converted %.loc31_24, %int.convert_checked.loc31 [template = constants.%.51] -// CHECK:STDOUT: %.loc31_25.5: ref i32 = class_element_access %c.var, element0 -// CHECK:STDOUT: %.loc31_25.6: init i32 = initialize_from %.loc31_25.4 to %.loc31_25.5 [template = constants.%.51] -// CHECK:STDOUT: %.loc31_25.7: init %C = class_init (%.loc31_25.6), %c.var [template = constants.%struct.3] -// CHECK:STDOUT: %.loc31_26: init %C = converted %.loc31_25.1, %.loc31_25.7 [template = constants.%struct.3] +// CHECK:STDOUT: %.loc31_24: Core.IntLiteral = int_value 3 [template = constants.%.47] +// CHECK:STDOUT: %.loc31_25.1: %.48 = struct_literal (%.loc31_24) +// CHECK:STDOUT: %.loc31_25.2: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc31_25.3: = bound_method %.loc31_24, %.loc31_25.2 [template = constants.%.49] +// CHECK:STDOUT: %.loc31_25.4: = specific_function %.loc31_25.3, @Convert.2(constants.%.1) [template = constants.%.50] +// CHECK:STDOUT: %int.convert_checked.loc31: init %i32 = call %.loc31_25.4(%.loc31_24) [template = constants.%.51] +// CHECK:STDOUT: %.loc31_25.5: init %i32 = converted %.loc31_24, %int.convert_checked.loc31 [template = constants.%.51] +// CHECK:STDOUT: %.loc31_25.6: ref %i32 = class_element_access %c.var, element0 +// CHECK:STDOUT: %.loc31_25.7: init %i32 = initialize_from %.loc31_25.5 to %.loc31_25.6 [template = constants.%.51] +// CHECK:STDOUT: %.loc31_25.8: init %C = class_init (%.loc31_25.7), %c.var [template = constants.%struct.3] +// CHECK:STDOUT: %.loc31_26: init %C = converted %.loc31_25.1, %.loc31_25.8 [template = constants.%struct.3] // CHECK:STDOUT: assign %c.var, %.loc31_26 // CHECK:STDOUT: %D.ref: type = name_ref D, @C.%D.decl [template = constants.%D] // CHECK:STDOUT: %d.var: ref %D = var d // CHECK:STDOUT: %d: ref %D = bind_name d, %d.var // CHECK:STDOUT: %.loc32_24: Core.IntLiteral = int_value 4 [template = constants.%.53] // CHECK:STDOUT: %.loc32_25.1: %.54 = struct_literal (%.loc32_24) -// CHECK:STDOUT: %.loc32_25.2: %Convert.type.2 = interface_witness_access constants.%.39, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc32_25.2: %Convert.type.2 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.14] // CHECK:STDOUT: %.loc32_25.3: = bound_method %.loc32_24, %.loc32_25.2 [template = constants.%.55] -// CHECK:STDOUT: %int.convert_checked.loc32: init i32 = call %.loc32_25.3(%.loc32_24) [template = constants.%.56] -// CHECK:STDOUT: %.loc32_25.4: init i32 = converted %.loc32_24, %int.convert_checked.loc32 [template = constants.%.56] -// CHECK:STDOUT: %.loc32_25.5: ref i32 = class_element_access %d.var, element0 -// CHECK:STDOUT: %.loc32_25.6: init i32 = initialize_from %.loc32_25.4 to %.loc32_25.5 [template = constants.%.56] -// CHECK:STDOUT: %.loc32_25.7: init %D = class_init (%.loc32_25.6), %d.var [template = constants.%struct.4] -// CHECK:STDOUT: %.loc32_26: init %D = converted %.loc32_25.1, %.loc32_25.7 [template = constants.%struct.4] +// CHECK:STDOUT: %.loc32_25.4: = specific_function %.loc32_25.3, @Convert.2(constants.%.1) [template = constants.%.56] +// CHECK:STDOUT: %int.convert_checked.loc32: init %i32 = call %.loc32_25.4(%.loc32_24) [template = constants.%.57] +// CHECK:STDOUT: %.loc32_25.5: init %i32 = converted %.loc32_24, %int.convert_checked.loc32 [template = constants.%.57] +// CHECK:STDOUT: %.loc32_25.6: ref %i32 = class_element_access %d.var, element0 +// CHECK:STDOUT: %.loc32_25.7: init %i32 = initialize_from %.loc32_25.5 to %.loc32_25.6 [template = constants.%.57] +// CHECK:STDOUT: %.loc32_25.8: init %D = class_init (%.loc32_25.7), %d.var [template = constants.%struct.4] +// CHECK:STDOUT: %.loc32_26: init %D = converted %.loc32_25.1, %.loc32_25.8 [template = constants.%struct.4] // CHECK:STDOUT: assign %d.var, %.loc32_26 // CHECK:STDOUT: %AF.ref: %AF.type = name_ref AF, @A.%AF.decl [template = constants.%AF] // CHECK:STDOUT: %AF.call: init %empty_tuple.type = call %AF.ref() diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index 403876c6bfdc..5f4e203d00e6 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -31,33 +31,37 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 1 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 1 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.31: = bound_method %.30, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 2 [template] +// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.14 [template] +// CHECK:STDOUT: %.30: = specific_function %.29, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.31: %i32 = int_value 2 [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -74,40 +78,43 @@ fn Run() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc21_11.2: type = converted %int.make_type_32, %.loc21_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc21_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc21_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc21_11.3: type = converted %int.make_type_signed, %.loc21_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32, %.loc12_13.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc12_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_signed, %.loc12_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_32, %.loc16_13.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc16_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc16_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc16_13.3: type = converted %int.make_type_signed, %.loc16_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc19: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -115,55 +122,59 @@ fn Run() { // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.1() -> i32 { +// CHECK:STDOUT: fn @F.1() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc13_12: Core.IntLiteral = int_value 1 [template = constants.%.3] -// CHECK:STDOUT: %.loc13_13.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_13.2: = bound_method %.loc13_12, %.loc13_13.1 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc13_13.2(%.loc13_12) [template = constants.%.29] -// CHECK:STDOUT: %.loc13_13.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.29] -// CHECK:STDOUT: %.loc13_13.4: i32 = converted %.loc13_12, %.loc13_13.3 [template = constants.%.29] -// CHECK:STDOUT: return %.loc13_13.4 +// CHECK:STDOUT: %.loc13_12: Core.IntLiteral = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc13_13.1: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_13.2: = bound_method %.loc13_12, %.loc13_13.1 [template = constants.%.25] +// CHECK:STDOUT: %.loc13_13.3: = specific_function %.loc13_13.2, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc13_13.3(%.loc13_12) [template = constants.%.27] +// CHECK:STDOUT: %.loc13_13.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc13_13.5: %i32 = converted %.loc13_12, %.loc13_13.4 [template = constants.%.27] +// CHECK:STDOUT: return %.loc13_13.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> i32 { +// CHECK:STDOUT: fn @G() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type.1 = name_ref F, @Class.%F.decl [template = constants.%F.1] -// CHECK:STDOUT: %F.call: init i32 = call %F.ref() -// CHECK:STDOUT: %.loc17_15.1: i32 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc17_15.2: i32 = converted %F.call, %.loc17_15.1 +// CHECK:STDOUT: %F.call: init %i32 = call %F.ref() +// CHECK:STDOUT: %.loc17_15.1: %i32 = value_of_initializer %F.call +// CHECK:STDOUT: %.loc17_15.2: %i32 = converted %F.call, %.loc17_15.1 // CHECK:STDOUT: return %.loc17_15.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2() -> i32 { +// CHECK:STDOUT: fn @F.2() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc22_10: Core.IntLiteral = int_value 2 [template = constants.%.30] -// CHECK:STDOUT: %.loc22_11.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc22_11.2: = bound_method %.loc22_10, %.loc22_11.1 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc22_11.2(%.loc22_10) [template = constants.%.32] -// CHECK:STDOUT: %.loc22_11.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.32] -// CHECK:STDOUT: %.loc22_11.4: i32 = converted %.loc22_10, %.loc22_11.3 [template = constants.%.32] -// CHECK:STDOUT: return %.loc22_11.4 +// CHECK:STDOUT: %.loc22_10: Core.IntLiteral = int_value 2 [template = constants.%.28] +// CHECK:STDOUT: %.loc22_11.1: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc22_11.2: = bound_method %.loc22_10, %.loc22_11.1 [template = constants.%.29] +// CHECK:STDOUT: %.loc22_11.3: = specific_function %.loc22_11.2, @Convert.2(constants.%.1) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc22_11.3(%.loc22_10) [template = constants.%.31] +// CHECK:STDOUT: %.loc22_11.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.31] +// CHECK:STDOUT: %.loc22_11.5: %i32 = converted %.loc22_10, %.loc22_11.4 [template = constants.%.31] +// CHECK:STDOUT: return %.loc22_11.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc26: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc26_10.1: type = value_of_initializer %int.make_type_32.loc26 [template = i32] -// CHECK:STDOUT: %.loc26_10.2: type = converted %int.make_type_32.loc26, %.loc26_10.1 [template = i32] -// CHECK:STDOUT: %a.var: ref i32 = var a -// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var +// CHECK:STDOUT: %.loc26_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc26: init type = call constants.%Int(%.loc26_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc26_10.2: type = value_of_initializer %int.make_type_signed.loc26 [template = constants.%i32] +// CHECK:STDOUT: %.loc26_10.3: type = converted %int.make_type_signed.loc26, %.loc26_10.2 [template = constants.%i32] +// CHECK:STDOUT: %a.var: ref %i32 = var a +// CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %F.ref.loc26: %F.type.2 = name_ref F, file.%F.decl [template = constants.%F.2] -// CHECK:STDOUT: %F.call.loc26: init i32 = call %F.ref.loc26() +// CHECK:STDOUT: %F.call.loc26: init %i32 = call %F.ref.loc26() // CHECK:STDOUT: assign %a.var, %F.call.loc26 -// CHECK:STDOUT: %int.make_type_32.loc27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc27_10.1: type = value_of_initializer %int.make_type_32.loc27 [template = i32] -// CHECK:STDOUT: %.loc27_10.2: type = converted %int.make_type_32.loc27, %.loc27_10.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc27_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc27: init type = call constants.%Int(%.loc27_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc27_10.2: type = value_of_initializer %int.make_type_signed.loc27 [template = constants.%i32] +// CHECK:STDOUT: %.loc27_10.3: type = converted %int.make_type_signed.loc27, %.loc27_10.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %F.ref.loc27: %F.type.1 = name_ref F, @Class.%F.decl [template = constants.%F.1] -// CHECK:STDOUT: %F.call.loc27: init i32 = call %F.ref.loc27() +// CHECK:STDOUT: %F.call.loc27: init %i32 = call %F.ref.loc27() // CHECK:STDOUT: assign %b.var, %F.call.loc27 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/self.carbon b/toolchain/check/testdata/class/self.carbon index 8909a126f23a..7375e785af5e 100644 --- a/toolchain/check/testdata/class/self.carbon +++ b/toolchain/check/testdata/class/self.carbon @@ -45,21 +45,23 @@ class Class { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = ptr_type %Class [template] +// CHECK:STDOUT: %.2: type = ptr_type %Class [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = unbound_element_type %Class, i32 [template] -// CHECK:STDOUT: %.3: type = struct_type {.n: i32} [template] -// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.3: type = unbound_element_type %Class, %i32 [template] +// CHECK:STDOUT: %.4: type = struct_type {.n: %i32} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -75,34 +77,36 @@ class Class { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Class = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc11: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_29.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_29.2: type = converted %int.make_type_32.loc11, %.loc11_29.1 [template = i32] +// CHECK:STDOUT: %.loc11_29.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_29.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_29.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_29.3: type = converted %int.make_type_signed.loc11, %.loc11_29.2 [template = constants.%i32] // CHECK:STDOUT: %self.param.loc11: %Class = value_param runtime_param0 // CHECK:STDOUT: %self.loc11: %Class = bind_name self, %self.param.loc11 -// CHECK:STDOUT: %return.param.loc11: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param.loc11 +// CHECK:STDOUT: %return.param.loc11: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param.loc11 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %self.patt: %.1 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %.1 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %self.patt: %.2 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.2 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc15_12: auto = addr_pattern %self.param_patt -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc15: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %.loc15_27: type = ptr_type %Class [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_35.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_35.2: type = converted %int.make_type_32.loc15, %.loc15_35.1 [template = i32] -// CHECK:STDOUT: %self.param.loc15: %.1 = value_param runtime_param0 -// CHECK:STDOUT: %self.loc15: %.1 = bind_name self, %self.param.loc15 -// CHECK:STDOUT: %return.param.loc15: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param.loc15 +// CHECK:STDOUT: %.loc15_27: type = ptr_type %Class [template = constants.%.2] +// CHECK:STDOUT: %.loc15_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_35.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_35.3: type = converted %int.make_type_signed.loc15, %.loc15_35.2 [template = constants.%i32] +// CHECK:STDOUT: %self.param.loc15: %.2 = value_param runtime_param0 +// CHECK:STDOUT: %self.loc15: %.2 = bind_name self, %self.param.loc15 +// CHECK:STDOUT: %return.param.loc15: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param.loc15 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -110,40 +114,43 @@ class Class { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Class = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc5: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_25.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_25.2: type = converted %int.make_type_32.loc5, %.loc5_25.1 [template = i32] +// CHECK:STDOUT: %.loc5_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_25.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_25.3: type = converted %int.make_type_signed.loc5, %.loc5_25.2 [template = constants.%i32] // CHECK:STDOUT: %self.param.loc5: %Class = value_param runtime_param0 // CHECK:STDOUT: %self.loc5: %Class = bind_name self, %self.param.loc5 -// CHECK:STDOUT: %return.param.loc5: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %.loc5_22: ref i32 = return_slot %return.param.loc5 +// CHECK:STDOUT: %return.param.loc5: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %.loc5_22: ref %i32 = return_slot %return.param.loc5 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %self.patt: %.1 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %.1 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %self.patt: %.2 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.2 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc15_12: auto = addr_pattern %self.param_patt -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc6: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %.loc6_23: type = ptr_type %Class [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_31.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_31.2: type = converted %int.make_type_32.loc6, %.loc6_31.1 [template = i32] -// CHECK:STDOUT: %self.param.loc6: %.1 = value_param runtime_param0 -// CHECK:STDOUT: %self.loc6: %.1 = bind_name self, %self.param.loc6 -// CHECK:STDOUT: %return.param.loc6: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %.loc6_28: ref i32 = return_slot %return.param.loc6 +// CHECK:STDOUT: %.loc6_23: type = ptr_type %Class [template = constants.%.2] +// CHECK:STDOUT: %.loc6_31.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_31.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_31.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_31.3: type = converted %int.make_type_signed.loc6, %.loc6_31.2 [template = constants.%i32] +// CHECK:STDOUT: %self.param.loc6: %.2 = value_param runtime_param0 +// CHECK:STDOUT: %self.loc6: %.2 = bind_name self, %self.param.loc6 +// CHECK:STDOUT: %return.param.loc6: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %.loc6_28: ref %i32 = return_slot %return.param.loc6 // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_10.2: type = converted %int.make_type_32, %.loc8_10.1 [template = i32] -// CHECK:STDOUT: %.loc8_8: %.2 = field_decl n, element0 [template] -// CHECK:STDOUT: %.loc9: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc8_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_10.3: type = converted %int.make_type_signed, %.loc8_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8: %.3 = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc9: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -152,22 +159,22 @@ class Class { // CHECK:STDOUT: .n = %.loc8_8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[%self.param_patt: %Class]() -> i32 { +// CHECK:STDOUT: fn @F[%self.param_patt: %Class]() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Class = name_ref self, %self.loc11 -// CHECK:STDOUT: %n.ref: %.2 = name_ref n, @Class.%.loc8_8 [template = @Class.%.loc8_8] -// CHECK:STDOUT: %.loc12_14.1: ref i32 = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc12_14.2: i32 = bind_value %.loc12_14.1 +// CHECK:STDOUT: %n.ref: %.3 = name_ref n, @Class.%.loc8_8 [template = @Class.%.loc8_8] +// CHECK:STDOUT: %.loc12_14.1: ref %i32 = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc12_14.2: %i32 = bind_value %.loc12_14.1 // CHECK:STDOUT: return %.loc12_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr %self.param_patt: %.1]() -> i32 { +// CHECK:STDOUT: fn @G[addr %self.param_patt: %.2]() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %.1 = name_ref self, %self.loc15 +// CHECK:STDOUT: %self.ref: %.2 = name_ref self, %self.loc15 // CHECK:STDOUT: %.loc16_11: ref %Class = deref %self.ref -// CHECK:STDOUT: %n.ref: %.2 = name_ref n, @Class.%.loc8_8 [template = @Class.%.loc8_8] -// CHECK:STDOUT: %.loc16_17.1: ref i32 = class_element_access %.loc16_11, element0 -// CHECK:STDOUT: %.loc16_17.2: i32 = bind_value %.loc16_17.1 +// CHECK:STDOUT: %n.ref: %.3 = name_ref n, @Class.%.loc8_8 [template = @Class.%.loc8_8] +// CHECK:STDOUT: %.loc16_17.1: ref %i32 = class_element_access %.loc16_11, element0 +// CHECK:STDOUT: %.loc16_17.2: %i32 = bind_value %.loc16_17.1 // CHECK:STDOUT: return %.loc16_17.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -177,8 +184,8 @@ class Class { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.26: type = struct_type {} [template] -// CHECK:STDOUT: %.27: = complete_type_witness %.26 [template] +// CHECK:STDOUT: %.20: type = struct_type {} [template] +// CHECK:STDOUT: %.21: = complete_type_witness %.20 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -213,7 +220,7 @@ class Class { // CHECK:STDOUT: %return.param: ref = out_param runtime_param1 // CHECK:STDOUT: %return: ref = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc12: = complete_type_witness %.26 [template = constants.%.27] +// CHECK:STDOUT: %.loc12: = complete_type_witness %.20 [template = constants.%.21] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/self_conversion.carbon b/toolchain/check/testdata/class/self_conversion.carbon index ff79b3892382..da466a408be9 100644 --- a/toolchain/check/testdata/class/self_conversion.carbon +++ b/toolchain/check/testdata/class/self_conversion.carbon @@ -36,36 +36,39 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Base: type = class_type @Base [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Base, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Base, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Derived, %Base [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, %Base [template] // CHECK:STDOUT: %SelfBase.type: type = fn_type @SelfBase [template] // CHECK:STDOUT: %SelfBase: %SelfBase.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = ptr_type %Base [template] +// CHECK:STDOUT: %.7: type = ptr_type %Base [template] // CHECK:STDOUT: %AddrSelfBase.type: type = fn_type @AddrSelfBase [template] // CHECK:STDOUT: %AddrSelfBase: %AddrSelfBase.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = struct_type {.base: %Base} [template] -// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] -// CHECK:STDOUT: %.9: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.33: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.34: = bound_method %.9, %Convert.15 [template] -// CHECK:STDOUT: %.35: i32 = int_value 1 [template] -// CHECK:STDOUT: %.36: type = ptr_type %Derived [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %Base} [template] +// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] +// CHECK:STDOUT: %.10: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.30: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.31: = bound_method %.10, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.34: type = ptr_type %Derived [template] // CHECK:STDOUT: %Call.type: type = fn_type @Call [template] // CHECK:STDOUT: %Call: %Call.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -85,52 +88,55 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %SelfBase.decl: %SelfBase.type = fn_decl @SelfBase [template = constants.%SelfBase] { // CHECK:STDOUT: %self.patt: %Base = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Base = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Base.ref.loc22: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_38.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] -// CHECK:STDOUT: %.loc22_38.2: type = converted %int.make_type_32.loc22, %.loc22_38.1 [template = i32] +// CHECK:STDOUT: %.loc22_38.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%.loc22_38.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc22_38.2: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] +// CHECK:STDOUT: %.loc22_38.3: type = converted %int.make_type_signed.loc22, %.loc22_38.2 [template = constants.%i32] // CHECK:STDOUT: %self.param.loc22: %Base = value_param runtime_param0 // CHECK:STDOUT: %self.loc22: %Base = bind_name self, %self.param.loc22 -// CHECK:STDOUT: %return.param.loc22: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param.loc22 +// CHECK:STDOUT: %return.param.loc22: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param.loc22 // CHECK:STDOUT: } // CHECK:STDOUT: %AddrSelfBase.decl: %AddrSelfBase.type = fn_decl @AddrSelfBase [template = constants.%AddrSelfBase] { -// CHECK:STDOUT: %self.patt: %.6 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %.6 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %self.patt: %.7 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.7 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc26_25: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Base.ref.loc26: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc26_40: type = ptr_type %Base [template = constants.%.6] -// CHECK:STDOUT: %self.param.loc26: %.6 = value_param runtime_param0 -// CHECK:STDOUT: %self.loc26: %.6 = bind_name self, %self.param.loc26 +// CHECK:STDOUT: %.loc26_40: type = ptr_type %Base [template = constants.%.7] +// CHECK:STDOUT: %self.param.loc26: %.7 = value_param runtime_param0 +// CHECK:STDOUT: %self.loc26: %.7 = bind_name self, %self.param.loc26 // CHECK:STDOUT: } // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { -// CHECK:STDOUT: %p.patt: %.36 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.36 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.34 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.34 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %.loc30_19: type = ptr_type %Derived [template = constants.%.36] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc30_25.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc30_25.2: type = converted %int.make_type_32, %.loc30_25.1 [template = i32] -// CHECK:STDOUT: %p.param: %.36 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.36 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc30_19: type = ptr_type %Derived [template = constants.%.34] +// CHECK:STDOUT: %.loc30_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc30_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc30_25.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc30_25.3: type = converted %int.make_type_signed, %.loc30_25.2 [template = constants.%i32] +// CHECK:STDOUT: %p.param: %.34 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.34 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -139,33 +145,34 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc16: %.5 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc16: %.6 = base_decl %Base, element0 [template] // CHECK:STDOUT: %SelfBase.decl: %SelfBase.type = fn_decl @SelfBase [template = constants.%SelfBase] { // CHECK:STDOUT: %self.patt: %Base = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Base = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Base.ref.loc18: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_32.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] -// CHECK:STDOUT: %.loc18_32.2: type = converted %int.make_type_32.loc18, %.loc18_32.1 [template = i32] +// CHECK:STDOUT: %.loc18_32.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%.loc18_32.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_32.2: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_32.3: type = converted %int.make_type_signed.loc18, %.loc18_32.2 [template = constants.%i32] // CHECK:STDOUT: %self.param.loc18: %Base = value_param runtime_param0 // CHECK:STDOUT: %self.loc18: %Base = bind_name self, %self.param.loc18 -// CHECK:STDOUT: %return.param.loc18: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %.loc18_29: ref i32 = return_slot %return.param.loc18 +// CHECK:STDOUT: %return.param.loc18: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %.loc18_29: ref %i32 = return_slot %return.param.loc18 // CHECK:STDOUT: } // CHECK:STDOUT: %AddrSelfBase.decl: %AddrSelfBase.type = fn_decl @AddrSelfBase [template = constants.%AddrSelfBase] { -// CHECK:STDOUT: %self.patt: %.6 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %.6 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %self.patt: %.7 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %.7 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %.loc26_25: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %Base.ref.loc19: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc19: type = ptr_type %Base [template = constants.%.6] -// CHECK:STDOUT: %self.param.loc19: %.6 = value_param runtime_param0 -// CHECK:STDOUT: %self.loc19: %.6 = bind_name self, %self.param.loc19 +// CHECK:STDOUT: %.loc19: type = ptr_type %Base [template = constants.%.7] +// CHECK:STDOUT: %self.param.loc19: %.7 = value_param runtime_param0 +// CHECK:STDOUT: %self.loc19: %.7 = bind_name self, %self.param.loc19 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc20: = complete_type_witness %.7 [template = constants.%.8] +// CHECK:STDOUT: %.loc20: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -175,52 +182,53 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: extend %Base.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SelfBase[%self.param_patt: %Base]() -> i32 { +// CHECK:STDOUT: fn @SelfBase[%self.param_patt: %Base]() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Base = name_ref self, %self.loc22 -// CHECK:STDOUT: %a.ref: %.1 = name_ref a, @Base.%.loc12_8 [template = @Base.%.loc12_8] -// CHECK:STDOUT: %.loc23_14.1: ref i32 = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc23_14.2: i32 = bind_value %.loc23_14.1 +// CHECK:STDOUT: %a.ref: %.2 = name_ref a, @Base.%.loc12_8 [template = @Base.%.loc12_8] +// CHECK:STDOUT: %.loc23_14.1: ref %i32 = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc23_14.2: %i32 = bind_value %.loc23_14.1 // CHECK:STDOUT: return %.loc23_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AddrSelfBase[addr %self.param_patt: %.6]() { +// CHECK:STDOUT: fn @AddrSelfBase[addr %self.param_patt: %.7]() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %.6 = name_ref self, %self.loc26 +// CHECK:STDOUT: %self.ref: %.7 = name_ref self, %self.loc26 // CHECK:STDOUT: %.loc27_4: ref %Base = deref %self.ref -// CHECK:STDOUT: %a.ref: %.1 = name_ref a, @Base.%.loc12_8 [template = @Base.%.loc12_8] -// CHECK:STDOUT: %.loc27_10: ref i32 = class_element_access %.loc27_4, element0 -// CHECK:STDOUT: %.loc27_15: Core.IntLiteral = int_value 1 [template = constants.%.9] -// CHECK:STDOUT: %.loc27_13.1: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc27_13.2: = bound_method %.loc27_15, %.loc27_13.1 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc27_13.2(%.loc27_15) [template = constants.%.35] -// CHECK:STDOUT: %.loc27_13.3: init i32 = converted %.loc27_15, %int.convert_checked [template = constants.%.35] -// CHECK:STDOUT: assign %.loc27_10, %.loc27_13.3 +// CHECK:STDOUT: %a.ref: %.2 = name_ref a, @Base.%.loc12_8 [template = @Base.%.loc12_8] +// CHECK:STDOUT: %.loc27_10: ref %i32 = class_element_access %.loc27_4, element0 +// CHECK:STDOUT: %.loc27_15: Core.IntLiteral = int_value 1 [template = constants.%.10] +// CHECK:STDOUT: %.loc27_13.1: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc27_13.2: = bound_method %.loc27_15, %.loc27_13.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc27_13.3: = specific_function %.loc27_13.2, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc27_13.3(%.loc27_15) [template = constants.%.33] +// CHECK:STDOUT: %.loc27_13.4: init %i32 = converted %.loc27_15, %int.convert_checked [template = constants.%.33] +// CHECK:STDOUT: assign %.loc27_10, %.loc27_13.4 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Call(%p.param_patt: %.36) -> i32 { +// CHECK:STDOUT: fn @Call(%p.param_patt: %.34) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref.loc31: %.36 = name_ref p, %p +// CHECK:STDOUT: %p.ref.loc31: %.34 = name_ref p, %p // CHECK:STDOUT: %.loc31_4.1: ref %Derived = deref %p.ref.loc31 // CHECK:STDOUT: %AddrSelfBase.ref: %AddrSelfBase.type = name_ref AddrSelfBase, @Derived.%AddrSelfBase.decl [template = constants.%AddrSelfBase] // CHECK:STDOUT: %.loc31_7: = bound_method %.loc31_4.1, %AddrSelfBase.ref -// CHECK:STDOUT: %.loc31_4.2: %.36 = addr_of %.loc31_4.1 +// CHECK:STDOUT: %.loc31_4.2: %.34 = addr_of %.loc31_4.1 // CHECK:STDOUT: %.loc31_4.3: ref %Derived = deref %.loc31_4.2 // CHECK:STDOUT: %.loc31_4.4: ref %Base = class_element_access %.loc31_4.3, element0 -// CHECK:STDOUT: %.loc31_4.5: %.6 = addr_of %.loc31_4.4 -// CHECK:STDOUT: %.loc31_4.6: %.6 = converted %.loc31_4.2, %.loc31_4.5 +// CHECK:STDOUT: %.loc31_4.5: %.7 = addr_of %.loc31_4.4 +// CHECK:STDOUT: %.loc31_4.6: %.7 = converted %.loc31_4.2, %.loc31_4.5 // CHECK:STDOUT: %AddrSelfBase.call: init %empty_tuple.type = call %.loc31_7(%.loc31_4.6) -// CHECK:STDOUT: %p.ref.loc32: %.36 = name_ref p, %p +// CHECK:STDOUT: %p.ref.loc32: %.34 = name_ref p, %p // CHECK:STDOUT: %.loc32_11.1: ref %Derived = deref %p.ref.loc32 // CHECK:STDOUT: %SelfBase.ref: %SelfBase.type = name_ref SelfBase, @Derived.%SelfBase.decl [template = constants.%SelfBase] // CHECK:STDOUT: %.loc32_14: = bound_method %.loc32_11.1, %SelfBase.ref // CHECK:STDOUT: %.loc32_11.2: ref %Base = class_element_access %.loc32_11.1, element0 // CHECK:STDOUT: %.loc32_11.3: ref %Base = converted %.loc32_11.1, %.loc32_11.2 // CHECK:STDOUT: %.loc32_11.4: %Base = bind_value %.loc32_11.3 -// CHECK:STDOUT: %SelfBase.call: init i32 = call %.loc32_14(%.loc32_11.4) -// CHECK:STDOUT: %.loc32_25.1: i32 = value_of_initializer %SelfBase.call -// CHECK:STDOUT: %.loc32_25.2: i32 = converted %SelfBase.call, %.loc32_25.1 +// CHECK:STDOUT: %SelfBase.call: init %i32 = call %.loc32_14(%.loc32_11.4) +// CHECK:STDOUT: %.loc32_25.1: %i32 = value_of_initializer %SelfBase.call +// CHECK:STDOUT: %.loc32_25.2: %i32 = converted %SelfBase.call, %.loc32_25.1 // CHECK:STDOUT: return %.loc32_25.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/self_type.carbon b/toolchain/check/testdata/class/self_type.carbon index a5687559fee5..b017816cbebe 100644 --- a/toolchain/check/testdata/class/self_type.carbon +++ b/toolchain/check/testdata/class/self_type.carbon @@ -26,21 +26,23 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = ptr_type %Class [template] -// CHECK:STDOUT: %.2: type = unbound_element_type %Class, %.1 [template] -// CHECK:STDOUT: %.3: type = struct_type {.p: %.1} [template] -// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.2: type = ptr_type %Class [template] +// CHECK:STDOUT: %.3: type = unbound_element_type %Class, %.2 [template] +// CHECK:STDOUT: %.4: type = struct_type {.p: %.2} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -56,17 +58,18 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Class = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc21: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_29.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] -// CHECK:STDOUT: %.loc21_29.2: type = converted %int.make_type_32.loc21, %.loc21_29.1 [template = i32] +// CHECK:STDOUT: %.loc21_29.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%.loc21_29.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_29.2: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_29.3: type = converted %int.make_type_signed.loc21, %.loc21_29.2 [template = constants.%i32] // CHECK:STDOUT: %self.param.loc21: %Class = value_param runtime_param0 // CHECK:STDOUT: %self.loc21: %Class = bind_name self, %self.param.loc21 -// CHECK:STDOUT: %return.param.loc21: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param.loc21 +// CHECK:STDOUT: %return.param.loc21: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param.loc21 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -74,17 +77,18 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Class = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_25.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_25.2: type = converted %int.make_type_32.loc12, %.loc12_25.1 [template = i32] +// CHECK:STDOUT: %.loc12_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_25.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_25.3: type = converted %int.make_type_signed.loc12, %.loc12_25.2 [template = constants.%i32] // CHECK:STDOUT: %self.param.loc12: %Class = value_param runtime_param0 // CHECK:STDOUT: %self.loc12: %Class = bind_name self, %self.param.loc12 -// CHECK:STDOUT: %return.param.loc12: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %.loc12_22: ref i32 = return_slot %return.param.loc12 +// CHECK:STDOUT: %return.param.loc12: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %.loc12_22: ref %i32 = return_slot %return.param.loc12 // CHECK:STDOUT: } // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { // CHECK:STDOUT: %return.patt: %Class = return_slot_pattern @@ -95,9 +99,9 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %return: ref %Class = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %.loc18_14: type = ptr_type %Class [template = constants.%.1] -// CHECK:STDOUT: %.loc18_8: %.2 = field_decl p, element0 [template] -// CHECK:STDOUT: %.loc19: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc18_14: type = ptr_type %Class [template = constants.%.2] +// CHECK:STDOUT: %.loc18_8: %.3 = field_decl p, element0 [template] +// CHECK:STDOUT: %.loc19: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -106,19 +110,19 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: .p = %.loc18_8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F[%self.param_patt: %Class]() -> i32 { +// CHECK:STDOUT: fn @F[%self.param_patt: %Class]() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Class = name_ref self, %self.loc21 -// CHECK:STDOUT: %p.ref: %.2 = name_ref p, @Class.%.loc18_8 [template = @Class.%.loc18_8] -// CHECK:STDOUT: %.loc22_16.1: ref %.1 = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc22_16.2: %.1 = bind_value %.loc22_16.1 +// CHECK:STDOUT: %p.ref: %.3 = name_ref p, @Class.%.loc18_8 [template = @Class.%.loc18_8] +// CHECK:STDOUT: %.loc22_16.1: ref %.2 = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc22_16.2: %.2 = bind_value %.loc22_16.1 // CHECK:STDOUT: %.loc22_11.1: ref %Class = deref %.loc22_16.2 // CHECK:STDOUT: %F.ref: %F.type = name_ref F, @Class.%F.decl [template = constants.%F] // CHECK:STDOUT: %.loc22_19: = bound_method %.loc22_11.1, %F.ref // CHECK:STDOUT: %.loc22_11.2: %Class = bind_value %.loc22_11.1 -// CHECK:STDOUT: %F.call: init i32 = call %.loc22_19(%.loc22_11.2) -// CHECK:STDOUT: %.loc22_23.1: i32 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc22_23.2: i32 = converted %F.call, %.loc22_23.1 +// CHECK:STDOUT: %F.call: init %i32 = call %.loc22_19(%.loc22_11.2) +// CHECK:STDOUT: %.loc22_23.1: %i32 = value_of_initializer %F.call +// CHECK:STDOUT: %.loc22_23.2: %i32 = converted %F.call, %.loc22_23.1 // CHECK:STDOUT: return %.loc22_23.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -128,10 +132,10 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %s: ref %Class = bind_name s, %return // CHECK:STDOUT: %s.ref.loc15_5: ref %Class = name_ref s, %s // CHECK:STDOUT: %s.ref.loc15_16: ref %Class = name_ref s, %s -// CHECK:STDOUT: %.loc15_15: %.1 = addr_of %s.ref.loc15_16 -// CHECK:STDOUT: %.loc15_17.1: %.3 = struct_literal (%.loc15_15) -// CHECK:STDOUT: %.loc15_17.2: ref %.1 = class_element_access %s.ref.loc15_5, element0 -// CHECK:STDOUT: %.loc15_17.3: init %.1 = initialize_from %.loc15_15 to %.loc15_17.2 +// CHECK:STDOUT: %.loc15_15: %.2 = addr_of %s.ref.loc15_16 +// CHECK:STDOUT: %.loc15_17.1: %.4 = struct_literal (%.loc15_15) +// CHECK:STDOUT: %.loc15_17.2: ref %.2 = class_element_access %s.ref.loc15_5, element0 +// CHECK:STDOUT: %.loc15_17.3: init %.2 = initialize_from %.loc15_15 to %.loc15_17.2 // CHECK:STDOUT: %.loc15_17.4: init %Class = class_init (%.loc15_17.3), %s.ref.loc15_5 // CHECK:STDOUT: %.loc15_7: init %Class = converted %.loc15_17.1, %.loc15_17.4 // CHECK:STDOUT: assign %s.ref.loc15_5, %.loc15_7 diff --git a/toolchain/check/testdata/class/static_method.carbon b/toolchain/check/testdata/class/static_method.carbon index 6850bc27c8b1..2f2d8ec04b0e 100644 --- a/toolchain/check/testdata/class/static_method.carbon +++ b/toolchain/check/testdata/class/static_method.carbon @@ -21,19 +21,21 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -48,47 +50,49 @@ fn Run() -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_13.2: type = converted %int.make_type_32, %.loc15_13.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc15_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_13.3: type = converted %int.make_type_signed, %.loc15_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32, %.loc12_13.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc12_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_signed, %.loc12_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32; +// CHECK:STDOUT: fn @F() -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Run() -> i32 { +// CHECK:STDOUT: fn @Run() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %c.var: ref %Class = var c // CHECK:STDOUT: %c: ref %Class = bind_name c, %c.var // CHECK:STDOUT: %c.ref: ref %Class = name_ref c, %c // CHECK:STDOUT: %F.ref: %F.type = name_ref F, @Class.%F.decl [template = constants.%F] -// CHECK:STDOUT: %F.call: init i32 = call %F.ref() -// CHECK:STDOUT: %.loc17_15.1: i32 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc17_15.2: i32 = converted %F.call, %.loc17_15.1 +// CHECK:STDOUT: %F.call: init %i32 = call %F.ref() +// CHECK:STDOUT: %.loc17_15.1: %i32 = value_of_initializer %F.call +// CHECK:STDOUT: %.loc17_15.2: %i32 = converted %F.call, %.loc17_15.1 // CHECK:STDOUT: return %.loc17_15.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index 1d4c5299d5a2..09f09fe7998c 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -31,23 +31,26 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: --- int_match.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %a: i32 = bind_symbolic_name a, 0 [symbolic] -// CHECK:STDOUT: %a.patt: i32 = symbolic_binding_pattern a, 0 [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %a: %i32 = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt: %i32 = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%a) [symbolic] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1000 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 1000 [template] -// CHECK:STDOUT: %C.3: type = class_type @C, @C(%.29) [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1000 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 1000 [template] +// CHECK:STDOUT: %C.3: type = class_type @C, @C(%.27) [template] // CHECK:STDOUT: %b: %C.3 = bind_symbolic_name b, 0 [symbolic] // CHECK:STDOUT: %b.patt: %C.3 = symbolic_binding_pattern b, 0 [symbolic] // CHECK:STDOUT: %D.type: type = generic_class_type @D [template] @@ -57,7 +60,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -72,27 +75,29 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { -// CHECK:STDOUT: %a.patt.loc2_9.1: i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt.loc2_9.1, runtime_param [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] +// CHECK:STDOUT: %a.patt.loc2_9.1: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt.loc2_9.1, runtime_param [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc2_13.2: type = converted %int.make_type_32, %.loc2_13.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param -// CHECK:STDOUT: %a.loc2_9.1: i32 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc2_9.2 (constants.%a)] +// CHECK:STDOUT: %.loc2_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc2_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc2_13.3: type = converted %int.make_type_signed, %.loc2_13.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %a.loc2_9.1: %i32 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc2_9.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl.loc3: %D.type = class_decl @D [template = constants.%D.1] { // CHECK:STDOUT: %b.patt.loc4: %C.3 = symbolic_binding_pattern b, 0 [symbolic = constants.%b.patt] // CHECK:STDOUT: %b.param_patt: %C.3 = value_param_pattern %b.patt.loc4, runtime_param [symbolic = constants.%b.patt] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc3: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc3_15: Core.IntLiteral = int_value 1000 [template = constants.%.3] -// CHECK:STDOUT: %.loc3_14.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc3_14.2: = bound_method %.loc3_15, %.loc3_14.1 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc3: init i32 = call %.loc3_14.2(%.loc3_15) [template = constants.%.29] -// CHECK:STDOUT: %.loc3_14.3: i32 = value_of_initializer %int.convert_checked.loc3 [template = constants.%.29] -// CHECK:STDOUT: %.loc3_14.4: i32 = converted %.loc3_15, %.loc3_14.3 [template = constants.%.29] -// CHECK:STDOUT: %C.loc3: type = class_type @C, @C(constants.%.29) [template = constants.%C.3] +// CHECK:STDOUT: %.loc3_15: Core.IntLiteral = int_value 1000 [template = constants.%.4] +// CHECK:STDOUT: %.loc3_14.1: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc3_14.2: = bound_method %.loc3_15, %.loc3_14.1 [template = constants.%.25] +// CHECK:STDOUT: %.loc3_14.3: = specific_function %.loc3_14.2, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc3: init %i32 = call %.loc3_14.3(%.loc3_15) [template = constants.%.27] +// CHECK:STDOUT: %.loc3_14.4: %i32 = value_of_initializer %int.convert_checked.loc3 [template = constants.%.27] +// CHECK:STDOUT: %.loc3_14.5: %i32 = converted %.loc3_15, %.loc3_14.4 [template = constants.%.27] +// CHECK:STDOUT: %C.loc3: type = class_type @C, @C(constants.%.27) [template = constants.%C.3] // CHECK:STDOUT: %b.param.loc3: %C.3 = value_param runtime_param // CHECK:STDOUT: %b.loc3_9.1: %C.3 = bind_symbolic_name b, 0, %b.param.loc3 [symbolic = %b.loc3_9.2 (constants.%b)] // CHECK:STDOUT: } @@ -101,26 +106,27 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %b.param_patt: %C.3 = value_param_pattern %b.patt.loc4, runtime_param [symbolic = constants.%b.patt] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc4: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc4_15: Core.IntLiteral = int_value 1000 [template = constants.%.3] -// CHECK:STDOUT: %.loc4_14.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_14.2: = bound_method %.loc4_15, %.loc4_14.1 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc4: init i32 = call %.loc4_14.2(%.loc4_15) [template = constants.%.29] -// CHECK:STDOUT: %.loc4_14.3: i32 = value_of_initializer %int.convert_checked.loc4 [template = constants.%.29] -// CHECK:STDOUT: %.loc4_14.4: i32 = converted %.loc4_15, %.loc4_14.3 [template = constants.%.29] -// CHECK:STDOUT: %C.loc4: type = class_type @C, @C(constants.%.29) [template = constants.%C.3] +// CHECK:STDOUT: %.loc4_15: Core.IntLiteral = int_value 1000 [template = constants.%.4] +// CHECK:STDOUT: %.loc4_14.1: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_14.2: = bound_method %.loc4_15, %.loc4_14.1 [template = constants.%.25] +// CHECK:STDOUT: %.loc4_14.3: = specific_function %.loc4_14.2, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %.loc4_14.3(%.loc4_15) [template = constants.%.27] +// CHECK:STDOUT: %.loc4_14.4: %i32 = value_of_initializer %int.convert_checked.loc4 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_14.5: %i32 = converted %.loc4_15, %.loc4_14.4 [template = constants.%.27] +// CHECK:STDOUT: %C.loc4: type = class_type @C, @C(constants.%.27) [template = constants.%C.3] // CHECK:STDOUT: %b.param.loc4: %C.3 = value_param runtime_param // CHECK:STDOUT: %b.loc4: %C.3 = bind_symbolic_name b, 0, %b.param.loc4 [symbolic = constants.%b] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(%a.loc2_9.1: i32) { -// CHECK:STDOUT: %a.loc2_9.2: i32 = bind_symbolic_name a, 0 [symbolic = %a.loc2_9.2 (constants.%a)] -// CHECK:STDOUT: %a.patt.loc2_9.2: i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] +// CHECK:STDOUT: generic class @C(%a.loc2_9.1: %i32) { +// CHECK:STDOUT: %a.loc2_9.2: %i32 = bind_symbolic_name a, 0 [symbolic = %a.loc2_9.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc2_9.2: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc2_19: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc2_19: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 @@ -134,7 +140,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc4_24: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_24: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D.2 @@ -146,9 +152,9 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %a.patt.loc2_9.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%.29) { -// CHECK:STDOUT: %a.loc2_9.2 => constants.%.29 -// CHECK:STDOUT: %a.patt.loc2_9.2 => constants.%.29 +// CHECK:STDOUT: specific @C(constants.%.27) { +// CHECK:STDOUT: %a.loc2_9.2 => constants.%.27 +// CHECK:STDOUT: %a.patt.loc2_9.2 => constants.%.27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @D(constants.%b) { @@ -159,35 +165,38 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: --- fail_int_mismatch.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %a: i32 = bind_symbolic_name a, 0 [symbolic] -// CHECK:STDOUT: %a.patt: i32 = symbolic_binding_pattern a, 0 [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %a: %i32 = bind_symbolic_name a, 0 [symbolic] +// CHECK:STDOUT: %a.patt: %i32 = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%a) [symbolic] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1000 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 1000 [template] -// CHECK:STDOUT: %C.3: type = class_type @C, @C(%.29) [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1000 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 1000 [template] +// CHECK:STDOUT: %C.3: type = class_type @C, @C(%.27) [template] // CHECK:STDOUT: %b: %C.3 = bind_symbolic_name b, 0 [symbolic] // CHECK:STDOUT: %b.patt: %C.3 = symbolic_binding_pattern b, 0 [symbolic] // CHECK:STDOUT: %D.type: type = generic_class_type @D [template] // CHECK:STDOUT: %D.1: %D.type = struct_value () [template] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] -// CHECK:STDOUT: %.30: %.type = struct_value () [template] -// CHECK:STDOUT: %.31: type = class_type @.1, @.1(%b) [symbolic] +// CHECK:STDOUT: %.28: %.type = struct_value () [template] +// CHECK:STDOUT: %.29: type = class_type @.1, @.1(%b) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -202,55 +211,58 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { -// CHECK:STDOUT: %a.patt.loc2_9.1: i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt.loc2_9.1, runtime_param [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] +// CHECK:STDOUT: %a.patt.loc2_9.1: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt.loc2_9.1, runtime_param [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc2_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc2_13.2: type = converted %int.make_type_32, %.loc2_13.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param -// CHECK:STDOUT: %a.loc2_9.1: i32 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc2_9.2 (constants.%a)] +// CHECK:STDOUT: %.loc2_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc2_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc2_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc2_13.3: type = converted %int.make_type_signed, %.loc2_13.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %a.loc2_9.1: %i32 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc2_9.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = class_decl @D [template = constants.%D.1] { // CHECK:STDOUT: %b.patt.loc3_9.1: %C.3 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc3_9.2 (constants.%b.patt)] // CHECK:STDOUT: %b.param_patt: %C.3 = value_param_pattern %b.patt.loc3_9.1, runtime_param [symbolic = %b.patt.loc3_9.2 (constants.%b.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc3_15: Core.IntLiteral = int_value 1000 [template = constants.%.3] -// CHECK:STDOUT: %.loc3_14.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc3_14.2: = bound_method %.loc3_15, %.loc3_14.1 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc3_14.2(%.loc3_15) [template = constants.%.29] -// CHECK:STDOUT: %.loc3_14.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.29] -// CHECK:STDOUT: %.loc3_14.4: i32 = converted %.loc3_15, %.loc3_14.3 [template = constants.%.29] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.29) [template = constants.%C.3] +// CHECK:STDOUT: %.loc3_15: Core.IntLiteral = int_value 1000 [template = constants.%.4] +// CHECK:STDOUT: %.loc3_14.1: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc3_14.2: = bound_method %.loc3_15, %.loc3_14.1 [template = constants.%.25] +// CHECK:STDOUT: %.loc3_14.3: = specific_function %.loc3_14.2, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc3_14.3(%.loc3_15) [template = constants.%.27] +// CHECK:STDOUT: %.loc3_14.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc3_14.5: %i32 = converted %.loc3_15, %.loc3_14.4 [template = constants.%.27] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.27) [template = constants.%C.3] // CHECK:STDOUT: %b.param: %C.3 = value_param runtime_param // CHECK:STDOUT: %b.loc3_9.1: %C.3 = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc3_9.2 (constants.%b)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.30] { +// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.28] { // CHECK:STDOUT: %b.patt.loc10_9.1: %C.3 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc10_9.2 (constants.%b.patt)] // CHECK:STDOUT: %b.param_patt: %C.3 = value_param_pattern %b.patt.loc10_9.1, runtime_param [symbolic = %b.patt.loc10_9.2 (constants.%b.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc10_15: Core.IntLiteral = int_value 1000 [template = constants.%.3] -// CHECK:STDOUT: %.loc10_14.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_14.2: = bound_method %.loc10_15, %.loc10_14.1 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc10_14.2(%.loc10_15) [template = constants.%.29] -// CHECK:STDOUT: %.loc10_14.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.29] -// CHECK:STDOUT: %.loc10_14.4: i32 = converted %.loc10_15, %.loc10_14.3 [template = constants.%.29] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.29) [template = constants.%C.3] +// CHECK:STDOUT: %.loc10_15: Core.IntLiteral = int_value 1000 [template = constants.%.4] +// CHECK:STDOUT: %.loc10_14.1: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_14.2: = bound_method %.loc10_15, %.loc10_14.1 [template = constants.%.25] +// CHECK:STDOUT: %.loc10_14.3: = specific_function %.loc10_14.2, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc10_14.3(%.loc10_15) [template = constants.%.27] +// CHECK:STDOUT: %.loc10_14.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc10_14.5: %i32 = converted %.loc10_15, %.loc10_14.4 [template = constants.%.27] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.27) [template = constants.%C.3] // CHECK:STDOUT: %b.param: %C.3 = value_param runtime_param // CHECK:STDOUT: %b.loc10_9.1: %C.3 = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc10_9.2 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(%a.loc2_9.1: i32) { -// CHECK:STDOUT: %a.loc2_9.2: i32 = bind_symbolic_name a, 0 [symbolic = %a.loc2_9.2 (constants.%a)] -// CHECK:STDOUT: %a.patt.loc2_9.2: i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] +// CHECK:STDOUT: generic class @C(%a.loc2_9.1: %i32) { +// CHECK:STDOUT: %a.loc2_9.2: %i32 = bind_symbolic_name a, 0 [symbolic = %a.loc2_9.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc2_9.2: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc2_19: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc2_19: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 @@ -271,10 +283,10 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc10_24: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc10_24: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%.31 +// CHECK:STDOUT: .Self = constants.%.29 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -283,9 +295,9 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %a.patt.loc2_9.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%.29) { -// CHECK:STDOUT: %a.loc2_9.2 => constants.%.29 -// CHECK:STDOUT: %a.patt.loc2_9.2 => constants.%.29 +// CHECK:STDOUT: specific @C(constants.%.27) { +// CHECK:STDOUT: %a.loc2_9.2 => constants.%.27 +// CHECK:STDOUT: %a.patt.loc2_9.2 => constants.%.27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @D(constants.%b) { diff --git a/toolchain/check/testdata/class/todo_access_modifiers.carbon b/toolchain/check/testdata/class/todo_access_modifiers.carbon index dcfe28c3c1dd..e2bac3886fe8 100644 --- a/toolchain/check/testdata/class/todo_access_modifiers.carbon +++ b/toolchain/check/testdata/class/todo_access_modifiers.carbon @@ -27,16 +27,18 @@ class Access { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %Access, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.k: i32, .l: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %Access, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.k: %i32, .l: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -54,15 +56,17 @@ class Access { // CHECK:STDOUT: class @Access { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} -// CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_18.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] -// CHECK:STDOUT: %.loc17_18.2: type = converted %int.make_type_32.loc17, %.loc17_18.1 [template = i32] -// CHECK:STDOUT: %.loc17_16: %.1 = field_decl k, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_20.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] -// CHECK:STDOUT: %.loc19_20.2: type = converted %int.make_type_32.loc19, %.loc19_20.1 [template = i32] -// CHECK:STDOUT: %.loc19_18: %.1 = field_decl l, element1 [template] -// CHECK:STDOUT: %.loc20: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc17_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%.loc17_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_18.2: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_18.3: type = converted %int.make_type_signed.loc17, %.loc17_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_16: %.2 = field_decl k, element0 [template] +// CHECK:STDOUT: %.loc19_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19: init type = call constants.%Int(%.loc19_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_20.2: type = value_of_initializer %int.make_type_signed.loc19 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_20.3: type = converted %int.make_type_signed.loc19, %.loc19_20.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_18: %.2 = field_decl l, element1 [template] +// CHECK:STDOUT: %.loc20: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Access diff --git a/toolchain/check/testdata/const/basic.carbon b/toolchain/check/testdata/const/basic.carbon index 38013705d449..3cca20f46922 100644 --- a/toolchain/check/testdata/const/basic.carbon +++ b/toolchain/check/testdata/const/basic.carbon @@ -19,22 +19,24 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: --- basic.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = const_type i32 [template] -// CHECK:STDOUT: %.2: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = const_type %i32 [template] // CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type i32 [template] -// CHECK:STDOUT: %.5: type = const_type %.4 [template] +// CHECK:STDOUT: %.5: type = ptr_type %i32 [template] +// CHECK:STDOUT: %.6: type = const_type %.5 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -48,60 +50,64 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { -// CHECK:STDOUT: %p.patt: %.3 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.3 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.3 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.3 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.4 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.4 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.4 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_15 [template = i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11_15, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_9.3: type = const_type i32 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_18: type = ptr_type %.1 [template = constants.%.2] -// CHECK:STDOUT: %.loc11_19: type = ptr_type %.2 [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_32.loc11_31: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_32.loc11_31 [template = i32] -// CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_32.loc11_31, %.loc11_25.1 [template = i32] -// CHECK:STDOUT: %.loc11_25.3: type = const_type i32 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_34: type = ptr_type %.1 [template = constants.%.2] -// CHECK:STDOUT: %.loc11_35: type = ptr_type %.2 [template = constants.%.3] -// CHECK:STDOUT: %p.param: %.3 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.3 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.3 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.3 = return_slot %return.param +// CHECK:STDOUT: %.loc11_15: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_15: init type = call constants.%Int(%.loc11_15) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_signed.loc11_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_signed.loc11_15, %.loc11_9.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.3: type = const_type %i32 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_18: type = ptr_type %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_19: type = ptr_type %.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_31: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_31: init type = call constants.%Int(%.loc11_31) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_signed.loc11_31 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_signed.loc11_31, %.loc11_25.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.3: type = const_type %i32 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_34: type = ptr_type %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_35: type = ptr_type %.3 [template = constants.%.4] +// CHECK:STDOUT: %p.param: %.4 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.4 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.4 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { -// CHECK:STDOUT: %p.patt: %.5 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.5 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.5 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.5 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.6 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.6 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.6 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.6 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc15_16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_19.1: type = value_of_initializer %int.make_type_32.loc15_16 [template = i32] -// CHECK:STDOUT: %.loc15_19.2: type = converted %int.make_type_32.loc15_16, %.loc15_19.1 [template = i32] -// CHECK:STDOUT: %.loc15_19.3: type = ptr_type i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc15_9: type = const_type %.4 [template = constants.%.5] -// CHECK:STDOUT: %int.make_type_32.loc15_33: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_36.1: type = value_of_initializer %int.make_type_32.loc15_33 [template = i32] -// CHECK:STDOUT: %.loc15_36.2: type = converted %int.make_type_32.loc15_33, %.loc15_36.1 [template = i32] -// CHECK:STDOUT: %.loc15_36.3: type = ptr_type i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc15_26: type = const_type %.4 [template = constants.%.5] -// CHECK:STDOUT: %p.param: %.5 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.5 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.5 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.5 = return_slot %return.param +// CHECK:STDOUT: %.loc15_16: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15_16: init type = call constants.%Int(%.loc15_16) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_19.1: type = value_of_initializer %int.make_type_signed.loc15_16 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_19.2: type = converted %int.make_type_signed.loc15_16, %.loc15_19.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_19.3: type = ptr_type %i32 [template = constants.%.5] +// CHECK:STDOUT: %.loc15_9: type = const_type %.5 [template = constants.%.6] +// CHECK:STDOUT: %.loc15_33: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15_33: init type = call constants.%Int(%.loc15_33) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_36.1: type = value_of_initializer %int.make_type_signed.loc15_33 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_36.2: type = converted %int.make_type_signed.loc15_33, %.loc15_36.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_36.3: type = ptr_type %i32 [template = constants.%.5] +// CHECK:STDOUT: %.loc15_26: type = const_type %.5 [template = constants.%.6] +// CHECK:STDOUT: %p.param: %.6 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.6 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.6 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.6 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @A(%p.param_patt: %.3) -> %.3 { +// CHECK:STDOUT: fn @A(%p.param_patt: %.4) -> %.4 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.3 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p // CHECK:STDOUT: return %p.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%p.param_patt: %.5) -> %.5 { +// CHECK:STDOUT: fn @B(%p.param_patt: %.6) -> %.6 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.5 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.6 = name_ref p, %p // CHECK:STDOUT: return %p.ref // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/const/collapse.carbon b/toolchain/check/testdata/const/collapse.carbon index fb1a06f95717..fc3a3fc14727 100644 --- a/toolchain/check/testdata/const/collapse.carbon +++ b/toolchain/check/testdata/const/collapse.carbon @@ -19,18 +19,20 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: --- collapse.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = const_type i32 [template] -// CHECK:STDOUT: %.2: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = const_type %i32 [template] // CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -43,34 +45,36 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %p.patt: %.3 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.3 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.3 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.3 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.4 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.4 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.4 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc15_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_9.1: type = value_of_initializer %int.make_type_32.loc15_15 [template = i32] -// CHECK:STDOUT: %.loc15_9.2: type = converted %int.make_type_32.loc15_15, %.loc15_9.1 [template = i32] -// CHECK:STDOUT: %.loc15_9.3: type = const_type i32 [template = constants.%.1] -// CHECK:STDOUT: %.loc15_18: type = ptr_type %.1 [template = constants.%.2] -// CHECK:STDOUT: %.loc15_19: type = ptr_type %.2 [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_32.loc15_38: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_32.1: type = value_of_initializer %int.make_type_32.loc15_38 [template = i32] -// CHECK:STDOUT: %.loc15_32.2: type = converted %int.make_type_32.loc15_38, %.loc15_32.1 [template = i32] -// CHECK:STDOUT: %.loc15_32.3: type = const_type i32 [template = constants.%.1] -// CHECK:STDOUT: %.loc15_25: type = const_type %.1 [template = constants.%.1] -// CHECK:STDOUT: %.loc15_42: type = ptr_type %.1 [template = constants.%.2] -// CHECK:STDOUT: %.loc15_43: type = ptr_type %.2 [template = constants.%.3] -// CHECK:STDOUT: %p.param: %.3 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.3 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.3 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.3 = return_slot %return.param +// CHECK:STDOUT: %.loc15_15: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15_15: init type = call constants.%Int(%.loc15_15) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_9.1: type = value_of_initializer %int.make_type_signed.loc15_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_9.2: type = converted %int.make_type_signed.loc15_15, %.loc15_9.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_9.3: type = const_type %i32 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_18: type = ptr_type %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_19: type = ptr_type %.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc15_38: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15_38: init type = call constants.%Int(%.loc15_38) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_32.1: type = value_of_initializer %int.make_type_signed.loc15_38 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_32.2: type = converted %int.make_type_signed.loc15_38, %.loc15_32.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_32.3: type = const_type %i32 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_25: type = const_type %.2 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_42: type = ptr_type %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_43: type = ptr_type %.3 [template = constants.%.4] +// CHECK:STDOUT: %p.param: %.4 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.4 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.4 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%p.param_patt: %.3) -> %.3 { +// CHECK:STDOUT: fn @F(%p.param_patt: %.4) -> %.4 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.3 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p // CHECK:STDOUT: return %p.ref // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/const/fail_collapse.carbon b/toolchain/check/testdata/const/fail_collapse.carbon index 07286757cfc3..fc9faafc122e 100644 --- a/toolchain/check/testdata/const/fail_collapse.carbon +++ b/toolchain/check/testdata/const/fail_collapse.carbon @@ -25,20 +25,22 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: --- fail_collapse.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = const_type i32 [template] -// CHECK:STDOUT: %.2: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = const_type %i32 [template] // CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: type = ptr_type i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %i32 [template] +// CHECK:STDOUT: %.6: type = ptr_type %.5 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -52,34 +54,36 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %p.patt: %.3 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.3 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.5 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.5 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.4 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.6 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.6 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc15_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_16.1: type = value_of_initializer %int.make_type_32.loc15_22 [template = i32] -// CHECK:STDOUT: %.loc15_16.2: type = converted %int.make_type_32.loc15_22, %.loc15_16.1 [template = i32] -// CHECK:STDOUT: %.loc15_16.3: type = const_type i32 [template = constants.%.1] -// CHECK:STDOUT: %.loc15_9: type = const_type %.1 [template = constants.%.1] -// CHECK:STDOUT: %.loc15_26: type = ptr_type %.1 [template = constants.%.2] -// CHECK:STDOUT: %.loc15_27: type = ptr_type %.2 [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_32.loc15_33: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_36.1: type = value_of_initializer %int.make_type_32.loc15_33 [template = i32] -// CHECK:STDOUT: %.loc15_36.2: type = converted %int.make_type_32.loc15_33, %.loc15_36.1 [template = i32] -// CHECK:STDOUT: %.loc15_36.3: type = ptr_type i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc15_37: type = ptr_type %.4 [template = constants.%.5] -// CHECK:STDOUT: %p.param: %.3 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.3 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.5 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.5 = return_slot %return.param +// CHECK:STDOUT: %.loc15_22: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15_22: init type = call constants.%Int(%.loc15_22) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_16.1: type = value_of_initializer %int.make_type_signed.loc15_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_16.2: type = converted %int.make_type_signed.loc15_22, %.loc15_16.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_16.3: type = const_type %i32 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_9: type = const_type %.2 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_26: type = ptr_type %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_27: type = ptr_type %.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc15_33: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15_33: init type = call constants.%Int(%.loc15_33) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_36.1: type = value_of_initializer %int.make_type_signed.loc15_33 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_36.2: type = converted %int.make_type_signed.loc15_33, %.loc15_36.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_36.3: type = ptr_type %i32 [template = constants.%.5] +// CHECK:STDOUT: %.loc15_37: type = ptr_type %.5 [template = constants.%.6] +// CHECK:STDOUT: %p.param: %.4 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.6 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.6 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%p.param_patt: %.3) -> %.5 { +// CHECK:STDOUT: fn @G(%p.param_patt: %.4) -> %.6 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.3 = name_ref p, %p -// CHECK:STDOUT: %.loc22: %.5 = converted %p.ref, [template = ] +// CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p +// CHECK:STDOUT: %.loc22: %.6 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/const/import.carbon b/toolchain/check/testdata/const/import.carbon index 1a593906f5e8..a947acd7d011 100644 --- a/toolchain/check/testdata/const/import.carbon +++ b/toolchain/check/testdata/const/import.carbon @@ -29,17 +29,19 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: --- implicit.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = const_type i32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = const_type %i32 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -54,40 +56,43 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: %.1 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.1 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_11.3: type = const_type i32 [template = constants.%.1] -// CHECK:STDOUT: %return.param: ref %.1 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref %.1 = return_slot %return.param +// CHECK:STDOUT: %.loc4_17: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_17) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = const_type %i32 [template = constants.%.2] +// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_12.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_12.2: type = converted %int.make_type_32.loc6, %.loc6_12.1 [template = i32] -// CHECK:STDOUT: %.loc6_12.3: type = const_type i32 [template = constants.%.1] -// CHECK:STDOUT: %a_ref.var: ref %.1 = var a_ref -// CHECK:STDOUT: %a_ref: ref %.1 = bind_name a_ref, %a_ref.var -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_16.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_16.2: type = converted %int.make_type_32.loc7, %.loc7_16.1 [template = i32] -// CHECK:STDOUT: %.loc7_16.3: type = const_type i32 [template = constants.%.1] -// CHECK:STDOUT: %.loc7_25: type = ptr_type %.1 [template = constants.%.2] -// CHECK:STDOUT: %a_ptr_ref.var: ref %.2 = var a_ptr_ref -// CHECK:STDOUT: %a_ptr_ref: ref %.2 = bind_name a_ptr_ref, %a_ptr_ref.var +// CHECK:STDOUT: %.loc6_18: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_18) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_12.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_12.2: type = converted %int.make_type_signed.loc6, %.loc6_12.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_12.3: type = const_type %i32 [template = constants.%.2] +// CHECK:STDOUT: %a_ref.var: ref %.2 = var a_ref +// CHECK:STDOUT: %a_ref: ref %.2 = bind_name a_ref, %a_ref.var +// CHECK:STDOUT: %.loc7_22: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%.loc7_22) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_16.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_16.2: type = converted %int.make_type_signed.loc7, %.loc7_16.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_16.3: type = const_type %i32 [template = constants.%.2] +// CHECK:STDOUT: %.loc7_25: type = ptr_type %.2 [template = constants.%.3] +// CHECK:STDOUT: %a_ptr_ref.var: ref %.3 = var a_ptr_ref +// CHECK:STDOUT: %a_ptr_ref: ref %.3 = bind_name a_ptr_ref, %a_ptr_ref.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> %.1; +// CHECK:STDOUT: fn @F() -> %.2; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %F.call: init %.1 = call %F.ref() +// CHECK:STDOUT: %F.call: init %.2 = call %F.ref() // CHECK:STDOUT: assign file.%a_ref.var, %F.call -// CHECK:STDOUT: %a_ref.ref: ref %.1 = name_ref a_ref, file.%a_ref -// CHECK:STDOUT: %.loc7: %.2 = addr_of %a_ref.ref +// CHECK:STDOUT: %a_ref.ref: ref %.2 = name_ref a_ref, file.%a_ref +// CHECK:STDOUT: %.loc7: %.3 = addr_of %a_ref.ref // CHECK:STDOUT: assign file.%a_ptr_ref.var, %.loc7 // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -95,18 +100,20 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: --- implicit.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = const_type i32 [template] -// CHECK:STDOUT: %.2: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = const_type %i32 [template] +// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+20, unloaded -// CHECK:STDOUT: %import_ref.2: ref %.1 = import_ref Implicit//default, inst+28, loaded -// CHECK:STDOUT: %import_ref.3: ref %.2 = import_ref Implicit//default, inst+39, loaded +// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+27, unloaded +// CHECK:STDOUT: %import_ref.2: ref %.2 = import_ref Implicit//default, inst+36, loaded +// CHECK:STDOUT: %import_ref.3: ref %.3 = import_ref Implicit//default, inst+48, loaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.4 +// CHECK:STDOUT: .Int = %import_ref.4 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -124,29 +131,31 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] -// CHECK:STDOUT: %.loc6_8.3: type = const_type i32 [template = constants.%.1] -// CHECK:STDOUT: %.loc6_17: type = ptr_type %.1 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_12.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_12.2: type = converted %int.make_type_32.loc7, %.loc7_12.1 [template = i32] -// CHECK:STDOUT: %.loc7_12.3: type = const_type i32 [template = constants.%.1] -// CHECK:STDOUT: %.loc7_21: type = ptr_type %.1 [template = constants.%.2] -// CHECK:STDOUT: %a_ptr.var: ref %.2 = var a_ptr -// CHECK:STDOUT: %a_ptr: ref %.2 = bind_name a_ptr, %a_ptr.var +// CHECK:STDOUT: %.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_signed.loc6, %.loc6_8.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.3: type = const_type %i32 [template = constants.%.2] +// CHECK:STDOUT: %.loc6_17: type = ptr_type %.2 [template = constants.%.3] +// CHECK:STDOUT: %a.var: ref %.3 = var a +// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var +// CHECK:STDOUT: %.loc7_18: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%.loc7_18) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_12.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_12.2: type = converted %int.make_type_signed.loc7, %.loc7_12.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_12.3: type = const_type %i32 [template = constants.%.2] +// CHECK:STDOUT: %.loc7_21: type = ptr_type %.2 [template = constants.%.3] +// CHECK:STDOUT: %a_ptr.var: ref %.3 = var a_ptr +// CHECK:STDOUT: %a_ptr: ref %.3 = bind_name a_ptr, %a_ptr.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a_ref.ref: ref %.1 = name_ref a_ref, imports.%import_ref.2 -// CHECK:STDOUT: %.loc6: %.2 = addr_of %a_ref.ref +// CHECK:STDOUT: %a_ref.ref: ref %.2 = name_ref a_ref, imports.%import_ref.2 +// CHECK:STDOUT: %.loc6: %.3 = addr_of %a_ref.ref // CHECK:STDOUT: assign file.%a.var, %.loc6 -// CHECK:STDOUT: %a_ptr_ref.ref: ref %.2 = name_ref a_ptr_ref, imports.%import_ref.3 -// CHECK:STDOUT: %.loc7: %.2 = bind_value %a_ptr_ref.ref +// CHECK:STDOUT: %a_ptr_ref.ref: ref %.3 = name_ref a_ptr_ref, imports.%import_ref.3 +// CHECK:STDOUT: %.loc7: %.3 = bind_value %a_ptr_ref.ref // CHECK:STDOUT: assign file.%a_ptr.var, %.loc7 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index cc8cc5532849..f391eb1ad8e1 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -110,21 +110,24 @@ fn G() -> C { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.6: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.30: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.31: = bound_method %.6, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 0 [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.7 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.7) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.28: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.7) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 0 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.34: type = array_type %.3, %C [template] +// CHECK:STDOUT: %.32: type = array_type %.3, %C [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (%.1, %.1, %.1) [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.36: i32 = int_value 1 [template] -// CHECK:STDOUT: %.37: i32 = int_value 2 [template] -// CHECK:STDOUT: %array: %.34 = tuple_value (%struct, %struct, %struct) [template] -// CHECK:STDOUT: %.38: = specific_function %F, @F(%C) [template] +// CHECK:STDOUT: %.34: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.35: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %array: %.32 = tuple_value (%struct, %struct, %struct) [template] +// CHECK:STDOUT: %.36: = specific_function %F, @F(%C) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -191,13 +194,14 @@ fn G() -> C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: @F.%.loc6_24.2 (%.4) = name_ref a, %a // CHECK:STDOUT: %.loc6_43.1: Core.IntLiteral = int_value 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc6_43.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_43.3: = bound_method %.loc6_43.1, %.loc6_43.2 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc6_43.3(%.loc6_43.1) [template = constants.%.32] -// CHECK:STDOUT: %.loc6_43.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.32] -// CHECK:STDOUT: %.loc6_43.5: i32 = converted %.loc6_43.1, %.loc6_43.4 [template = constants.%.32] +// CHECK:STDOUT: %.loc6_43.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_43.3: = bound_method %.loc6_43.1, %.loc6_43.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc6_43.4: = specific_function %.loc6_43.3, @Convert.2(constants.%.7) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc6_43.4(%.loc6_43.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc6_43.5: %i32 = value_of_initializer %int.convert_checked [template = constants.%.30] +// CHECK:STDOUT: %.loc6_43.6: %i32 = converted %.loc6_43.1, %.loc6_43.5 [template = constants.%.30] // CHECK:STDOUT: %.loc6_44.1: ref @F.%.loc6_24.2 (%.4) = value_as_ref %a.ref -// CHECK:STDOUT: %.loc6_44.2: ref @F.%T.loc6_6.2 (%T) = array_index %.loc6_44.1, %.loc6_43.5 +// CHECK:STDOUT: %.loc6_44.2: ref @F.%T.loc6_6.2 (%T) = array_index %.loc6_44.1, %.loc6_43.6 // CHECK:STDOUT: %.loc6_44.3: @F.%T.loc6_6.2 (%T) = bind_value %.loc6_44.2 // CHECK:STDOUT: return %.loc6_44.3 // CHECK:STDOUT: } @@ -207,33 +211,33 @@ fn G() -> C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc9_14: Core.IntLiteral = int_value 3 [template = constants.%.3] -// CHECK:STDOUT: %.loc9_15: type = array_type %.loc9_14, %C [template = constants.%.34] -// CHECK:STDOUT: %a.var: ref %.34 = var a -// CHECK:STDOUT: %a: ref %.34 = bind_name a, %a.var +// CHECK:STDOUT: %.loc9_15: type = array_type %.loc9_14, %C [template = constants.%.32] +// CHECK:STDOUT: %a.var: ref %.32 = var a +// CHECK:STDOUT: %a: ref %.32 = bind_name a, %a.var // CHECK:STDOUT: %.loc9_21.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc9_25.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc9_29.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc9_30.1: %tuple.type = tuple_literal (%.loc9_21.1, %.loc9_25.1, %.loc9_29.1) -// CHECK:STDOUT: %.loc9_30.2: i32 = int_value 0 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_30.2: Core.IntLiteral = int_value 0 [template = constants.%.6] // CHECK:STDOUT: %.loc9_30.3: ref %C = array_index %a.var, %.loc9_30.2 // CHECK:STDOUT: %.loc9_21.2: init %C = class_init (), %.loc9_30.3 [template = constants.%struct] // CHECK:STDOUT: %.loc9_30.4: init %C = converted %.loc9_21.1, %.loc9_21.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc9_30.5: i32 = int_value 1 [template = constants.%.36] +// CHECK:STDOUT: %.loc9_30.5: Core.IntLiteral = int_value 1 [template = constants.%.34] // CHECK:STDOUT: %.loc9_30.6: ref %C = array_index %a.var, %.loc9_30.5 // CHECK:STDOUT: %.loc9_25.2: init %C = class_init (), %.loc9_30.6 [template = constants.%struct] // CHECK:STDOUT: %.loc9_30.7: init %C = converted %.loc9_25.1, %.loc9_25.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc9_30.8: i32 = int_value 2 [template = constants.%.37] +// CHECK:STDOUT: %.loc9_30.8: Core.IntLiteral = int_value 2 [template = constants.%.35] // CHECK:STDOUT: %.loc9_30.9: ref %C = array_index %a.var, %.loc9_30.8 // CHECK:STDOUT: %.loc9_29.2: init %C = class_init (), %.loc9_30.9 [template = constants.%struct] // CHECK:STDOUT: %.loc9_30.10: init %C = converted %.loc9_29.1, %.loc9_29.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc9_30.11: init %.34 = array_init (%.loc9_30.4, %.loc9_30.7, %.loc9_30.10) to %a.var [template = constants.%array] -// CHECK:STDOUT: %.loc9_31: init %.34 = converted %.loc9_30.1, %.loc9_30.11 [template = constants.%array] +// CHECK:STDOUT: %.loc9_30.11: init %.32 = array_init (%.loc9_30.4, %.loc9_30.7, %.loc9_30.10) to %a.var [template = constants.%array] +// CHECK:STDOUT: %.loc9_31: init %.32 = converted %.loc9_30.1, %.loc9_30.11 [template = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc9_31 // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %a.ref: ref %.34 = name_ref a, %a -// CHECK:STDOUT: %.loc10_10: = specific_function %F.ref, @F(constants.%C) [template = constants.%.38] +// CHECK:STDOUT: %a.ref: ref %.32 = name_ref a, %a +// CHECK:STDOUT: %.loc10_10: = specific_function %F.ref, @F(constants.%C) [template = constants.%.36] // CHECK:STDOUT: %.loc8_8.2: ref %C = splice_block %return {} -// CHECK:STDOUT: %.loc10_12: %.34 = bind_value %a.ref +// CHECK:STDOUT: %.loc10_12: %.32 = bind_value %a.ref // CHECK:STDOUT: %F.call: init %C = call %.loc10_10(%.loc10_12) to %.loc8_8.2 // CHECK:STDOUT: return %F.call to %return // CHECK:STDOUT: } @@ -247,7 +251,7 @@ fn G() -> C { // CHECK:STDOUT: specific @F(constants.%C) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%C // CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%C -// CHECK:STDOUT: %.loc6_24.2 => constants.%.34 +// CHECK:STDOUT: %.loc6_24.2 => constants.%.32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -258,33 +262,36 @@ fn G() -> C { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt.1: i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.3 [template] +// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %N.1, %Convert.15 [symbolic] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.27(%N.1) [symbolic] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.4, @impl.3(%.3) [template] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.13) [template] +// CHECK:STDOUT: %.22: = bound_method %N.1, %Convert.13 [symbolic] +// CHECK:STDOUT: %.23: = specific_function %.22, @Convert.4(%.3) [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.23(%N.1) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.30: type = array_type %.29, %C [template] +// CHECK:STDOUT: %.25: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.26: type = array_type %.25, %C [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (%.1, %.1, %.1) [template] -// CHECK:STDOUT: %.32: i32 = int_value 0 [template] +// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.33: i32 = int_value 1 [template] -// CHECK:STDOUT: %.34: i32 = int_value 2 [template] -// CHECK:STDOUT: %array: %.30 = tuple_value (%struct, %struct, %struct) [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %array: %.26 = tuple_value (%struct, %struct, %struct) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -301,33 +308,36 @@ fn G() -> C { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt.loc10_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc10_6.1, runtime_param [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc10_6.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc10_6.1, runtime_param [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] // CHECK:STDOUT: %a.patt: = binding_pattern a // CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc10_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_10.1: type = value_of_initializer %int.make_type_32.loc10_10 [template = i32] -// CHECK:STDOUT: %.loc10_10.2: type = converted %int.make_type_32.loc10_10, %.loc10_10.1 [template = i32] +// CHECK:STDOUT: %.loc10_10.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc10_10: init type = call constants.%Int(%.loc10_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_10.2: type = value_of_initializer %int.make_type_signed.loc10_10 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_10.3: type = converted %int.make_type_signed.loc10_10, %.loc10_10.2 [template = constants.%i32] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %N.ref.loc10_22: i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.1)] -// CHECK:STDOUT: %.loc10_22.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_22.2: = bound_method %N.ref.loc10_22, %.loc10_22.1 [symbolic = %.loc10_22.5 (constants.%.27)] -// CHECK:STDOUT: %int.convert_checked.loc10_22.1: init Core.IntLiteral = call %.loc10_22.2(%N.ref.loc10_22) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc10_22.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc10_22.4: Core.IntLiteral = converted %N.ref.loc10_22, %.loc10_22.3 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc10_23: type = array_type %.loc10_22.4, %C [template = ] -// CHECK:STDOUT: %int.make_type_32.loc10_29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_32.loc10_29 [template = i32] -// CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_32.loc10_29, %.loc10_29.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc10_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.ref.loc10_22: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %.loc10_22.1: %Convert.type.2 = interface_witness_access constants.%.21, element0 [template = constants.%Convert.13] +// CHECK:STDOUT: %.loc10_22.2: = bound_method %N.ref.loc10_22, %.loc10_22.1 [symbolic = %.loc10_22.6 (constants.%.22)] +// CHECK:STDOUT: %.loc10_22.3: = specific_function %.loc10_22.2, @Convert.4(constants.%.3) [symbolic = %.loc10_22.7 (constants.%.23)] +// CHECK:STDOUT: %int.convert_checked.loc10_22.1: init Core.IntLiteral = call %.loc10_22.3(%N.ref.loc10_22) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_22.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_22.5: Core.IntLiteral = converted %N.ref.loc10_22, %.loc10_22.4 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_23: type = array_type %.loc10_22.5, %C [template = ] +// CHECK:STDOUT: %.loc10_29.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc10_29: init type = call constants.%Int(%.loc10_29.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_29.2: type = value_of_initializer %int.make_type_signed.loc10_29 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_29.3: type = converted %int.make_type_signed.loc10_29, %.loc10_29.2 [template = constants.%i32] +// CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc10_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc10_6.2 (constants.%N.1)] // CHECK:STDOUT: %a.param: = value_param runtime_param0 // CHECK:STDOUT: %a: = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern @@ -346,17 +356,18 @@ fn G() -> C { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%N.loc10_6.1: i32) { -// CHECK:STDOUT: %N.loc10_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc10_6.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc10_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %.loc10_22.5: = bound_method %N.loc10_6.2, constants.%Convert.15 [symbolic = %.loc10_22.5 (constants.%.27)] -// CHECK:STDOUT: %int.convert_checked.loc10_22.2: init Core.IntLiteral = call %.loc10_22.5(%N.loc10_6.2) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: generic fn @F(%N.loc10_6.1: %i32) { +// CHECK:STDOUT: %N.loc10_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc10_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %.loc10_22.6: = bound_method %N.loc10_6.2, constants.%Convert.13 [symbolic = %.loc10_22.6 (constants.%.22)] +// CHECK:STDOUT: %.loc10_22.7: = specific_function %.loc10_22.6, @Convert.4(constants.%.3) [symbolic = %.loc10_22.7 (constants.%.23)] +// CHECK:STDOUT: %int.convert_checked.loc10_22.2: init Core.IntLiteral = call %.loc10_22.7(%N.loc10_6.2) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%N.param_patt: i32](%a.param_patt: ) -> i32 { +// CHECK:STDOUT: fn[%N.param_patt: %i32](%a.param_patt: ) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %N.ref.loc10_42: i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.ref.loc10_42: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.1)] // CHECK:STDOUT: return %N.ref.loc10_42 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -364,38 +375,39 @@ fn G() -> C { // CHECK:STDOUT: fn @G() -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc13_14: Core.IntLiteral = int_value 3 [template = constants.%.29] -// CHECK:STDOUT: %.loc13_15: type = array_type %.loc13_14, %C [template = constants.%.30] -// CHECK:STDOUT: %a.var: ref %.30 = var a -// CHECK:STDOUT: %a: ref %.30 = bind_name a, %a.var +// CHECK:STDOUT: %.loc13_14: Core.IntLiteral = int_value 3 [template = constants.%.25] +// CHECK:STDOUT: %.loc13_15: type = array_type %.loc13_14, %C [template = constants.%.26] +// CHECK:STDOUT: %a.var: ref %.26 = var a +// CHECK:STDOUT: %a: ref %.26 = bind_name a, %a.var // CHECK:STDOUT: %.loc13_21.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc13_25.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc13_29.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc13_30.1: %tuple.type = tuple_literal (%.loc13_21.1, %.loc13_25.1, %.loc13_29.1) -// CHECK:STDOUT: %.loc13_30.2: i32 = int_value 0 [template = constants.%.32] +// CHECK:STDOUT: %.loc13_30.2: Core.IntLiteral = int_value 0 [template = constants.%.28] // CHECK:STDOUT: %.loc13_30.3: ref %C = array_index %a.var, %.loc13_30.2 // CHECK:STDOUT: %.loc13_21.2: init %C = class_init (), %.loc13_30.3 [template = constants.%struct] // CHECK:STDOUT: %.loc13_30.4: init %C = converted %.loc13_21.1, %.loc13_21.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.5: i32 = int_value 1 [template = constants.%.33] +// CHECK:STDOUT: %.loc13_30.5: Core.IntLiteral = int_value 1 [template = constants.%.29] // CHECK:STDOUT: %.loc13_30.6: ref %C = array_index %a.var, %.loc13_30.5 // CHECK:STDOUT: %.loc13_25.2: init %C = class_init (), %.loc13_30.6 [template = constants.%struct] // CHECK:STDOUT: %.loc13_30.7: init %C = converted %.loc13_25.1, %.loc13_25.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.8: i32 = int_value 2 [template = constants.%.34] +// CHECK:STDOUT: %.loc13_30.8: Core.IntLiteral = int_value 2 [template = constants.%.30] // CHECK:STDOUT: %.loc13_30.9: ref %C = array_index %a.var, %.loc13_30.8 // CHECK:STDOUT: %.loc13_29.2: init %C = class_init (), %.loc13_30.9 [template = constants.%struct] // CHECK:STDOUT: %.loc13_30.10: init %C = converted %.loc13_29.1, %.loc13_29.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.11: init %.30 = array_init (%.loc13_30.4, %.loc13_30.7, %.loc13_30.10) to %a.var [template = constants.%array] -// CHECK:STDOUT: %.loc13_31: init %.30 = converted %.loc13_30.1, %.loc13_30.11 [template = constants.%array] +// CHECK:STDOUT: %.loc13_30.11: init %.26 = array_init (%.loc13_30.4, %.loc13_30.7, %.loc13_30.10) to %a.var [template = constants.%array] +// CHECK:STDOUT: %.loc13_31: init %.26 = converted %.loc13_30.1, %.loc13_30.11 [template = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc13_31 // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %a.ref: ref %.30 = name_ref a, %a +// CHECK:STDOUT: %a.ref: ref %.26 = name_ref a, %a // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N.1) { // CHECK:STDOUT: %N.loc10_6.2 => constants.%N.1 // CHECK:STDOUT: %N.patt.loc10_6.2 => constants.%N.1 -// CHECK:STDOUT: %.loc10_22.5 => constants.%.27 +// CHECK:STDOUT: %.loc10_22.6 => constants.%.22 +// CHECK:STDOUT: %.loc10_22.7 => constants.%.23 // CHECK:STDOUT: %int.convert_checked.loc10_22.2 => constants.%int.convert_checked // CHECK:STDOUT: } // CHECK:STDOUT: @@ -407,33 +419,36 @@ fn G() -> C { // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N, 1 [symbolic] -// CHECK:STDOUT: %N.patt.1: i32 = symbolic_binding_pattern N, 1 [symbolic] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.3 [template] +// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %N.1, %Convert.15 [symbolic] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.27(%N.1) [symbolic] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.4, @impl.3(%.3) [template] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.13) [template] +// CHECK:STDOUT: %.22: = bound_method %N.1, %Convert.13 [symbolic] +// CHECK:STDOUT: %.23: = specific_function %.22, @Convert.4(%.3) [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.23(%N.1) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.30: type = array_type %.29, %C [template] +// CHECK:STDOUT: %.25: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.26: type = array_type %.25, %C [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (%.1, %.1, %.1) [template] -// CHECK:STDOUT: %.32: i32 = int_value 0 [template] +// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.33: i32 = int_value 1 [template] -// CHECK:STDOUT: %.34: i32 = int_value 2 [template] -// CHECK:STDOUT: %array: %.30 = tuple_value (%struct, %struct, %struct) [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %array: %.26 = tuple_value (%struct, %struct, %struct) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -452,29 +467,31 @@ fn G() -> C { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %T.patt.loc10_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc10_6.1, runtime_param [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.patt.loc10_16.1: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc10_16.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc10_16.1, runtime_param [symbolic = %N.patt.loc10_16.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc10_16.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc10_16.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc10_16.1, runtime_param [symbolic = %N.patt.loc10_16.2 (constants.%N.patt.1)] // CHECK:STDOUT: %a.patt: = binding_pattern a // CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: @F.%T.loc10_6.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%T.loc10_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc10_20.2: type = converted %int.make_type_32, %.loc10_20.1 [template = i32] +// CHECK:STDOUT: %.loc10_20.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc10_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc10_20.3: type = converted %int.make_type_signed, %.loc10_20.2 [template = constants.%i32] // CHECK:STDOUT: %T.ref.loc10_29: type = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T)] -// CHECK:STDOUT: %N.ref: i32 = name_ref N, %N.loc10_16.1 [symbolic = %N.loc10_16.2 (constants.%N.1)] -// CHECK:STDOUT: %.loc10_32.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_32.2: = bound_method %N.ref, %.loc10_32.1 [symbolic = %.loc10_32.5 (constants.%.27)] -// CHECK:STDOUT: %int.convert_checked.loc10_32.1: init Core.IntLiteral = call %.loc10_32.2(%N.ref) [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc10_32.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_32.1 [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc10_32.4: Core.IntLiteral = converted %N.ref, %.loc10_32.3 [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc10_33: type = array_type %.loc10_32.4, %T [template = ] +// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc10_16.1 [symbolic = %N.loc10_16.2 (constants.%N.1)] +// CHECK:STDOUT: %.loc10_32.1: %Convert.type.2 = interface_witness_access constants.%.21, element0 [template = constants.%Convert.13] +// CHECK:STDOUT: %.loc10_32.2: = bound_method %N.ref, %.loc10_32.1 [symbolic = %.loc10_32.6 (constants.%.22)] +// CHECK:STDOUT: %.loc10_32.3: = specific_function %.loc10_32.2, @Convert.4(constants.%.3) [symbolic = %.loc10_32.7 (constants.%.23)] +// CHECK:STDOUT: %int.convert_checked.loc10_32.1: init Core.IntLiteral = call %.loc10_32.3(%N.ref) [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_32.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_32.1 [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_32.5: Core.IntLiteral = converted %N.ref, %.loc10_32.4 [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_33: type = array_type %.loc10_32.5, %T [template = ] // CHECK:STDOUT: %T.ref.loc10_39: type = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc10_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc10_6.2 (constants.%T)] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc10_16.1: i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc10_16.2 (constants.%N.1)] +// CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc10_16.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc10_16.2 (constants.%N.1)] // CHECK:STDOUT: %a.param: = value_param runtime_param0 // CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref @F.%T.loc10_6.2 (%T) = out_param runtime_param1 @@ -497,45 +514,46 @@ fn G() -> C { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%T.loc10_6.1: type, %N.loc10_16.1: i32) { +// CHECK:STDOUT: generic fn @F(%T.loc10_6.1: type, %N.loc10_16.1: %i32) { // CHECK:STDOUT: %T.loc10_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_6.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc10_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.loc10_16.2: i32 = bind_symbolic_name N, 1 [symbolic = %N.loc10_16.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc10_16.2: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc10_16.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %.loc10_32.5: = bound_method %N.loc10_16.2, constants.%Convert.15 [symbolic = %.loc10_32.5 (constants.%.27)] -// CHECK:STDOUT: %int.convert_checked.loc10_32.2: init Core.IntLiteral = call %.loc10_32.5(%N.loc10_16.2) [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %N.loc10_16.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc10_16.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc10_16.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc10_16.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %.loc10_32.6: = bound_method %N.loc10_16.2, constants.%Convert.13 [symbolic = %.loc10_32.6 (constants.%.22)] +// CHECK:STDOUT: %.loc10_32.7: = specific_function %.loc10_32.6, @Convert.4(constants.%.3) [symbolic = %.loc10_32.7 (constants.%.23)] +// CHECK:STDOUT: %int.convert_checked.loc10_32.2: init Core.IntLiteral = call %.loc10_32.7(%N.loc10_16.2) [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.param_patt: type, %N.param_patt: i32](%a.param_patt: ) -> @F.%T.loc10_6.2 (%T); +// CHECK:STDOUT: fn[%T.param_patt: type, %N.param_patt: %i32](%a.param_patt: ) -> @F.%T.loc10_6.2 (%T); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc13_14: Core.IntLiteral = int_value 3 [template = constants.%.29] -// CHECK:STDOUT: %.loc13_15: type = array_type %.loc13_14, %C [template = constants.%.30] -// CHECK:STDOUT: %a.var: ref %.30 = var a -// CHECK:STDOUT: %a: ref %.30 = bind_name a, %a.var +// CHECK:STDOUT: %.loc13_14: Core.IntLiteral = int_value 3 [template = constants.%.25] +// CHECK:STDOUT: %.loc13_15: type = array_type %.loc13_14, %C [template = constants.%.26] +// CHECK:STDOUT: %a.var: ref %.26 = var a +// CHECK:STDOUT: %a: ref %.26 = bind_name a, %a.var // CHECK:STDOUT: %.loc13_21.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc13_25.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc13_29.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc13_30.1: %tuple.type = tuple_literal (%.loc13_21.1, %.loc13_25.1, %.loc13_29.1) -// CHECK:STDOUT: %.loc13_30.2: i32 = int_value 0 [template = constants.%.32] +// CHECK:STDOUT: %.loc13_30.2: Core.IntLiteral = int_value 0 [template = constants.%.28] // CHECK:STDOUT: %.loc13_30.3: ref %C = array_index %a.var, %.loc13_30.2 // CHECK:STDOUT: %.loc13_21.2: init %C = class_init (), %.loc13_30.3 [template = constants.%struct] // CHECK:STDOUT: %.loc13_30.4: init %C = converted %.loc13_21.1, %.loc13_21.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.5: i32 = int_value 1 [template = constants.%.33] +// CHECK:STDOUT: %.loc13_30.5: Core.IntLiteral = int_value 1 [template = constants.%.29] // CHECK:STDOUT: %.loc13_30.6: ref %C = array_index %a.var, %.loc13_30.5 // CHECK:STDOUT: %.loc13_25.2: init %C = class_init (), %.loc13_30.6 [template = constants.%struct] // CHECK:STDOUT: %.loc13_30.7: init %C = converted %.loc13_25.1, %.loc13_25.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.8: i32 = int_value 2 [template = constants.%.34] +// CHECK:STDOUT: %.loc13_30.8: Core.IntLiteral = int_value 2 [template = constants.%.30] // CHECK:STDOUT: %.loc13_30.9: ref %C = array_index %a.var, %.loc13_30.8 // CHECK:STDOUT: %.loc13_29.2: init %C = class_init (), %.loc13_30.9 [template = constants.%struct] // CHECK:STDOUT: %.loc13_30.10: init %C = converted %.loc13_29.1, %.loc13_29.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.11: init %.30 = array_init (%.loc13_30.4, %.loc13_30.7, %.loc13_30.10) to %a.var [template = constants.%array] -// CHECK:STDOUT: %.loc13_31: init %.30 = converted %.loc13_30.1, %.loc13_30.11 [template = constants.%array] +// CHECK:STDOUT: %.loc13_30.11: init %.26 = array_init (%.loc13_30.4, %.loc13_30.7, %.loc13_30.10) to %a.var [template = constants.%array] +// CHECK:STDOUT: %.loc13_31: init %.26 = converted %.loc13_30.1, %.loc13_30.11 [template = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc13_31 // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %a.ref: ref %.30 = name_ref a, %a +// CHECK:STDOUT: %a.ref: ref %.26 = name_ref a, %a // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -544,7 +562,8 @@ fn G() -> C { // CHECK:STDOUT: %T.patt.loc10_6.2 => constants.%T // CHECK:STDOUT: %N.loc10_16.2 => constants.%N.1 // CHECK:STDOUT: %N.patt.loc10_16.2 => constants.%N.1 -// CHECK:STDOUT: %.loc10_32.5 => constants.%.27 +// CHECK:STDOUT: %.loc10_32.6 => constants.%.22 +// CHECK:STDOUT: %.loc10_32.7 => constants.%.23 // CHECK:STDOUT: %int.convert_checked.loc10_32.2 => constants.%int.convert_checked // CHECK:STDOUT: } // CHECK:STDOUT: @@ -561,23 +580,25 @@ fn G() -> C { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.6: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.30: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.31: = bound_method %.6, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 0 [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.7 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.7) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.28: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.7) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 0 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.34: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.35: type = array_type %.34, %C [template] +// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.33: type = array_type %.32, %C [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (%.1, %.1, %.1) [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.37: i32 = int_value 1 [template] -// CHECK:STDOUT: %.38: i32 = int_value 2 [template] -// CHECK:STDOUT: %array: %.35 = tuple_value (%struct, %struct, %struct) [template] -// CHECK:STDOUT: %.39: type = array_type %.3, %C [template] -// CHECK:STDOUT: %.40: = specific_function %F, @F(%C) [template] +// CHECK:STDOUT: %.35: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %array: %.33 = tuple_value (%struct, %struct, %struct) [template] +// CHECK:STDOUT: %.36: type = array_type %.3, %C [template] +// CHECK:STDOUT: %.37: = specific_function %F, @F(%C) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -644,13 +665,14 @@ fn G() -> C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: @F.%.loc6_24.2 (%.4) = name_ref a, %a // CHECK:STDOUT: %.loc6_43.1: Core.IntLiteral = int_value 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc6_43.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_43.3: = bound_method %.loc6_43.1, %.loc6_43.2 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc6_43.3(%.loc6_43.1) [template = constants.%.32] -// CHECK:STDOUT: %.loc6_43.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.32] -// CHECK:STDOUT: %.loc6_43.5: i32 = converted %.loc6_43.1, %.loc6_43.4 [template = constants.%.32] +// CHECK:STDOUT: %.loc6_43.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_43.3: = bound_method %.loc6_43.1, %.loc6_43.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc6_43.4: = specific_function %.loc6_43.3, @Convert.2(constants.%.7) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc6_43.4(%.loc6_43.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc6_43.5: %i32 = value_of_initializer %int.convert_checked [template = constants.%.30] +// CHECK:STDOUT: %.loc6_43.6: %i32 = converted %.loc6_43.1, %.loc6_43.5 [template = constants.%.30] // CHECK:STDOUT: %.loc6_44.1: ref @F.%.loc6_24.2 (%.4) = value_as_ref %a.ref -// CHECK:STDOUT: %.loc6_44.2: ref @F.%T.loc6_6.2 (%T) = array_index %.loc6_44.1, %.loc6_43.5 +// CHECK:STDOUT: %.loc6_44.2: ref @F.%T.loc6_6.2 (%T) = array_index %.loc6_44.1, %.loc6_43.6 // CHECK:STDOUT: %.loc6_44.3: @F.%T.loc6_6.2 (%T) = bind_value %.loc6_44.2 // CHECK:STDOUT: return %.loc6_44.3 // CHECK:STDOUT: } @@ -659,34 +681,34 @@ fn G() -> C { // CHECK:STDOUT: fn @G() -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc10_14: Core.IntLiteral = int_value 3 [template = constants.%.34] -// CHECK:STDOUT: %.loc10_15: type = array_type %.loc10_14, %C [template = constants.%.35] -// CHECK:STDOUT: %a.var: ref %.35 = var a -// CHECK:STDOUT: %a: ref %.35 = bind_name a, %a.var +// CHECK:STDOUT: %.loc10_14: Core.IntLiteral = int_value 3 [template = constants.%.32] +// CHECK:STDOUT: %.loc10_15: type = array_type %.loc10_14, %C [template = constants.%.33] +// CHECK:STDOUT: %a.var: ref %.33 = var a +// CHECK:STDOUT: %a: ref %.33 = bind_name a, %a.var // CHECK:STDOUT: %.loc10_21.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc10_25.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc10_29.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc10_30.1: %tuple.type = tuple_literal (%.loc10_21.1, %.loc10_25.1, %.loc10_29.1) -// CHECK:STDOUT: %.loc10_30.2: i32 = int_value 0 [template = constants.%.32] +// CHECK:STDOUT: %.loc10_30.2: Core.IntLiteral = int_value 0 [template = constants.%.6] // CHECK:STDOUT: %.loc10_30.3: ref %C = array_index %a.var, %.loc10_30.2 // CHECK:STDOUT: %.loc10_21.2: init %C = class_init (), %.loc10_30.3 [template = constants.%struct] // CHECK:STDOUT: %.loc10_30.4: init %C = converted %.loc10_21.1, %.loc10_21.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc10_30.5: i32 = int_value 1 [template = constants.%.37] +// CHECK:STDOUT: %.loc10_30.5: Core.IntLiteral = int_value 1 [template = constants.%.35] // CHECK:STDOUT: %.loc10_30.6: ref %C = array_index %a.var, %.loc10_30.5 // CHECK:STDOUT: %.loc10_25.2: init %C = class_init (), %.loc10_30.6 [template = constants.%struct] // CHECK:STDOUT: %.loc10_30.7: init %C = converted %.loc10_25.1, %.loc10_25.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc10_30.8: i32 = int_value 2 [template = constants.%.38] +// CHECK:STDOUT: %.loc10_30.8: Core.IntLiteral = int_value 2 [template = constants.%.3] // CHECK:STDOUT: %.loc10_30.9: ref %C = array_index %a.var, %.loc10_30.8 // CHECK:STDOUT: %.loc10_29.2: init %C = class_init (), %.loc10_30.9 [template = constants.%struct] // CHECK:STDOUT: %.loc10_30.10: init %C = converted %.loc10_29.1, %.loc10_29.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc10_30.11: init %.35 = array_init (%.loc10_30.4, %.loc10_30.7, %.loc10_30.10) to %a.var [template = constants.%array] -// CHECK:STDOUT: %.loc10_31: init %.35 = converted %.loc10_30.1, %.loc10_30.11 [template = constants.%array] +// CHECK:STDOUT: %.loc10_30.11: init %.33 = array_init (%.loc10_30.4, %.loc10_30.7, %.loc10_30.10) to %a.var [template = constants.%array] +// CHECK:STDOUT: %.loc10_31: init %.33 = converted %.loc10_30.1, %.loc10_30.11 [template = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc10_31 // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %a.ref: ref %.35 = name_ref a, %a -// CHECK:STDOUT: %.loc21_10: = specific_function %F.ref, @F(constants.%C) [template = constants.%.40] +// CHECK:STDOUT: %a.ref: ref %.33 = name_ref a, %a +// CHECK:STDOUT: %.loc21_10: = specific_function %F.ref, @F(constants.%C) [template = constants.%.37] // CHECK:STDOUT: %.loc8_8.2: ref %C = splice_block %return {} -// CHECK:STDOUT: %.loc21_12: %.39 = converted %a.ref, [template = ] +// CHECK:STDOUT: %.loc21_12: %.36 = converted %a.ref, [template = ] // CHECK:STDOUT: %F.call: init %C = call %.loc21_10() to %.loc8_8.2 // CHECK:STDOUT: return %F.call to %return // CHECK:STDOUT: } @@ -700,7 +722,7 @@ fn G() -> C { // CHECK:STDOUT: specific @F(constants.%C) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%C // CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%C -// CHECK:STDOUT: %.loc6_24.2 => constants.%.39 +// CHECK:STDOUT: %.loc6_24.2 => constants.%.36 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -712,33 +734,36 @@ fn G() -> C { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %D: type = class_type @D [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt.1: i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.3 [template] +// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %N.1, %Convert.15 [symbolic] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.27(%N.1) [symbolic] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.4, @impl.3(%.3) [template] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] +// CHECK:STDOUT: %.21: = interface_witness (%Convert.13) [template] +// CHECK:STDOUT: %.22: = bound_method %N.1, %Convert.13 [symbolic] +// CHECK:STDOUT: %.23: = specific_function %.22, @Convert.4(%.3) [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.23(%N.1) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.30: type = array_type %.29, %D [template] +// CHECK:STDOUT: %.25: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.26: type = array_type %.25, %D [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (%.1, %.1, %.1) [template] -// CHECK:STDOUT: %.32: i32 = int_value 0 [template] +// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %struct: %D = struct_value () [template] -// CHECK:STDOUT: %.33: i32 = int_value 1 [template] -// CHECK:STDOUT: %.34: i32 = int_value 2 [template] -// CHECK:STDOUT: %array: %.30 = tuple_value (%struct, %struct, %struct) [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %array: %.26 = tuple_value (%struct, %struct, %struct) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -757,33 +782,36 @@ fn G() -> C { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt.loc10_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc10_6.1, runtime_param [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc10_6.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc10_6.1, runtime_param [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] // CHECK:STDOUT: %a.patt: = binding_pattern a // CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc10_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_10.1: type = value_of_initializer %int.make_type_32.loc10_10 [template = i32] -// CHECK:STDOUT: %.loc10_10.2: type = converted %int.make_type_32.loc10_10, %.loc10_10.1 [template = i32] +// CHECK:STDOUT: %.loc10_10.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc10_10: init type = call constants.%Int(%.loc10_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_10.2: type = value_of_initializer %int.make_type_signed.loc10_10 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_10.3: type = converted %int.make_type_signed.loc10_10, %.loc10_10.2 [template = constants.%i32] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %N.ref.loc10_22: i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.1)] -// CHECK:STDOUT: %.loc10_22.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_22.2: = bound_method %N.ref.loc10_22, %.loc10_22.1 [symbolic = %.loc10_22.5 (constants.%.27)] -// CHECK:STDOUT: %int.convert_checked.loc10_22.1: init Core.IntLiteral = call %.loc10_22.2(%N.ref.loc10_22) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc10_22.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc10_22.4: Core.IntLiteral = converted %N.ref.loc10_22, %.loc10_22.3 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc10_23: type = array_type %.loc10_22.4, %C [template = ] -// CHECK:STDOUT: %int.make_type_32.loc10_29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_32.loc10_29 [template = i32] -// CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_32.loc10_29, %.loc10_29.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc10_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.ref.loc10_22: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %.loc10_22.1: %Convert.type.2 = interface_witness_access constants.%.21, element0 [template = constants.%Convert.13] +// CHECK:STDOUT: %.loc10_22.2: = bound_method %N.ref.loc10_22, %.loc10_22.1 [symbolic = %.loc10_22.6 (constants.%.22)] +// CHECK:STDOUT: %.loc10_22.3: = specific_function %.loc10_22.2, @Convert.4(constants.%.3) [symbolic = %.loc10_22.7 (constants.%.23)] +// CHECK:STDOUT: %int.convert_checked.loc10_22.1: init Core.IntLiteral = call %.loc10_22.3(%N.ref.loc10_22) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_22.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_22.5: Core.IntLiteral = converted %N.ref.loc10_22, %.loc10_22.4 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_23: type = array_type %.loc10_22.5, %C [template = ] +// CHECK:STDOUT: %.loc10_29.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc10_29: init type = call constants.%Int(%.loc10_29.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_29.2: type = value_of_initializer %int.make_type_signed.loc10_29 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_29.3: type = converted %int.make_type_signed.loc10_29, %.loc10_29.2 [template = constants.%i32] +// CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc10_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc10_6.2 (constants.%N.1)] // CHECK:STDOUT: %a.param: = value_param runtime_param0 // CHECK:STDOUT: %a: = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern @@ -809,17 +837,18 @@ fn G() -> C { // CHECK:STDOUT: .Self = constants.%D // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%N.loc10_6.1: i32) { -// CHECK:STDOUT: %N.loc10_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc10_6.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc10_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %.loc10_22.5: = bound_method %N.loc10_6.2, constants.%Convert.15 [symbolic = %.loc10_22.5 (constants.%.27)] -// CHECK:STDOUT: %int.convert_checked.loc10_22.2: init Core.IntLiteral = call %.loc10_22.5(%N.loc10_6.2) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: generic fn @F(%N.loc10_6.1: %i32) { +// CHECK:STDOUT: %N.loc10_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc10_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %.loc10_22.6: = bound_method %N.loc10_6.2, constants.%Convert.13 [symbolic = %.loc10_22.6 (constants.%.22)] +// CHECK:STDOUT: %.loc10_22.7: = specific_function %.loc10_22.6, @Convert.4(constants.%.3) [symbolic = %.loc10_22.7 (constants.%.23)] +// CHECK:STDOUT: %int.convert_checked.loc10_22.2: init Core.IntLiteral = call %.loc10_22.7(%N.loc10_6.2) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%N.param_patt: i32](%a.param_patt: ) -> i32 { +// CHECK:STDOUT: fn[%N.param_patt: %i32](%a.param_patt: ) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %N.ref.loc10_42: i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.ref.loc10_42: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.1)] // CHECK:STDOUT: return %N.ref.loc10_42 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -827,38 +856,39 @@ fn G() -> C { // CHECK:STDOUT: fn @G() -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %.loc13_14: Core.IntLiteral = int_value 3 [template = constants.%.29] -// CHECK:STDOUT: %.loc13_15: type = array_type %.loc13_14, %D [template = constants.%.30] -// CHECK:STDOUT: %a.var: ref %.30 = var a -// CHECK:STDOUT: %a: ref %.30 = bind_name a, %a.var +// CHECK:STDOUT: %.loc13_14: Core.IntLiteral = int_value 3 [template = constants.%.25] +// CHECK:STDOUT: %.loc13_15: type = array_type %.loc13_14, %D [template = constants.%.26] +// CHECK:STDOUT: %a.var: ref %.26 = var a +// CHECK:STDOUT: %a: ref %.26 = bind_name a, %a.var // CHECK:STDOUT: %.loc13_21.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc13_25.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc13_29.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc13_30.1: %tuple.type = tuple_literal (%.loc13_21.1, %.loc13_25.1, %.loc13_29.1) -// CHECK:STDOUT: %.loc13_30.2: i32 = int_value 0 [template = constants.%.32] +// CHECK:STDOUT: %.loc13_30.2: Core.IntLiteral = int_value 0 [template = constants.%.28] // CHECK:STDOUT: %.loc13_30.3: ref %D = array_index %a.var, %.loc13_30.2 // CHECK:STDOUT: %.loc13_21.2: init %D = class_init (), %.loc13_30.3 [template = constants.%struct] // CHECK:STDOUT: %.loc13_30.4: init %D = converted %.loc13_21.1, %.loc13_21.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.5: i32 = int_value 1 [template = constants.%.33] +// CHECK:STDOUT: %.loc13_30.5: Core.IntLiteral = int_value 1 [template = constants.%.29] // CHECK:STDOUT: %.loc13_30.6: ref %D = array_index %a.var, %.loc13_30.5 // CHECK:STDOUT: %.loc13_25.2: init %D = class_init (), %.loc13_30.6 [template = constants.%struct] // CHECK:STDOUT: %.loc13_30.7: init %D = converted %.loc13_25.1, %.loc13_25.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.8: i32 = int_value 2 [template = constants.%.34] +// CHECK:STDOUT: %.loc13_30.8: Core.IntLiteral = int_value 2 [template = constants.%.30] // CHECK:STDOUT: %.loc13_30.9: ref %D = array_index %a.var, %.loc13_30.8 // CHECK:STDOUT: %.loc13_29.2: init %D = class_init (), %.loc13_30.9 [template = constants.%struct] // CHECK:STDOUT: %.loc13_30.10: init %D = converted %.loc13_29.1, %.loc13_29.2 [template = constants.%struct] -// CHECK:STDOUT: %.loc13_30.11: init %.30 = array_init (%.loc13_30.4, %.loc13_30.7, %.loc13_30.10) to %a.var [template = constants.%array] -// CHECK:STDOUT: %.loc13_31: init %.30 = converted %.loc13_30.1, %.loc13_30.11 [template = constants.%array] +// CHECK:STDOUT: %.loc13_30.11: init %.26 = array_init (%.loc13_30.4, %.loc13_30.7, %.loc13_30.10) to %a.var [template = constants.%array] +// CHECK:STDOUT: %.loc13_31: init %.26 = converted %.loc13_30.1, %.loc13_30.11 [template = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc13_31 // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %a.ref: ref %.30 = name_ref a, %a +// CHECK:STDOUT: %a.ref: ref %.26 = name_ref a, %a // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N.1) { // CHECK:STDOUT: %N.loc10_6.2 => constants.%N.1 // CHECK:STDOUT: %N.patt.loc10_6.2 => constants.%N.1 -// CHECK:STDOUT: %.loc10_22.5 => constants.%.27 +// CHECK:STDOUT: %.loc10_22.6 => constants.%.22 +// CHECK:STDOUT: %.loc10_22.7 => constants.%.23 // CHECK:STDOUT: %int.convert_checked.loc10_22.2 => constants.%int.convert_checked // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/generic_type.carbon b/toolchain/check/testdata/deduce/generic_type.carbon index ed5030884a59..d44f76b660ff 100644 --- a/toolchain/check/testdata/deduce/generic_type.carbon +++ b/toolchain/check/testdata/deduce/generic_type.carbon @@ -714,34 +714,37 @@ fn G() -> i32 { // CHECK:STDOUT: --- nontype.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt.1: i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %WithNontype.type: type = generic_class_type @WithNontype [template] // CHECK:STDOUT: %WithNontype.1: %WithNontype.type = struct_value () [template] // CHECK:STDOUT: %WithNontype.2: type = class_type @WithNontype, @WithNontype(%N.1) [symbolic] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.29: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 0 [template] -// CHECK:STDOUT: %WithNontype.3: type = class_type @WithNontype, @WithNontype(%.30) [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.26: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.27: = specific_function %.26, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.28: %i32 = int_value 0 [template] +// CHECK:STDOUT: %WithNontype.3: type = class_type @WithNontype, @WithNontype(%.28) [template] // CHECK:STDOUT: %struct: %WithNontype.3 = struct_value () [template] -// CHECK:STDOUT: %.31: = specific_function %F, @F(%.30) [template] +// CHECK:STDOUT: %.29: = specific_function %F, @F(%.28) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -757,100 +760,105 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %WithNontype.decl: %WithNontype.type = class_decl @WithNontype [template = constants.%WithNontype.1] { -// CHECK:STDOUT: %N.patt.loc4_19.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc4_19.1, runtime_param [symbolic = %N.patt.loc4_19.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc4_19.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_19.1, runtime_param [symbolic = %N.patt.loc4_19.2 (constants.%N.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_23.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_23.2: type = converted %int.make_type_32, %.loc4_23.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc4_19.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_19.2 (constants.%N.1)] +// CHECK:STDOUT: %.loc4_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_23.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_23.3: type = converted %int.make_type_signed, %.loc4_23.2 [template = constants.%i32] +// CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc4_19.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_19.2 (constants.%N.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt.loc6_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc6_6.1, runtime_param [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc6_6.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc6_6.1, runtime_param [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.1)] // CHECK:STDOUT: %x.patt: @F.%WithNontype.loc6_29.2 (%WithNontype.2) = binding_pattern x // CHECK:STDOUT: %x.param_patt: @F.%WithNontype.loc6_29.2 (%WithNontype.2) = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc6_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_32.loc6_10 [template = i32] -// CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_32.loc6_10, %.loc6_10.1 [template = i32] +// CHECK:STDOUT: %.loc6_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_10: init type = call constants.%Int(%.loc6_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_10.2: type = value_of_initializer %int.make_type_signed.loc6_10 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_10.3: type = converted %int.make_type_signed.loc6_10, %.loc6_10.2 [template = constants.%i32] // CHECK:STDOUT: %WithNontype.ref: %WithNontype.type = name_ref WithNontype, file.%WithNontype.decl [template = constants.%WithNontype.1] -// CHECK:STDOUT: %N.ref.loc6_30: i32 = name_ref N, %N.loc6_6.1 [symbolic = %N.loc6_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.ref.loc6_30: %i32 = name_ref N, %N.loc6_6.1 [symbolic = %N.loc6_6.2 (constants.%N.1)] // CHECK:STDOUT: %WithNontype.loc6_29.1: type = class_type @WithNontype, @WithNontype(constants.%N.1) [symbolic = %WithNontype.loc6_29.2 (constants.%WithNontype.2)] -// CHECK:STDOUT: %int.make_type_32.loc6_37: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_37.1: type = value_of_initializer %int.make_type_32.loc6_37 [template = i32] -// CHECK:STDOUT: %.loc6_37.2: type = converted %int.make_type_32.loc6_37, %.loc6_37.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc6_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc6_6.2 (constants.%N.1)] +// CHECK:STDOUT: %.loc6_37.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_37: init type = call constants.%Int(%.loc6_37.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_37.2: type = value_of_initializer %int.make_type_signed.loc6_37 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_37.3: type = converted %int.make_type_signed.loc6_37, %.loc6_37.2 [template = constants.%i32] +// CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc6_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc6_6.2 (constants.%N.1)] // CHECK:STDOUT: %x.param: @F.%WithNontype.loc6_29.2 (%WithNontype.2) = value_param runtime_param0 // CHECK:STDOUT: %x: @F.%WithNontype.loc6_29.2 (%WithNontype.2) = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_11.2: type = converted %int.make_type_32, %.loc8_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc8_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_11.3: type = converted %int.make_type_signed, %.loc8_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @WithNontype(%N.loc4_19.1: i32) { -// CHECK:STDOUT: %N.loc4_19.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_19.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc4_19.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt.1)] +// CHECK:STDOUT: generic class @WithNontype(%N.loc4_19.1: %i32) { +// CHECK:STDOUT: %N.loc4_19.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_19.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc4_19.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc4_29: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_29: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%WithNontype.2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%N.loc6_6.1: i32) { -// CHECK:STDOUT: %N.loc6_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc6_6.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc6_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: generic fn @F(%N.loc6_6.1: %i32) { +// CHECK:STDOUT: %N.loc6_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc6_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc6_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.1)] // CHECK:STDOUT: %WithNontype.loc6_29.2: type = class_type @WithNontype, @WithNontype(%N.loc6_6.2) [symbolic = %WithNontype.loc6_29.2 (constants.%WithNontype.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%N.param_patt: i32](%x.param_patt: @F.%WithNontype.loc6_29.2 (%WithNontype.2)) -> i32 { +// CHECK:STDOUT: fn[%N.param_patt: %i32](%x.param_patt: @F.%WithNontype.loc6_29.2 (%WithNontype.2)) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %N.ref.loc6_50: i32 = name_ref N, %N.loc6_6.1 [symbolic = %N.loc6_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.ref.loc6_50: %i32 = name_ref N, %N.loc6_6.1 [symbolic = %N.loc6_6.2 (constants.%N.1)] // CHECK:STDOUT: return %N.ref.loc6_50 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> i32 { +// CHECK:STDOUT: fn @G() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %.loc9_13.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc9_13.1: %.2 = struct_literal () // CHECK:STDOUT: %WithNontype.ref: %WithNontype.type = name_ref WithNontype, file.%WithNontype.decl [template = constants.%WithNontype.1] -// CHECK:STDOUT: %.loc9_30: Core.IntLiteral = int_value 0 [template = constants.%.4] -// CHECK:STDOUT: %.loc9_29.1: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_29.2: = bound_method %.loc9_30, %.loc9_29.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc9_29.2(%.loc9_30) [template = constants.%.30] -// CHECK:STDOUT: %.loc9_29.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.30] -// CHECK:STDOUT: %.loc9_29.4: i32 = converted %.loc9_30, %.loc9_29.3 [template = constants.%.30] -// CHECK:STDOUT: %WithNontype: type = class_type @WithNontype, @WithNontype(constants.%.30) [template = constants.%WithNontype.3] +// CHECK:STDOUT: %.loc9_30: Core.IntLiteral = int_value 0 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_29.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_29.2: = bound_method %.loc9_30, %.loc9_29.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc9_29.3: = specific_function %.loc9_29.2, @Convert.2(constants.%.1) [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc9_29.3(%.loc9_30) [template = constants.%.28] +// CHECK:STDOUT: %.loc9_29.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.28] +// CHECK:STDOUT: %.loc9_29.5: %i32 = converted %.loc9_30, %.loc9_29.4 [template = constants.%.28] +// CHECK:STDOUT: %WithNontype: type = class_type @WithNontype, @WithNontype(constants.%.28) [template = constants.%WithNontype.3] // CHECK:STDOUT: %.loc9_13.2: ref %WithNontype.3 = temporary_storage // CHECK:STDOUT: %.loc9_13.3: init %WithNontype.3 = class_init (), %.loc9_13.2 [template = constants.%struct] // CHECK:STDOUT: %.loc9_13.4: ref %WithNontype.3 = temporary %.loc9_13.2, %.loc9_13.3 // CHECK:STDOUT: %.loc9_15.1: ref %WithNontype.3 = converted %.loc9_13.1, %.loc9_13.4 -// CHECK:STDOUT: %.loc9_10: = specific_function %F.ref, @F(constants.%.30) [template = constants.%.31] +// CHECK:STDOUT: %.loc9_10: = specific_function %F.ref, @F(constants.%.28) [template = constants.%.29] // CHECK:STDOUT: %.loc9_15.2: %WithNontype.3 = bind_value %.loc9_15.1 -// CHECK:STDOUT: %F.call: init i32 = call %.loc9_10(%.loc9_15.2) -// CHECK:STDOUT: %.loc9_33.1: i32 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc9_33.2: i32 = converted %F.call, %.loc9_33.1 +// CHECK:STDOUT: %F.call: init %i32 = call %.loc9_10(%.loc9_15.2) +// CHECK:STDOUT: %.loc9_33.1: %i32 = value_of_initializer %F.call +// CHECK:STDOUT: %.loc9_33.2: %i32 = converted %F.call, %.loc9_33.1 // CHECK:STDOUT: return %.loc9_33.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -872,16 +880,16 @@ fn G() -> i32 { // CHECK:STDOUT: %WithNontype.loc6_29.2 => constants.%WithNontype.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @WithNontype(constants.%.30) { -// CHECK:STDOUT: %N.loc4_19.2 => constants.%.30 -// CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%.30 +// CHECK:STDOUT: specific @WithNontype(constants.%.28) { +// CHECK:STDOUT: %N.loc4_19.2 => constants.%.28 +// CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%.28 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%.30) { -// CHECK:STDOUT: %N.loc6_6.2 => constants.%.30 -// CHECK:STDOUT: %N.patt.loc6_6.2 => constants.%.30 +// CHECK:STDOUT: specific @F(constants.%.28) { +// CHECK:STDOUT: %N.loc6_6.2 => constants.%.28 +// CHECK:STDOUT: %N.patt.loc6_6.2 => constants.%.28 // CHECK:STDOUT: %WithNontype.loc6_29.2 => constants.%WithNontype.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/deduce/int_float.carbon b/toolchain/check/testdata/deduce/int_float.carbon index 4bcf8ece1f61..48bd83fd7439 100644 --- a/toolchain/check/testdata/deduce/int_float.carbon +++ b/toolchain/check/testdata/deduce/int_float.carbon @@ -45,14 +45,14 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %.3: type = int_type signed, %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %i64: type = int_type signed, %.1 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.4: = specific_function %F, @F(%.2) [template] +// CHECK:STDOUT: %.2: = specific_function %F, @F(%.1) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -63,7 +63,7 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types, inst+7, loaded [template = constants.%IntLiteral] -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types, inst+30, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types, inst+23, loaded [template = constants.%Int] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -76,8 +76,8 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %N.patt.loc4_6.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_6.2 (constants.%N.patt)] // CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc4_6.1, runtime_param [symbolic = %N.patt.loc4_6.2 (constants.%N.patt)] -// CHECK:STDOUT: %n.patt: @F.%.loc4_40 (%.1) = binding_pattern n -// CHECK:STDOUT: %n.param_patt: @F.%.loc4_40 (%.1) = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %n.patt: @F.%iN (%iN) = binding_pattern n +// CHECK:STDOUT: %n.param_patt: @F.%iN (%iN) = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { @@ -89,9 +89,9 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %Core.ref.loc4_32: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %N.ref.loc4: Core.IntLiteral = name_ref N, %N.loc4_6.1 [symbolic = %N.loc4_6.2 (constants.%N)] -// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%N.ref.loc4) [symbolic = %.loc4_40 (constants.%.1)] -// CHECK:STDOUT: %.loc4_42.1: type = value_of_initializer %int.make_type_signed [symbolic = %.loc4_40 (constants.%.1)] -// CHECK:STDOUT: %.loc4_42.2: type = converted %int.make_type_signed, %.loc4_42.1 [symbolic = %.loc4_40 (constants.%.1)] +// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%N.ref.loc4) [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %.loc4_42.1: type = value_of_initializer %int.make_type_signed [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %.loc4_42.2: type = converted %int.make_type_signed, %.loc4_42.1 [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: %Core.ref.loc4_48: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %IntLiteral.ref.loc4_52: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type.loc4_63: init type = call %IntLiteral.ref.loc4_52() [template = Core.IntLiteral] @@ -99,28 +99,28 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %.loc4_64.2: type = converted %int_literal.make_type.loc4_63, %.loc4_64.1 [template = Core.IntLiteral] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param // CHECK:STDOUT: %N.loc4_6.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_6.2 (constants.%N)] -// CHECK:STDOUT: %n.param: @F.%.loc4_40 (%.1) = value_param runtime_param0 -// CHECK:STDOUT: %n: @F.%.loc4_40 (%.1) = bind_name n, %n.param +// CHECK:STDOUT: %n.param: @F.%iN (%iN) = value_param runtime_param0 +// CHECK:STDOUT: %n: @F.%iN (%iN) = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %a.patt: %.3 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %.3 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %i64 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc8_9.1: Core.IntLiteral = int_value 64 [template = constants.%.2] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_9.1) [template = constants.%.3] -// CHECK:STDOUT: %.loc8_9.2: type = value_of_initializer %int.make_type_signed [template = constants.%.3] -// CHECK:STDOUT: %.loc8_9.3: type = converted %int.make_type_signed, %.loc8_9.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc8_9.1: Core.IntLiteral = int_value 64 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_9.1) [template = constants.%i64] +// CHECK:STDOUT: %.loc8_9.2: type = value_of_initializer %int.make_type_signed [template = constants.%i64] +// CHECK:STDOUT: %.loc8_9.3: type = converted %int.make_type_signed, %.loc8_9.2 [template = constants.%i64] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc8_33.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc8_33.2: type = converted %int_literal.make_type, %.loc8_33.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %a.param: %.3 = value_param runtime_param0 -// CHECK:STDOUT: %a: %.3 = bind_name a, %a.param +// CHECK:STDOUT: %a.param: %i64 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param // CHECK:STDOUT: } @@ -129,22 +129,22 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: generic fn @F(%N.loc4_6.1: Core.IntLiteral) { // CHECK:STDOUT: %N.loc4_6.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc4_6.2 (constants.%N)] // CHECK:STDOUT: %N.patt.loc4_6.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_6.2 (constants.%N.patt)] -// CHECK:STDOUT: %.loc4_40: type = int_type signed, %N.loc4_6.2 [symbolic = %.loc4_40 (constants.%.1)] +// CHECK:STDOUT: %iN: type = int_type signed, %N.loc4_6.2 [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%N.param_patt: Core.IntLiteral](%n.param_patt: @F.%.loc4_40 (%.1)) -> Core.IntLiteral { +// CHECK:STDOUT: fn[%N.param_patt: Core.IntLiteral](%n.param_patt: @F.%iN (%iN)) -> Core.IntLiteral { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref.loc5: Core.IntLiteral = name_ref N, %N.loc4_6.1 [symbolic = %N.loc4_6.2 (constants.%N)] // CHECK:STDOUT: return %N.ref.loc5 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%a.param_patt: %.3) -> Core.IntLiteral { +// CHECK:STDOUT: fn @G(%a.param_patt: %i64) -> Core.IntLiteral { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %a.ref: %.3 = name_ref a, %a -// CHECK:STDOUT: %.loc9_10: = specific_function %F.ref, @F(constants.%.2) [template = constants.%.4] +// CHECK:STDOUT: %a.ref: %i64 = name_ref a, %a +// CHECK:STDOUT: %.loc9_10: = specific_function %F.ref, @F(constants.%.1) [template = constants.%.2] // CHECK:STDOUT: %F.call: init Core.IntLiteral = call %.loc9_10(%a.ref) // CHECK:STDOUT: %.loc9_14.1: Core.IntLiteral = value_of_initializer %F.call // CHECK:STDOUT: %.loc9_14.2: Core.IntLiteral = converted %F.call, %.loc9_14.1 @@ -154,13 +154,13 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc4_6.2 => constants.%N // CHECK:STDOUT: %N.patt.loc4_6.2 => constants.%N -// CHECK:STDOUT: %.loc4_40 => constants.%.1 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%.2) { -// CHECK:STDOUT: %N.loc4_6.2 => constants.%.2 -// CHECK:STDOUT: %N.patt.loc4_6.2 => constants.%.2 -// CHECK:STDOUT: %.loc4_40 => constants.%.3 +// CHECK:STDOUT: specific @F(constants.%.1) { +// CHECK:STDOUT: %N.loc4_6.2 => constants.%.1 +// CHECK:STDOUT: %N.patt.loc4_6.2 => constants.%.1 +// CHECK:STDOUT: %iN => constants.%i64 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -189,7 +189,7 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types, inst+7, loaded [template = constants.%IntLiteral] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+60, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+53, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/deduce/tuple.carbon b/toolchain/check/testdata/deduce/tuple.carbon index 81ce433754e3..22486f46b731 100644 --- a/toolchain/check/testdata/deduce/tuple.carbon +++ b/toolchain/check/testdata/deduce/tuple.carbon @@ -213,46 +213,50 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: --- tuple_value.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %Pair: %tuple.type.2 = bind_symbolic_name Pair, 0 [symbolic] // CHECK:STDOUT: %Pair.patt: %tuple.type.2 = symbolic_binding_pattern Pair, 0 [symbolic] // CHECK:STDOUT: %HasPair.type: type = generic_class_type @HasPair [template] // CHECK:STDOUT: %HasPair.1: %HasPair.type = struct_value () [template] // CHECK:STDOUT: %HasPair.2: type = class_type @HasPair, @HasPair(%Pair) [symbolic] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] -// CHECK:STDOUT: %A: i32 = bind_symbolic_name A, 0 [symbolic] -// CHECK:STDOUT: %A.patt: i32 = symbolic_binding_pattern A, 0 [symbolic] -// CHECK:STDOUT: %B: i32 = bind_symbolic_name B, 1 [symbolic] -// CHECK:STDOUT: %B.patt: i32 = symbolic_binding_pattern B, 1 [symbolic] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %A: %i32 = bind_symbolic_name A, 0 [symbolic] +// CHECK:STDOUT: %A.patt: %i32 = symbolic_binding_pattern A, 0 [symbolic] +// CHECK:STDOUT: %B: %i32 = bind_symbolic_name B, 1 [symbolic] +// CHECK:STDOUT: %B.patt: %i32 = symbolic_binding_pattern B, 1 [symbolic] // CHECK:STDOUT: %tuple.1: %tuple.type.2 = tuple_value (%A, %B) [symbolic] // CHECK:STDOUT: %HasPair.3: type = class_type @HasPair, @HasPair(%tuple.1) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.30: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.31: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 1 [template] -// CHECK:STDOUT: %.33: = bound_method %.6, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 2 [template] -// CHECK:STDOUT: %tuple.2: %tuple.type.2 = tuple_value (%.32, %.34) [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.28: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: = bound_method %.7, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 2 [template] +// CHECK:STDOUT: %tuple.2: %tuple.type.2 = tuple_value (%.30, %.33) [template] // CHECK:STDOUT: %HasPair.4: type = class_type @HasPair, @HasPair(%tuple.2) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.35: = specific_function %F, @F(%.32, %.34) [template] +// CHECK:STDOUT: %.34: = specific_function %F, @F(%.30, %.33) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -271,82 +275,90 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %Pair.patt.loc4_15.1: %tuple.type.2 = symbolic_binding_pattern Pair, 0 [symbolic = %Pair.patt.loc4_15.2 (constants.%Pair.patt)] // CHECK:STDOUT: %Pair.param_patt: %tuple.type.2 = value_param_pattern %Pair.patt.loc4_15.1, runtime_param [symbolic = %Pair.patt.loc4_15.2 (constants.%Pair.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4_23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_28: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_31.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc4_23, %int.make_type_32.loc4_28) -// CHECK:STDOUT: %.loc4_31.2: type = value_of_initializer %int.make_type_32.loc4_23 [template = i32] -// CHECK:STDOUT: %.loc4_31.3: type = converted %int.make_type_32.loc4_23, %.loc4_31.2 [template = i32] -// CHECK:STDOUT: %.loc4_31.4: type = value_of_initializer %int.make_type_32.loc4_28 [template = i32] -// CHECK:STDOUT: %.loc4_31.5: type = converted %int.make_type_32.loc4_28, %.loc4_31.4 [template = i32] +// CHECK:STDOUT: %.loc4_23: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_23: init type = call constants.%Int(%.loc4_23) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_28: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_28: init type = call constants.%Int(%.loc4_28) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_31.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc4_23, %int.make_type_signed.loc4_28) +// CHECK:STDOUT: %.loc4_31.2: type = value_of_initializer %int.make_type_signed.loc4_23 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_31.3: type = converted %int.make_type_signed.loc4_23, %.loc4_31.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_31.4: type = value_of_initializer %int.make_type_signed.loc4_28 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_31.5: type = converted %int.make_type_signed.loc4_28, %.loc4_31.4 [template = constants.%i32] // CHECK:STDOUT: %.loc4_31.6: type = converted %.loc4_31.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %Pair.param: %tuple.type.2 = value_param runtime_param // CHECK:STDOUT: %Pair.loc4_15.1: %tuple.type.2 = bind_symbolic_name Pair, 0, %Pair.param [symbolic = %Pair.loc4_15.2 (constants.%Pair)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %A.patt.loc6_6.1: i32 = symbolic_binding_pattern A, 0 [symbolic = %A.patt.loc6_6.2 (constants.%A.patt)] -// CHECK:STDOUT: %A.param_patt: i32 = value_param_pattern %A.patt.loc6_6.1, runtime_param [symbolic = %A.patt.loc6_6.2 (constants.%A.patt)] -// CHECK:STDOUT: %B.patt.loc6_15.1: i32 = symbolic_binding_pattern B, 1 [symbolic = %B.patt.loc6_15.2 (constants.%B.patt)] -// CHECK:STDOUT: %B.param_patt: i32 = value_param_pattern %B.patt.loc6_15.1, runtime_param [symbolic = %B.patt.loc6_15.2 (constants.%B.patt)] +// CHECK:STDOUT: %A.patt.loc6_6.1: %i32 = symbolic_binding_pattern A, 0 [symbolic = %A.patt.loc6_6.2 (constants.%A.patt)] +// CHECK:STDOUT: %A.param_patt: %i32 = value_param_pattern %A.patt.loc6_6.1, runtime_param [symbolic = %A.patt.loc6_6.2 (constants.%A.patt)] +// CHECK:STDOUT: %B.patt.loc6_15.1: %i32 = symbolic_binding_pattern B, 1 [symbolic = %B.patt.loc6_15.2 (constants.%B.patt)] +// CHECK:STDOUT: %B.param_patt: %i32 = value_param_pattern %B.patt.loc6_15.1, runtime_param [symbolic = %B.patt.loc6_15.2 (constants.%B.patt)] // CHECK:STDOUT: %h.patt: @F.%HasPair.loc6_34.2 (%HasPair.3) = binding_pattern h // CHECK:STDOUT: %h.param_patt: @F.%HasPair.loc6_34.2 (%HasPair.3) = value_param_pattern %h.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc6_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_32.loc6_10 [template = i32] -// CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_32.loc6_10, %.loc6_10.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc6_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_19.1: type = value_of_initializer %int.make_type_32.loc6_19 [template = i32] -// CHECK:STDOUT: %.loc6_19.2: type = converted %int.make_type_32.loc6_19, %.loc6_19.1 [template = i32] +// CHECK:STDOUT: %.loc6_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_10: init type = call constants.%Int(%.loc6_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_10.2: type = value_of_initializer %int.make_type_signed.loc6_10 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_10.3: type = converted %int.make_type_signed.loc6_10, %.loc6_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_19: init type = call constants.%Int(%.loc6_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_19.2: type = value_of_initializer %int.make_type_signed.loc6_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_19.3: type = converted %int.make_type_signed.loc6_19, %.loc6_19.2 [template = constants.%i32] // CHECK:STDOUT: %HasPair.ref: %HasPair.type = name_ref HasPair, file.%HasPair.decl [template = constants.%HasPair.1] -// CHECK:STDOUT: %A.ref: i32 = name_ref A, %A.loc6_6.1 [symbolic = %A.loc6_6.2 (constants.%A)] -// CHECK:STDOUT: %B.ref.loc6_39: i32 = name_ref B, %B.loc6_15.1 [symbolic = %B.loc6_15.2 (constants.%B)] +// CHECK:STDOUT: %A.ref: %i32 = name_ref A, %A.loc6_6.1 [symbolic = %A.loc6_6.2 (constants.%A)] +// CHECK:STDOUT: %B.ref.loc6_39: %i32 = name_ref B, %B.loc6_15.1 [symbolic = %B.loc6_15.2 (constants.%B)] // CHECK:STDOUT: %.loc6_40: %tuple.type.2 = tuple_literal (%A.ref, %B.ref.loc6_39) // CHECK:STDOUT: %tuple.loc6_40.1: %tuple.type.2 = tuple_value (%A.ref, %B.ref.loc6_39) [symbolic = %tuple.loc6_40.2 (constants.%tuple.1)] // CHECK:STDOUT: %.loc6_34: %tuple.type.2 = converted %.loc6_40, %tuple.loc6_40.1 [symbolic = %tuple.loc6_40.2 (constants.%tuple.1)] // CHECK:STDOUT: %HasPair.loc6_34.1: type = class_type @HasPair, @HasPair(constants.%tuple.1) [symbolic = %HasPair.loc6_34.2 (constants.%HasPair.3)] -// CHECK:STDOUT: %int.make_type_32.loc6_47: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_47.1: type = value_of_initializer %int.make_type_32.loc6_47 [template = i32] -// CHECK:STDOUT: %.loc6_47.2: type = converted %int.make_type_32.loc6_47, %.loc6_47.1 [template = i32] -// CHECK:STDOUT: %A.param: i32 = value_param runtime_param -// CHECK:STDOUT: %A.loc6_6.1: i32 = bind_symbolic_name A, 0, %A.param [symbolic = %A.loc6_6.2 (constants.%A)] -// CHECK:STDOUT: %B.param: i32 = value_param runtime_param -// CHECK:STDOUT: %B.loc6_15.1: i32 = bind_symbolic_name B, 1, %B.param [symbolic = %B.loc6_15.2 (constants.%B)] +// CHECK:STDOUT: %.loc6_47.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_47: init type = call constants.%Int(%.loc6_47.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_47.2: type = value_of_initializer %int.make_type_signed.loc6_47 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_47.3: type = converted %int.make_type_signed.loc6_47, %.loc6_47.2 [template = constants.%i32] +// CHECK:STDOUT: %A.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %A.loc6_6.1: %i32 = bind_symbolic_name A, 0, %A.param [symbolic = %A.loc6_6.2 (constants.%A)] +// CHECK:STDOUT: %B.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %B.loc6_15.1: %i32 = bind_symbolic_name B, 1, %B.param [symbolic = %B.loc6_15.2 (constants.%B)] // CHECK:STDOUT: %h.param: @F.%HasPair.loc6_34.2 (%HasPair.3) = value_param runtime_param0 // CHECK:STDOUT: %h: @F.%HasPair.loc6_34.2 (%HasPair.3) = bind_name h, %h.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %h.patt: %HasPair.4 = binding_pattern h // CHECK:STDOUT: %h.param_patt: %HasPair.4 = value_param_pattern %h.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %HasPair.ref: %HasPair.type = name_ref HasPair, file.%HasPair.decl [template = constants.%HasPair.1] -// CHECK:STDOUT: %.loc8_18: Core.IntLiteral = int_value 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc8_21: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc8_18: Core.IntLiteral = int_value 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc8_21: Core.IntLiteral = int_value 2 [template = constants.%.7] // CHECK:STDOUT: %.loc8_22.1: %tuple.type.3 = tuple_literal (%.loc8_18, %.loc8_21) -// CHECK:STDOUT: %.loc8_22.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_22.3: = bound_method %.loc8_18, %.loc8_22.2 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc8_22.1: init i32 = call %.loc8_22.3(%.loc8_18) [template = constants.%.32] -// CHECK:STDOUT: %.loc8_22.4: i32 = value_of_initializer %int.convert_checked.loc8_22.1 [template = constants.%.32] -// CHECK:STDOUT: %.loc8_22.5: i32 = converted %.loc8_18, %.loc8_22.4 [template = constants.%.32] -// CHECK:STDOUT: %.loc8_22.6: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_22.7: = bound_method %.loc8_21, %.loc8_22.6 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc8_22.2: init i32 = call %.loc8_22.7(%.loc8_21) [template = constants.%.34] -// CHECK:STDOUT: %.loc8_22.8: i32 = value_of_initializer %int.convert_checked.loc8_22.2 [template = constants.%.34] -// CHECK:STDOUT: %.loc8_22.9: i32 = converted %.loc8_21, %.loc8_22.8 [template = constants.%.34] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.loc8_22.5, %.loc8_22.9) [template = constants.%tuple.2] +// CHECK:STDOUT: %.loc8_22.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_22.3: = bound_method %.loc8_18, %.loc8_22.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc8_22.4: = specific_function %.loc8_22.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc8_22.1: init %i32 = call %.loc8_22.4(%.loc8_18) [template = constants.%.30] +// CHECK:STDOUT: %.loc8_22.5: %i32 = value_of_initializer %int.convert_checked.loc8_22.1 [template = constants.%.30] +// CHECK:STDOUT: %.loc8_22.6: %i32 = converted %.loc8_18, %.loc8_22.5 [template = constants.%.30] +// CHECK:STDOUT: %.loc8_22.7: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_22.8: = bound_method %.loc8_21, %.loc8_22.7 [template = constants.%.31] +// CHECK:STDOUT: %.loc8_22.9: = specific_function %.loc8_22.8, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc8_22.2: init %i32 = call %.loc8_22.9(%.loc8_21) [template = constants.%.33] +// CHECK:STDOUT: %.loc8_22.10: %i32 = value_of_initializer %int.convert_checked.loc8_22.2 [template = constants.%.33] +// CHECK:STDOUT: %.loc8_22.11: %i32 = converted %.loc8_21, %.loc8_22.10 [template = constants.%.33] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.loc8_22.6, %.loc8_22.11) [template = constants.%tuple.2] // CHECK:STDOUT: %.loc8_16: %tuple.type.2 = converted %.loc8_22.1, %tuple [template = constants.%tuple.2] // CHECK:STDOUT: %HasPair: type = class_type @HasPair, @HasPair(constants.%tuple.2) [template = constants.%HasPair.4] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_29.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_29.2: type = converted %int.make_type_32, %.loc8_29.1 [template = i32] +// CHECK:STDOUT: %.loc8_29.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_29.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_29.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_29.3: type = converted %int.make_type_signed, %.loc8_29.2 [template = constants.%i32] // CHECK:STDOUT: %h.param: %HasPair.4 = value_param runtime_param0 // CHECK:STDOUT: %h: %HasPair.4 = bind_name h, %h.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -357,38 +369,38 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc4_35: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_35: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%HasPair.2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%A.loc6_6.1: i32, %B.loc6_15.1: i32) { -// CHECK:STDOUT: %A.loc6_6.2: i32 = bind_symbolic_name A, 0 [symbolic = %A.loc6_6.2 (constants.%A)] -// CHECK:STDOUT: %A.patt.loc6_6.2: i32 = symbolic_binding_pattern A, 0 [symbolic = %A.patt.loc6_6.2 (constants.%A.patt)] -// CHECK:STDOUT: %B.loc6_15.2: i32 = bind_symbolic_name B, 1 [symbolic = %B.loc6_15.2 (constants.%B)] -// CHECK:STDOUT: %B.patt.loc6_15.2: i32 = symbolic_binding_pattern B, 1 [symbolic = %B.patt.loc6_15.2 (constants.%B.patt)] +// CHECK:STDOUT: generic fn @F(%A.loc6_6.1: %i32, %B.loc6_15.1: %i32) { +// CHECK:STDOUT: %A.loc6_6.2: %i32 = bind_symbolic_name A, 0 [symbolic = %A.loc6_6.2 (constants.%A)] +// CHECK:STDOUT: %A.patt.loc6_6.2: %i32 = symbolic_binding_pattern A, 0 [symbolic = %A.patt.loc6_6.2 (constants.%A.patt)] +// CHECK:STDOUT: %B.loc6_15.2: %i32 = bind_symbolic_name B, 1 [symbolic = %B.loc6_15.2 (constants.%B)] +// CHECK:STDOUT: %B.patt.loc6_15.2: %i32 = symbolic_binding_pattern B, 1 [symbolic = %B.patt.loc6_15.2 (constants.%B.patt)] // CHECK:STDOUT: %tuple.loc6_40.2: %tuple.type.2 = tuple_value (%A.loc6_6.2, %B.loc6_15.2) [symbolic = %tuple.loc6_40.2 (constants.%tuple.1)] // CHECK:STDOUT: %HasPair.loc6_34.2: type = class_type @HasPair, @HasPair(%tuple.loc6_40.2) [symbolic = %HasPair.loc6_34.2 (constants.%HasPair.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%A.param_patt: i32, %B.param_patt: i32](%h.param_patt: @F.%HasPair.loc6_34.2 (%HasPair.3)) -> i32 { +// CHECK:STDOUT: fn[%A.param_patt: %i32, %B.param_patt: %i32](%h.param_patt: @F.%HasPair.loc6_34.2 (%HasPair.3)) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %B.ref.loc6_60: i32 = name_ref B, %B.loc6_15.1 [symbolic = %B.loc6_15.2 (constants.%B)] +// CHECK:STDOUT: %B.ref.loc6_60: %i32 = name_ref B, %B.loc6_15.1 [symbolic = %B.loc6_15.2 (constants.%B)] // CHECK:STDOUT: return %B.ref.loc6_60 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%h.param_patt: %HasPair.4) -> i32 { +// CHECK:STDOUT: fn @G(%h.param_patt: %HasPair.4) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %h.ref: %HasPair.4 = name_ref h, %h -// CHECK:STDOUT: %.loc9_10: = specific_function %F.ref, @F(constants.%.32, constants.%.34) [template = constants.%.35] -// CHECK:STDOUT: %F.call: init i32 = call %.loc9_10(%h.ref) -// CHECK:STDOUT: %.loc9_14.1: i32 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc9_14.2: i32 = converted %F.call, %.loc9_14.1 +// CHECK:STDOUT: %.loc9_10: = specific_function %F.ref, @F(constants.%.30, constants.%.33) [template = constants.%.34] +// CHECK:STDOUT: %F.call: init %i32 = call %.loc9_10(%h.ref) +// CHECK:STDOUT: %.loc9_14.1: %i32 = value_of_initializer %F.call +// CHECK:STDOUT: %.loc9_14.2: %i32 = converted %F.call, %.loc9_14.1 // CHECK:STDOUT: return %.loc9_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -425,11 +437,11 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%.32, constants.%.34) { -// CHECK:STDOUT: %A.loc6_6.2 => constants.%.32 -// CHECK:STDOUT: %A.patt.loc6_6.2 => constants.%.32 -// CHECK:STDOUT: %B.loc6_15.2 => constants.%.34 -// CHECK:STDOUT: %B.patt.loc6_15.2 => constants.%.34 +// CHECK:STDOUT: specific @F(constants.%.30, constants.%.33) { +// CHECK:STDOUT: %A.loc6_6.2 => constants.%.30 +// CHECK:STDOUT: %A.patt.loc6_6.2 => constants.%.30 +// CHECK:STDOUT: %B.loc6_15.2 => constants.%.33 +// CHECK:STDOUT: %B.patt.loc6_15.2 => constants.%.33 // CHECK:STDOUT: %tuple.loc6_40.2 => constants.%tuple.2 // CHECK:STDOUT: %HasPair.loc6_34.2 => constants.%HasPair.4 // CHECK:STDOUT: diff --git a/toolchain/check/testdata/eval/aggregate.carbon b/toolchain/check/testdata/eval/aggregate.carbon index ddcc8d769ace..723dc83eae0e 100644 --- a/toolchain/check/testdata/eval/aggregate.carbon +++ b/toolchain/check/testdata/eval/aggregate.carbon @@ -19,48 +19,54 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: --- aggregate.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 1 [template] -// CHECK:STDOUT: %.30: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 2 [template] -// CHECK:STDOUT: %tuple.1: %tuple.type.2 = tuple_value (%.29, %.31) [template] -// CHECK:STDOUT: %.32: type = struct_type {.a: i32, .b: i32, .c: i32} [template] -// CHECK:STDOUT: %.34: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.35: type = struct_type {.c: Core.IntLiteral, .b: Core.IntLiteral, .a: Core.IntLiteral} [template] -// CHECK:STDOUT: %.36: type = struct_type {.b: i32, .a: i32, .c: i32} [template] -// CHECK:STDOUT: %.38: = bound_method %.34, %Convert.15 [template] -// CHECK:STDOUT: %.39: i32 = int_value 3 [template] -// CHECK:STDOUT: %struct.1: %.36 = struct_value (%.31, %.29, %.39) [template] -// CHECK:STDOUT: %struct.2: %.32 = struct_value (%.29, %.31, %.39) [template] -// CHECK:STDOUT: %.40: type = array_type %.2, i32 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.28: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 2 [template] +// CHECK:STDOUT: %tuple.1: %tuple.type.2 = tuple_value (%.27, %.30) [template] +// CHECK:STDOUT: %.31: type = struct_type {.a: %i32, .b: %i32, .c: %i32} [template] +// CHECK:STDOUT: %.33: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.34: type = struct_type {.c: Core.IntLiteral, .b: Core.IntLiteral, .a: Core.IntLiteral} [template] +// CHECK:STDOUT: %.35: type = struct_type {.b: %i32, .a: %i32, .c: %i32} [template] +// CHECK:STDOUT: %.37: = bound_method %.33, %Convert.14 [template] +// CHECK:STDOUT: %.38: = specific_function %.37, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.39: %i32 = int_value 3 [template] +// CHECK:STDOUT: %struct.1: %.35 = struct_value (%.30, %.27, %.39) [template] +// CHECK:STDOUT: %struct.2: %.31 = struct_value (%.27, %.30, %.39) [template] +// CHECK:STDOUT: %.40: type = array_type %.3, %i32 [template] // CHECK:STDOUT: %.42: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type.4: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %.43: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %.44: Core.IntLiteral = int_value 7 [template] // CHECK:STDOUT: %.45: Core.IntLiteral = int_value 9 [template] // CHECK:STDOUT: %tuple.type.5: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %tuple.2: %tuple.type.5 = tuple_value (%.43, %.44, %.2, %.45) [template] -// CHECK:STDOUT: %.47: i32 = int_value 0 [template] -// CHECK:STDOUT: %.48: = bound_method %.42, %Convert.15 [template] -// CHECK:STDOUT: %array: %.40 = tuple_value (%.47) [template] -// CHECK:STDOUT: %.49: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %struct.3: %.49 = struct_value (%.34, %.2) [template] +// CHECK:STDOUT: %tuple.2: %tuple.type.5 = tuple_value (%.43, %.44, %.3, %.45) [template] +// CHECK:STDOUT: %.47: = bound_method %.42, %Convert.14 [template] +// CHECK:STDOUT: %.48: = specific_function %.47, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.49: %i32 = int_value 0 [template] +// CHECK:STDOUT: %array: %.40 = tuple_value (%.49) [template] +// CHECK:STDOUT: %.50: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %struct.3: %.50 = struct_value (%.33, %.3) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -76,169 +82,190 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: .struct_access = %struct_access // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11_18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_26.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_18, %int.make_type_32.loc11_23) -// CHECK:STDOUT: %.loc11_26.2: type = value_of_initializer %int.make_type_32.loc11_18 [template = i32] -// CHECK:STDOUT: %.loc11_26.3: type = converted %int.make_type_32.loc11_18, %.loc11_26.2 [template = i32] -// CHECK:STDOUT: %.loc11_26.4: type = value_of_initializer %int.make_type_32.loc11_23 [template = i32] -// CHECK:STDOUT: %.loc11_26.5: type = converted %int.make_type_32.loc11_23, %.loc11_26.4 [template = i32] +// CHECK:STDOUT: %.loc11_18: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_18: init type = call constants.%Int(%.loc11_18) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_23: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_23: init type = call constants.%Int(%.loc11_23) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_26.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_18, %int.make_type_signed.loc11_23) +// CHECK:STDOUT: %.loc11_26.2: type = value_of_initializer %int.make_type_signed.loc11_18 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_26.3: type = converted %int.make_type_signed.loc11_18, %.loc11_26.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_26.4: type = value_of_initializer %int.make_type_signed.loc11_23 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_26.5: type = converted %int.make_type_signed.loc11_23, %.loc11_26.4 [template = constants.%i32] // CHECK:STDOUT: %.loc11_26.6: type = converted %.loc11_26.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %tuple_copy.var: ref %tuple.type.2 = var tuple_copy // CHECK:STDOUT: %tuple_copy: ref %tuple.type.2 = bind_name tuple_copy, %tuple_copy.var -// CHECK:STDOUT: %int.make_type_32.loc13_23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_32.loc13_23 [template = i32] -// CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_32.loc13_23, %.loc13_23.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_32.1: type = value_of_initializer %int.make_type_32.loc13_32 [template = i32] -// CHECK:STDOUT: %.loc13_32.2: type = converted %int.make_type_32.loc13_32, %.loc13_32.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_41: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_41.1: type = value_of_initializer %int.make_type_32.loc13_41 [template = i32] -// CHECK:STDOUT: %.loc13_41.2: type = converted %int.make_type_32.loc13_41, %.loc13_41.1 [template = i32] -// CHECK:STDOUT: %.loc13_44: type = struct_type {.a: i32, .b: i32, .c: i32} [template = constants.%.32] -// CHECK:STDOUT: %struct_copy.var: ref %.32 = var struct_copy -// CHECK:STDOUT: %struct_copy: ref %.32 = bind_name struct_copy, %struct_copy.var -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_24: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc15_19.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_19.2: type = converted %int.make_type_32.loc15, %.loc15_19.1 [template = i32] -// CHECK:STDOUT: %.loc15_25: type = array_type %.loc15_24, i32 [template = constants.%.40] +// CHECK:STDOUT: %.loc13_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_23: init type = call constants.%Int(%.loc13_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_23.2: type = value_of_initializer %int.make_type_signed.loc13_23 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_23.3: type = converted %int.make_type_signed.loc13_23, %.loc13_23.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_32.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_32: init type = call constants.%Int(%.loc13_32.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_32.2: type = value_of_initializer %int.make_type_signed.loc13_32 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_32.3: type = converted %int.make_type_signed.loc13_32, %.loc13_32.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_41.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_41: init type = call constants.%Int(%.loc13_41.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_41.2: type = value_of_initializer %int.make_type_signed.loc13_41 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_41.3: type = converted %int.make_type_signed.loc13_41, %.loc13_41.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_44: type = struct_type {.a: %i32, .b: %i32, .c: %i32} [template = constants.%.31] +// CHECK:STDOUT: %struct_copy.var: ref %.31 = var struct_copy +// CHECK:STDOUT: %struct_copy: ref %.31 = bind_name struct_copy, %struct_copy.var +// CHECK:STDOUT: %.loc15_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_24: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_19.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_19.3: type = converted %int.make_type_signed.loc15, %.loc15_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_25: type = array_type %.loc15_24, %i32 [template = constants.%.40] // CHECK:STDOUT: %tuple_index.var: ref %.40 = var tuple_index // CHECK:STDOUT: %tuple_index: ref %.40 = bind_name tuple_index, %tuple_index.var -// CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_26: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc17_21.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] -// CHECK:STDOUT: %.loc17_21.2: type = converted %int.make_type_32.loc17, %.loc17_21.1 [template = i32] -// CHECK:STDOUT: %.loc17_27: type = array_type %.loc17_26, i32 [template = constants.%.40] +// CHECK:STDOUT: %.loc17_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%.loc17_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_26: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc17_21.2: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_21.3: type = converted %int.make_type_signed.loc17, %.loc17_21.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_27: type = array_type %.loc17_26, %i32 [template = constants.%.40] // CHECK:STDOUT: %struct_access.var: ref %.40 = var struct_access // CHECK:STDOUT: %struct_access: ref %.40 = bind_name struct_access, %struct_access.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_31: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc11_34: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_31: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_34: Core.IntLiteral = int_value 2 [template = constants.%.4] // CHECK:STDOUT: %.loc11_35.1: %tuple.type.3 = tuple_literal (%.loc11_31, %.loc11_34) -// CHECK:STDOUT: %int.make_type_32.loc11_41: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_46: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_49.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_41, %int.make_type_32.loc11_46) -// CHECK:STDOUT: %.loc11_49.2: type = value_of_initializer %int.make_type_32.loc11_41 [template = i32] -// CHECK:STDOUT: %.loc11_49.3: type = converted %int.make_type_32.loc11_41, %.loc11_49.2 [template = i32] -// CHECK:STDOUT: %.loc11_49.4: type = value_of_initializer %int.make_type_32.loc11_46 [template = i32] -// CHECK:STDOUT: %.loc11_49.5: type = converted %int.make_type_32.loc11_46, %.loc11_49.4 [template = i32] +// CHECK:STDOUT: %.loc11_41: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_41: init type = call constants.%Int(%.loc11_41) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_46: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_46: init type = call constants.%Int(%.loc11_46) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_49.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_41, %int.make_type_signed.loc11_46) +// CHECK:STDOUT: %.loc11_49.2: type = value_of_initializer %int.make_type_signed.loc11_41 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_49.3: type = converted %int.make_type_signed.loc11_41, %.loc11_49.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_49.4: type = value_of_initializer %int.make_type_signed.loc11_46 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_49.5: type = converted %int.make_type_signed.loc11_46, %.loc11_49.4 [template = constants.%i32] // CHECK:STDOUT: %.loc11_49.6: type = converted %.loc11_49.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc11_35.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_35.3: = bound_method %.loc11_31, %.loc11_35.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc11_35.1: init i32 = call %.loc11_35.3(%.loc11_31) [template = constants.%.29] -// CHECK:STDOUT: %.loc11_35.4: i32 = value_of_initializer %int.convert_checked.loc11_35.1 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_35.5: i32 = converted %.loc11_31, %.loc11_35.4 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_35.6: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_35.7: = bound_method %.loc11_34, %.loc11_35.6 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_35.2: init i32 = call %.loc11_35.7(%.loc11_34) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_35.8: i32 = value_of_initializer %int.convert_checked.loc11_35.2 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_35.9: i32 = converted %.loc11_34, %.loc11_35.8 [template = constants.%.31] -// CHECK:STDOUT: %tuple.loc11: %tuple.type.2 = tuple_value (%.loc11_35.5, %.loc11_35.9) [template = constants.%tuple.1] +// CHECK:STDOUT: %.loc11_35.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_35.3: = bound_method %.loc11_31, %.loc11_35.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc11_35.4: = specific_function %.loc11_35.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc11_35.1: init %i32 = call %.loc11_35.4(%.loc11_31) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_35.5: %i32 = value_of_initializer %int.convert_checked.loc11_35.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_35.6: %i32 = converted %.loc11_31, %.loc11_35.5 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_35.7: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_35.8: = bound_method %.loc11_34, %.loc11_35.7 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_35.9: = specific_function %.loc11_35.8, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc11_35.2: init %i32 = call %.loc11_35.9(%.loc11_34) [template = constants.%.30] +// CHECK:STDOUT: %.loc11_35.10: %i32 = value_of_initializer %int.convert_checked.loc11_35.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_35.11: %i32 = converted %.loc11_34, %.loc11_35.10 [template = constants.%.30] +// CHECK:STDOUT: %tuple.loc11: %tuple.type.2 = tuple_value (%.loc11_35.6, %.loc11_35.11) [template = constants.%tuple.1] // CHECK:STDOUT: %.loc11_37.1: %tuple.type.2 = converted %.loc11_35.1, %tuple.loc11 [template = constants.%tuple.1] -// CHECK:STDOUT: %.loc11_37.2: i32 = tuple_access %.loc11_37.1, element0 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_37.3: ref i32 = tuple_access file.%tuple_copy.var, element0 -// CHECK:STDOUT: %.loc11_37.4: init i32 = initialize_from %.loc11_37.2 to %.loc11_37.3 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_37.5: i32 = tuple_access %.loc11_37.1, element1 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_37.6: ref i32 = tuple_access file.%tuple_copy.var, element1 -// CHECK:STDOUT: %.loc11_37.7: init i32 = initialize_from %.loc11_37.5 to %.loc11_37.6 [template = constants.%.31] +// CHECK:STDOUT: %.loc11_37.2: %i32 = tuple_access %.loc11_37.1, element0 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_37.3: ref %i32 = tuple_access file.%tuple_copy.var, element0 +// CHECK:STDOUT: %.loc11_37.4: init %i32 = initialize_from %.loc11_37.2 to %.loc11_37.3 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_37.5: %i32 = tuple_access %.loc11_37.1, element1 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_37.6: ref %i32 = tuple_access file.%tuple_copy.var, element1 +// CHECK:STDOUT: %.loc11_37.7: init %i32 = initialize_from %.loc11_37.5 to %.loc11_37.6 [template = constants.%.30] // CHECK:STDOUT: %.loc11_37.8: init %tuple.type.2 = tuple_init (%.loc11_37.4, %.loc11_37.7) to file.%tuple_copy.var [template = constants.%tuple.1] // CHECK:STDOUT: %.loc11_50: init %tuple.type.2 = converted %.loc11_37.1, %.loc11_37.8 [template = constants.%tuple.1] // CHECK:STDOUT: assign file.%tuple_copy.var, %.loc11_50 -// CHECK:STDOUT: %.loc13_54: Core.IntLiteral = int_value 3 [template = constants.%.34] -// CHECK:STDOUT: %.loc13_62: Core.IntLiteral = int_value 2 [template = constants.%.3] -// CHECK:STDOUT: %.loc13_70: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc13_71.1: %.35 = struct_literal (%.loc13_54, %.loc13_62, %.loc13_70) -// CHECK:STDOUT: %int.make_type_32.loc13_81: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_81.1: type = value_of_initializer %int.make_type_32.loc13_81 [template = i32] -// CHECK:STDOUT: %.loc13_81.2: type = converted %int.make_type_32.loc13_81, %.loc13_81.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_90: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_90.1: type = value_of_initializer %int.make_type_32.loc13_90 [template = i32] -// CHECK:STDOUT: %.loc13_90.2: type = converted %int.make_type_32.loc13_90, %.loc13_90.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_99: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_99.1: type = value_of_initializer %int.make_type_32.loc13_99 [template = i32] -// CHECK:STDOUT: %.loc13_99.2: type = converted %int.make_type_32.loc13_99, %.loc13_99.1 [template = i32] -// CHECK:STDOUT: %.loc13_102: type = struct_type {.b: i32, .a: i32, .c: i32} [template = constants.%.36] -// CHECK:STDOUT: %.loc13_71.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_71.3: = bound_method %.loc13_62, %.loc13_71.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc13_71.1: init i32 = call %.loc13_71.3(%.loc13_62) [template = constants.%.31] -// CHECK:STDOUT: %.loc13_71.4: i32 = value_of_initializer %int.convert_checked.loc13_71.1 [template = constants.%.31] -// CHECK:STDOUT: %.loc13_71.5: i32 = converted %.loc13_62, %.loc13_71.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc13_71.6: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_71.7: = bound_method %.loc13_70, %.loc13_71.6 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc13_71.2: init i32 = call %.loc13_71.7(%.loc13_70) [template = constants.%.29] -// CHECK:STDOUT: %.loc13_71.8: i32 = value_of_initializer %int.convert_checked.loc13_71.2 [template = constants.%.29] -// CHECK:STDOUT: %.loc13_71.9: i32 = converted %.loc13_70, %.loc13_71.8 [template = constants.%.29] -// CHECK:STDOUT: %.loc13_71.10: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_71.11: = bound_method %.loc13_54, %.loc13_71.10 [template = constants.%.38] -// CHECK:STDOUT: %int.convert_checked.loc13_71.3: init i32 = call %.loc13_71.11(%.loc13_54) [template = constants.%.39] -// CHECK:STDOUT: %.loc13_71.12: i32 = value_of_initializer %int.convert_checked.loc13_71.3 [template = constants.%.39] -// CHECK:STDOUT: %.loc13_71.13: i32 = converted %.loc13_54, %.loc13_71.12 [template = constants.%.39] -// CHECK:STDOUT: %struct.loc13: %.36 = struct_value (%.loc13_71.5, %.loc13_71.9, %.loc13_71.13) [template = constants.%struct.1] -// CHECK:STDOUT: %.loc13_73.1: %.36 = converted %.loc13_71.1, %struct.loc13 [template = constants.%struct.1] -// CHECK:STDOUT: %.loc13_73.2: i32 = struct_access %.loc13_73.1, element1 [template = constants.%.29] -// CHECK:STDOUT: %.loc13_73.3: ref i32 = struct_access file.%struct_copy.var, element1 -// CHECK:STDOUT: %.loc13_73.4: init i32 = initialize_from %.loc13_73.2 to %.loc13_73.3 [template = constants.%.29] -// CHECK:STDOUT: %.loc13_73.5: i32 = struct_access %.loc13_73.1, element0 [template = constants.%.31] -// CHECK:STDOUT: %.loc13_73.6: ref i32 = struct_access file.%struct_copy.var, element0 -// CHECK:STDOUT: %.loc13_73.7: init i32 = initialize_from %.loc13_73.5 to %.loc13_73.6 [template = constants.%.31] -// CHECK:STDOUT: %.loc13_73.8: i32 = struct_access %.loc13_73.1, element2 [template = constants.%.39] -// CHECK:STDOUT: %.loc13_73.9: ref i32 = struct_access file.%struct_copy.var, element2 -// CHECK:STDOUT: %.loc13_73.10: init i32 = initialize_from %.loc13_73.8 to %.loc13_73.9 [template = constants.%.39] -// CHECK:STDOUT: %.loc13_73.11: init %.32 = struct_init (%.loc13_73.4, %.loc13_73.7, %.loc13_73.10) to file.%struct_copy.var [template = constants.%struct.2] -// CHECK:STDOUT: %.loc13_103: init %.32 = converted %.loc13_73.1, %.loc13_73.11 [template = constants.%struct.2] +// CHECK:STDOUT: %.loc13_54: Core.IntLiteral = int_value 3 [template = constants.%.33] +// CHECK:STDOUT: %.loc13_62: Core.IntLiteral = int_value 2 [template = constants.%.4] +// CHECK:STDOUT: %.loc13_70: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc13_71.1: %.34 = struct_literal (%.loc13_54, %.loc13_62, %.loc13_70) +// CHECK:STDOUT: %.loc13_81.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_81: init type = call constants.%Int(%.loc13_81.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_81.2: type = value_of_initializer %int.make_type_signed.loc13_81 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_81.3: type = converted %int.make_type_signed.loc13_81, %.loc13_81.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_90.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_90: init type = call constants.%Int(%.loc13_90.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_90.2: type = value_of_initializer %int.make_type_signed.loc13_90 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_90.3: type = converted %int.make_type_signed.loc13_90, %.loc13_90.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_99.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_99: init type = call constants.%Int(%.loc13_99.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_99.2: type = value_of_initializer %int.make_type_signed.loc13_99 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_99.3: type = converted %int.make_type_signed.loc13_99, %.loc13_99.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_102: type = struct_type {.b: %i32, .a: %i32, .c: %i32} [template = constants.%.35] +// CHECK:STDOUT: %.loc13_71.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_71.3: = bound_method %.loc13_62, %.loc13_71.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc13_71.4: = specific_function %.loc13_71.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc13_71.1: init %i32 = call %.loc13_71.4(%.loc13_62) [template = constants.%.30] +// CHECK:STDOUT: %.loc13_71.5: %i32 = value_of_initializer %int.convert_checked.loc13_71.1 [template = constants.%.30] +// CHECK:STDOUT: %.loc13_71.6: %i32 = converted %.loc13_62, %.loc13_71.5 [template = constants.%.30] +// CHECK:STDOUT: %.loc13_71.7: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_71.8: = bound_method %.loc13_70, %.loc13_71.7 [template = constants.%.25] +// CHECK:STDOUT: %.loc13_71.9: = specific_function %.loc13_71.8, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc13_71.2: init %i32 = call %.loc13_71.9(%.loc13_70) [template = constants.%.27] +// CHECK:STDOUT: %.loc13_71.10: %i32 = value_of_initializer %int.convert_checked.loc13_71.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc13_71.11: %i32 = converted %.loc13_70, %.loc13_71.10 [template = constants.%.27] +// CHECK:STDOUT: %.loc13_71.12: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_71.13: = bound_method %.loc13_54, %.loc13_71.12 [template = constants.%.37] +// CHECK:STDOUT: %.loc13_71.14: = specific_function %.loc13_71.13, @Convert.2(constants.%.1) [template = constants.%.38] +// CHECK:STDOUT: %int.convert_checked.loc13_71.3: init %i32 = call %.loc13_71.14(%.loc13_54) [template = constants.%.39] +// CHECK:STDOUT: %.loc13_71.15: %i32 = value_of_initializer %int.convert_checked.loc13_71.3 [template = constants.%.39] +// CHECK:STDOUT: %.loc13_71.16: %i32 = converted %.loc13_54, %.loc13_71.15 [template = constants.%.39] +// CHECK:STDOUT: %struct.loc13: %.35 = struct_value (%.loc13_71.6, %.loc13_71.11, %.loc13_71.16) [template = constants.%struct.1] +// CHECK:STDOUT: %.loc13_73.1: %.35 = converted %.loc13_71.1, %struct.loc13 [template = constants.%struct.1] +// CHECK:STDOUT: %.loc13_73.2: %i32 = struct_access %.loc13_73.1, element1 [template = constants.%.27] +// CHECK:STDOUT: %.loc13_73.3: ref %i32 = struct_access file.%struct_copy.var, element1 +// CHECK:STDOUT: %.loc13_73.4: init %i32 = initialize_from %.loc13_73.2 to %.loc13_73.3 [template = constants.%.27] +// CHECK:STDOUT: %.loc13_73.5: %i32 = struct_access %.loc13_73.1, element0 [template = constants.%.30] +// CHECK:STDOUT: %.loc13_73.6: ref %i32 = struct_access file.%struct_copy.var, element0 +// CHECK:STDOUT: %.loc13_73.7: init %i32 = initialize_from %.loc13_73.5 to %.loc13_73.6 [template = constants.%.30] +// CHECK:STDOUT: %.loc13_73.8: %i32 = struct_access %.loc13_73.1, element2 [template = constants.%.39] +// CHECK:STDOUT: %.loc13_73.9: ref %i32 = struct_access file.%struct_copy.var, element2 +// CHECK:STDOUT: %.loc13_73.10: init %i32 = initialize_from %.loc13_73.8 to %.loc13_73.9 [template = constants.%.39] +// CHECK:STDOUT: %.loc13_73.11: init %.31 = struct_init (%.loc13_73.4, %.loc13_73.7, %.loc13_73.10) to file.%struct_copy.var [template = constants.%struct.2] +// CHECK:STDOUT: %.loc13_103: init %.31 = converted %.loc13_73.1, %.loc13_73.11 [template = constants.%struct.2] // CHECK:STDOUT: assign file.%struct_copy.var, %.loc13_103 // CHECK:STDOUT: %.loc15_30: Core.IntLiteral = int_value 0 [template = constants.%.42] // CHECK:STDOUT: %.loc15_32.1: %tuple.type.4 = tuple_literal (%.loc15_30) -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc15_38.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_38.1) [template = constants.%i32] // CHECK:STDOUT: %.loc15_44: Core.IntLiteral = int_value 5 [template = constants.%.43] // CHECK:STDOUT: %.loc15_47: Core.IntLiteral = int_value 7 [template = constants.%.44] -// CHECK:STDOUT: %.loc15_50: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_50: Core.IntLiteral = int_value 1 [template = constants.%.3] // CHECK:STDOUT: %.loc15_53: Core.IntLiteral = int_value 9 [template = constants.%.45] // CHECK:STDOUT: %.loc15_54.1: %tuple.type.5 = tuple_literal (%.loc15_44, %.loc15_47, %.loc15_50, %.loc15_53) -// CHECK:STDOUT: %.loc15_56: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_56: Core.IntLiteral = int_value 2 [template = constants.%.4] // CHECK:STDOUT: %tuple.loc15: %tuple.type.5 = tuple_value (%.loc15_44, %.loc15_47, %.loc15_50, %.loc15_53) [template = constants.%tuple.2] // CHECK:STDOUT: %.loc15_54.2: %tuple.type.5 = converted %.loc15_54.1, %tuple.loc15 [template = constants.%tuple.2] -// CHECK:STDOUT: %.loc15_55: Core.IntLiteral = tuple_access %.loc15_54.2, element2 [template = constants.%.2] -// CHECK:STDOUT: %.loc15_38.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_38.2: type = converted %int.make_type_32.loc15, %.loc15_38.1 [template = i32] -// CHECK:STDOUT: %.loc15_57: type = array_type %.loc15_55, i32 [template = constants.%.40] -// CHECK:STDOUT: %.loc15_32.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_32.3: = bound_method %.loc15_30, %.loc15_32.2 [template = constants.%.48] -// CHECK:STDOUT: %int.convert_checked.loc15: init i32 = call %.loc15_32.3(%.loc15_30) [template = constants.%.47] -// CHECK:STDOUT: %.loc15_32.4: init i32 = converted %.loc15_30, %int.convert_checked.loc15 [template = constants.%.47] +// CHECK:STDOUT: %.loc15_55: Core.IntLiteral = tuple_access %.loc15_54.2, element2 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_38.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_38.3: type = converted %int.make_type_signed.loc15, %.loc15_38.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_57: type = array_type %.loc15_55, %i32 [template = constants.%.40] +// CHECK:STDOUT: %.loc15_32.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_32.3: = bound_method %.loc15_30, %.loc15_32.2 [template = constants.%.47] +// CHECK:STDOUT: %.loc15_32.4: = specific_function %.loc15_32.3, @Convert.2(constants.%.1) [template = constants.%.48] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %.loc15_32.4(%.loc15_30) [template = constants.%.49] +// CHECK:STDOUT: %.loc15_32.5: init %i32 = converted %.loc15_30, %int.convert_checked.loc15 [template = constants.%.49] // CHECK:STDOUT: %.loc15_5: ref %.40 = splice_block file.%tuple_index.var {} -// CHECK:STDOUT: %.loc15_32.5: i32 = int_value 0 [template = constants.%.47] -// CHECK:STDOUT: %.loc15_32.6: ref i32 = array_index %.loc15_5, %.loc15_32.5 -// CHECK:STDOUT: %.loc15_32.7: init i32 = initialize_from %.loc15_32.4 to %.loc15_32.6 [template = constants.%.47] -// CHECK:STDOUT: %.loc15_32.8: init %.40 = array_init (%.loc15_32.7) to %.loc15_5 [template = constants.%array] -// CHECK:STDOUT: %.loc15_34: init %.40 = converted %.loc15_32.1, %.loc15_32.8 [template = constants.%array] +// CHECK:STDOUT: %.loc15_32.6: Core.IntLiteral = int_value 0 [template = constants.%.42] +// CHECK:STDOUT: %.loc15_32.7: ref %i32 = array_index %.loc15_5, %.loc15_32.6 +// CHECK:STDOUT: %.loc15_32.8: init %i32 = initialize_from %.loc15_32.5 to %.loc15_32.7 [template = constants.%.49] +// CHECK:STDOUT: %.loc15_32.9: init %.40 = array_init (%.loc15_32.8) to %.loc15_5 [template = constants.%array] +// CHECK:STDOUT: %.loc15_34: init %.40 = converted %.loc15_32.1, %.loc15_32.9 [template = constants.%array] // CHECK:STDOUT: assign file.%tuple_index.var, %.loc15_34 // CHECK:STDOUT: %.loc17_32: Core.IntLiteral = int_value 0 [template = constants.%.42] // CHECK:STDOUT: %.loc17_34.1: %tuple.type.4 = tuple_literal (%.loc17_32) -// CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_51: Core.IntLiteral = int_value 3 [template = constants.%.34] -// CHECK:STDOUT: %.loc17_59: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc17_60.1: %.49 = struct_literal (%.loc17_51, %.loc17_59) -// CHECK:STDOUT: %struct.loc17: %.49 = struct_value (%.loc17_51, %.loc17_59) [template = constants.%struct.3] -// CHECK:STDOUT: %.loc17_60.2: %.49 = converted %.loc17_60.1, %struct.loc17 [template = constants.%struct.3] -// CHECK:STDOUT: %.loc17_61: Core.IntLiteral = struct_access %.loc17_60.2, element1 [template = constants.%.2] -// CHECK:STDOUT: %.loc17_40.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] -// CHECK:STDOUT: %.loc17_40.2: type = converted %int.make_type_32.loc17, %.loc17_40.1 [template = i32] -// CHECK:STDOUT: %.loc17_63: type = array_type %.loc17_61, i32 [template = constants.%.40] -// CHECK:STDOUT: %.loc17_34.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc17_34.3: = bound_method %.loc17_32, %.loc17_34.2 [template = constants.%.48] -// CHECK:STDOUT: %int.convert_checked.loc17: init i32 = call %.loc17_34.3(%.loc17_32) [template = constants.%.47] -// CHECK:STDOUT: %.loc17_34.4: init i32 = converted %.loc17_32, %int.convert_checked.loc17 [template = constants.%.47] +// CHECK:STDOUT: %.loc17_40.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%.loc17_40.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_51: Core.IntLiteral = int_value 3 [template = constants.%.33] +// CHECK:STDOUT: %.loc17_59: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc17_60.1: %.50 = struct_literal (%.loc17_51, %.loc17_59) +// CHECK:STDOUT: %struct.loc17: %.50 = struct_value (%.loc17_51, %.loc17_59) [template = constants.%struct.3] +// CHECK:STDOUT: %.loc17_60.2: %.50 = converted %.loc17_60.1, %struct.loc17 [template = constants.%struct.3] +// CHECK:STDOUT: %.loc17_61: Core.IntLiteral = struct_access %.loc17_60.2, element1 [template = constants.%.3] +// CHECK:STDOUT: %.loc17_40.2: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_40.3: type = converted %int.make_type_signed.loc17, %.loc17_40.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_63: type = array_type %.loc17_61, %i32 [template = constants.%.40] +// CHECK:STDOUT: %.loc17_34.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc17_34.3: = bound_method %.loc17_32, %.loc17_34.2 [template = constants.%.47] +// CHECK:STDOUT: %.loc17_34.4: = specific_function %.loc17_34.3, @Convert.2(constants.%.1) [template = constants.%.48] +// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %.loc17_34.4(%.loc17_32) [template = constants.%.49] +// CHECK:STDOUT: %.loc17_34.5: init %i32 = converted %.loc17_32, %int.convert_checked.loc17 [template = constants.%.49] // CHECK:STDOUT: %.loc17_5: ref %.40 = splice_block file.%struct_access.var {} -// CHECK:STDOUT: %.loc17_34.5: i32 = int_value 0 [template = constants.%.47] -// CHECK:STDOUT: %.loc17_34.6: ref i32 = array_index %.loc17_5, %.loc17_34.5 -// CHECK:STDOUT: %.loc17_34.7: init i32 = initialize_from %.loc17_34.4 to %.loc17_34.6 [template = constants.%.47] -// CHECK:STDOUT: %.loc17_34.8: init %.40 = array_init (%.loc17_34.7) to %.loc17_5 [template = constants.%array] -// CHECK:STDOUT: %.loc17_36: init %.40 = converted %.loc17_34.1, %.loc17_34.8 [template = constants.%array] +// CHECK:STDOUT: %.loc17_34.6: Core.IntLiteral = int_value 0 [template = constants.%.42] +// CHECK:STDOUT: %.loc17_34.7: ref %i32 = array_index %.loc17_5, %.loc17_34.6 +// CHECK:STDOUT: %.loc17_34.8: init %i32 = initialize_from %.loc17_34.5 to %.loc17_34.7 [template = constants.%.49] +// CHECK:STDOUT: %.loc17_34.9: init %.40 = array_init (%.loc17_34.8) to %.loc17_5 [template = constants.%array] +// CHECK:STDOUT: %.loc17_36: init %.40 = converted %.loc17_34.1, %.loc17_34.9 [template = constants.%array] // CHECK:STDOUT: assign file.%struct_access.var, %.loc17_36 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/eval/fail_aggregate.carbon b/toolchain/check/testdata/eval/fail_aggregate.carbon index b4d94bcb19ca..09b84cd94dfc 100644 --- a/toolchain/check/testdata/eval/fail_aggregate.carbon +++ b/toolchain/check/testdata/eval/fail_aggregate.carbon @@ -18,41 +18,47 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: --- fail_aggregate.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 7 [template] -// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 9 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 7 [template] +// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 9 [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %.9: type = array_type %.8, i32 [template] -// CHECK:STDOUT: %.11: i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.35: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.36: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.37: i32 = int_value 5 [template] -// CHECK:STDOUT: %.38: i32 = int_value 1 [template] -// CHECK:STDOUT: %.39: = bound_method %.6, %Convert.15 [template] -// CHECK:STDOUT: %.40: i32 = int_value 7 [template] -// CHECK:STDOUT: %.41: i32 = int_value 2 [template] -// CHECK:STDOUT: %.42: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.43: i32 = int_value 3 [template] -// CHECK:STDOUT: %.44: = bound_method %.7, %Convert.15 [template] -// CHECK:STDOUT: %.45: i32 = int_value 9 [template] -// CHECK:STDOUT: %array: %.9 = tuple_value (%.37, %.40, %.38, %.45) [template] -// CHECK:STDOUT: %.46: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.47: = bound_method %.46, %Convert.15 [template] +// CHECK:STDOUT: %.9: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.10: type = array_type %.9, %i32 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.32: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 5 [template] +// CHECK:STDOUT: %.35: = bound_method %.7, %Convert.14 [template] +// CHECK:STDOUT: %.36: = specific_function %.35, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.37: %i32 = int_value 7 [template] +// CHECK:STDOUT: %.38: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.39: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.40: = specific_function %.39, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.41: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.42: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.43: = bound_method %.8, %Convert.14 [template] +// CHECK:STDOUT: %.44: = specific_function %.43, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.45: %i32 = int_value 9 [template] +// CHECK:STDOUT: %array: %.10 = tuple_value (%.34, %.37, %.41, %.45) [template] +// CHECK:STDOUT: %.46: = bound_method %.38, %Convert.14 [template] +// CHECK:STDOUT: %.47: = specific_function %.46, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.48: %i32 = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -65,72 +71,80 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: .array_index = %array_index // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_24: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_32, %.loc16_19.1 [template = i32] -// CHECK:STDOUT: %.loc16_25: type = array_type %.loc16_24, i32 [template = constants.%.2] -// CHECK:STDOUT: %array_index.var: ref %.2 = var array_index -// CHECK:STDOUT: %array_index: ref %.2 = bind_name array_index, %array_index.var +// CHECK:STDOUT: %.loc16_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc16_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_24: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc16_19.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc16_19.3: type = converted %int.make_type_signed, %.loc16_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_25: type = array_type %.loc16_24, %i32 [template = constants.%.3] +// CHECK:STDOUT: %array_index.var: ref %.3 = var array_index +// CHECK:STDOUT: %array_index: ref %.3 = bind_name array_index, %array_index.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc16_30: Core.IntLiteral = int_value 0 [template = constants.%.4] +// CHECK:STDOUT: %.loc16_30: Core.IntLiteral = int_value 0 [template = constants.%.5] // CHECK:STDOUT: %.loc16_32: %tuple.type.1 = tuple_literal (%.loc16_30) -// CHECK:STDOUT: %int.make_type_32.loc16_38: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_45: Core.IntLiteral = int_value 5 [template = constants.%.5] -// CHECK:STDOUT: %.loc16_48: Core.IntLiteral = int_value 7 [template = constants.%.6] -// CHECK:STDOUT: %.loc16_51: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc16_54: Core.IntLiteral = int_value 9 [template = constants.%.7] +// CHECK:STDOUT: %.loc16_38.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16_38: init type = call constants.%Int(%.loc16_38.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_45: Core.IntLiteral = int_value 5 [template = constants.%.6] +// CHECK:STDOUT: %.loc16_48: Core.IntLiteral = int_value 7 [template = constants.%.7] +// CHECK:STDOUT: %.loc16_51: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc16_54: Core.IntLiteral = int_value 9 [template = constants.%.8] // CHECK:STDOUT: %.loc16_55.1: %tuple.type.2 = tuple_literal (%.loc16_45, %.loc16_48, %.loc16_51, %.loc16_54) -// CHECK:STDOUT: %int.make_type_32.loc16_61: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_66: Core.IntLiteral = int_value 4 [template = constants.%.8] -// CHECK:STDOUT: %.loc16_61.1: type = value_of_initializer %int.make_type_32.loc16_61 [template = i32] -// CHECK:STDOUT: %.loc16_61.2: type = converted %int.make_type_32.loc16_61, %.loc16_61.1 [template = i32] -// CHECK:STDOUT: %.loc16_67: type = array_type %.loc16_66, i32 [template = constants.%.9] -// CHECK:STDOUT: %.loc16_55.2: %Convert.type.2 = interface_witness_access constants.%.35, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_55.3: = bound_method %.loc16_45, %.loc16_55.2 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc16_55.1: init i32 = call %.loc16_55.3(%.loc16_45) [template = constants.%.37] -// CHECK:STDOUT: %.loc16_55.4: init i32 = converted %.loc16_45, %int.convert_checked.loc16_55.1 [template = constants.%.37] -// CHECK:STDOUT: %.loc16_55.5: ref %.9 = temporary_storage -// CHECK:STDOUT: %.loc16_55.6: i32 = int_value 0 [template = constants.%.11] -// CHECK:STDOUT: %.loc16_55.7: ref i32 = array_index %.loc16_55.5, %.loc16_55.6 -// CHECK:STDOUT: %.loc16_55.8: init i32 = initialize_from %.loc16_55.4 to %.loc16_55.7 [template = constants.%.37] -// CHECK:STDOUT: %.loc16_55.9: %Convert.type.2 = interface_witness_access constants.%.35, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_55.10: = bound_method %.loc16_48, %.loc16_55.9 [template = constants.%.39] -// CHECK:STDOUT: %int.convert_checked.loc16_55.2: init i32 = call %.loc16_55.10(%.loc16_48) [template = constants.%.40] -// CHECK:STDOUT: %.loc16_55.11: init i32 = converted %.loc16_48, %int.convert_checked.loc16_55.2 [template = constants.%.40] -// CHECK:STDOUT: %.loc16_55.12: i32 = int_value 1 [template = constants.%.38] -// CHECK:STDOUT: %.loc16_55.13: ref i32 = array_index %.loc16_55.5, %.loc16_55.12 -// CHECK:STDOUT: %.loc16_55.14: init i32 = initialize_from %.loc16_55.11 to %.loc16_55.13 [template = constants.%.40] -// CHECK:STDOUT: %.loc16_55.15: %Convert.type.2 = interface_witness_access constants.%.35, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_55.16: = bound_method %.loc16_51, %.loc16_55.15 [template = constants.%.42] -// CHECK:STDOUT: %int.convert_checked.loc16_55.3: init i32 = call %.loc16_55.16(%.loc16_51) [template = constants.%.38] -// CHECK:STDOUT: %.loc16_55.17: init i32 = converted %.loc16_51, %int.convert_checked.loc16_55.3 [template = constants.%.38] -// CHECK:STDOUT: %.loc16_55.18: i32 = int_value 2 [template = constants.%.41] -// CHECK:STDOUT: %.loc16_55.19: ref i32 = array_index %.loc16_55.5, %.loc16_55.18 -// CHECK:STDOUT: %.loc16_55.20: init i32 = initialize_from %.loc16_55.17 to %.loc16_55.19 [template = constants.%.38] -// CHECK:STDOUT: %.loc16_55.21: %Convert.type.2 = interface_witness_access constants.%.35, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_55.22: = bound_method %.loc16_54, %.loc16_55.21 [template = constants.%.44] -// CHECK:STDOUT: %int.convert_checked.loc16_55.4: init i32 = call %.loc16_55.22(%.loc16_54) [template = constants.%.45] -// CHECK:STDOUT: %.loc16_55.23: init i32 = converted %.loc16_54, %int.convert_checked.loc16_55.4 [template = constants.%.45] -// CHECK:STDOUT: %.loc16_55.24: i32 = int_value 3 [template = constants.%.43] -// CHECK:STDOUT: %.loc16_55.25: ref i32 = array_index %.loc16_55.5, %.loc16_55.24 -// CHECK:STDOUT: %.loc16_55.26: init i32 = initialize_from %.loc16_55.23 to %.loc16_55.25 [template = constants.%.45] -// CHECK:STDOUT: %.loc16_55.27: init %.9 = array_init (%.loc16_55.8, %.loc16_55.14, %.loc16_55.20, %.loc16_55.26) to %.loc16_55.5 [template = constants.%array] -// CHECK:STDOUT: %.loc16_57.1: init %.9 = converted %.loc16_55.1, %.loc16_55.27 [template = constants.%array] -// CHECK:STDOUT: %.loc16_70.1: Core.IntLiteral = int_value 2 [template = constants.%.46] -// CHECK:STDOUT: %.loc16_57.2: ref %.9 = temporary %.loc16_55.5, %.loc16_57.1 -// CHECK:STDOUT: %.loc16_70.2: %Convert.type.2 = interface_witness_access constants.%.35, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_70.3: = bound_method %.loc16_70.1, %.loc16_70.2 [template = constants.%.47] -// CHECK:STDOUT: %int.convert_checked.loc16_70: init i32 = call %.loc16_70.3(%.loc16_70.1) [template = constants.%.41] -// CHECK:STDOUT: %.loc16_70.4: i32 = value_of_initializer %int.convert_checked.loc16_70 [template = constants.%.41] -// CHECK:STDOUT: %.loc16_70.5: i32 = converted %.loc16_70.1, %.loc16_70.4 [template = constants.%.41] -// CHECK:STDOUT: %.loc16_71.1: ref i32 = array_index %.loc16_57.2, %.loc16_70.5 -// CHECK:STDOUT: %.loc16_71.2: i32 = bind_value %.loc16_71.1 -// CHECK:STDOUT: %.loc16_38.1: type = value_of_initializer %int.make_type_32.loc16_38 [template = i32] -// CHECK:STDOUT: %.loc16_38.2: type = converted %int.make_type_32.loc16_38, %.loc16_38.1 [template = i32] +// CHECK:STDOUT: %.loc16_61.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16_61: init type = call constants.%Int(%.loc16_61.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_66: Core.IntLiteral = int_value 4 [template = constants.%.9] +// CHECK:STDOUT: %.loc16_61.2: type = value_of_initializer %int.make_type_signed.loc16_61 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_61.3: type = converted %int.make_type_signed.loc16_61, %.loc16_61.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_67: type = array_type %.loc16_66, %i32 [template = constants.%.10] +// CHECK:STDOUT: %.loc16_55.2: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc16_55.3: = bound_method %.loc16_45, %.loc16_55.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc16_55.4: = specific_function %.loc16_55.3, @Convert.2(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc16_55.1: init %i32 = call %.loc16_55.4(%.loc16_45) [template = constants.%.34] +// CHECK:STDOUT: %.loc16_55.5: init %i32 = converted %.loc16_45, %int.convert_checked.loc16_55.1 [template = constants.%.34] +// CHECK:STDOUT: %.loc16_55.6: ref %.10 = temporary_storage +// CHECK:STDOUT: %.loc16_55.7: Core.IntLiteral = int_value 0 [template = constants.%.5] +// CHECK:STDOUT: %.loc16_55.8: ref %i32 = array_index %.loc16_55.6, %.loc16_55.7 +// CHECK:STDOUT: %.loc16_55.9: init %i32 = initialize_from %.loc16_55.5 to %.loc16_55.8 [template = constants.%.34] +// CHECK:STDOUT: %.loc16_55.10: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc16_55.11: = bound_method %.loc16_48, %.loc16_55.10 [template = constants.%.35] +// CHECK:STDOUT: %.loc16_55.12: = specific_function %.loc16_55.11, @Convert.2(constants.%.1) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc16_55.2: init %i32 = call %.loc16_55.12(%.loc16_48) [template = constants.%.37] +// CHECK:STDOUT: %.loc16_55.13: init %i32 = converted %.loc16_48, %int.convert_checked.loc16_55.2 [template = constants.%.37] +// CHECK:STDOUT: %.loc16_55.14: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc16_55.15: ref %i32 = array_index %.loc16_55.6, %.loc16_55.14 +// CHECK:STDOUT: %.loc16_55.16: init %i32 = initialize_from %.loc16_55.13 to %.loc16_55.15 [template = constants.%.37] +// CHECK:STDOUT: %.loc16_55.17: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc16_55.18: = bound_method %.loc16_51, %.loc16_55.17 [template = constants.%.39] +// CHECK:STDOUT: %.loc16_55.19: = specific_function %.loc16_55.18, @Convert.2(constants.%.1) [template = constants.%.40] +// CHECK:STDOUT: %int.convert_checked.loc16_55.3: init %i32 = call %.loc16_55.19(%.loc16_51) [template = constants.%.41] +// CHECK:STDOUT: %.loc16_55.20: init %i32 = converted %.loc16_51, %int.convert_checked.loc16_55.3 [template = constants.%.41] +// CHECK:STDOUT: %.loc16_55.21: Core.IntLiteral = int_value 2 [template = constants.%.38] +// CHECK:STDOUT: %.loc16_55.22: ref %i32 = array_index %.loc16_55.6, %.loc16_55.21 +// CHECK:STDOUT: %.loc16_55.23: init %i32 = initialize_from %.loc16_55.20 to %.loc16_55.22 [template = constants.%.41] +// CHECK:STDOUT: %.loc16_55.24: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc16_55.25: = bound_method %.loc16_54, %.loc16_55.24 [template = constants.%.43] +// CHECK:STDOUT: %.loc16_55.26: = specific_function %.loc16_55.25, @Convert.2(constants.%.1) [template = constants.%.44] +// CHECK:STDOUT: %int.convert_checked.loc16_55.4: init %i32 = call %.loc16_55.26(%.loc16_54) [template = constants.%.45] +// CHECK:STDOUT: %.loc16_55.27: init %i32 = converted %.loc16_54, %int.convert_checked.loc16_55.4 [template = constants.%.45] +// CHECK:STDOUT: %.loc16_55.28: Core.IntLiteral = int_value 3 [template = constants.%.42] +// CHECK:STDOUT: %.loc16_55.29: ref %i32 = array_index %.loc16_55.6, %.loc16_55.28 +// CHECK:STDOUT: %.loc16_55.30: init %i32 = initialize_from %.loc16_55.27 to %.loc16_55.29 [template = constants.%.45] +// CHECK:STDOUT: %.loc16_55.31: init %.10 = array_init (%.loc16_55.9, %.loc16_55.16, %.loc16_55.23, %.loc16_55.30) to %.loc16_55.6 [template = constants.%array] +// CHECK:STDOUT: %.loc16_57.1: init %.10 = converted %.loc16_55.1, %.loc16_55.31 [template = constants.%array] +// CHECK:STDOUT: %.loc16_70.1: Core.IntLiteral = int_value 2 [template = constants.%.38] +// CHECK:STDOUT: %.loc16_57.2: ref %.10 = temporary %.loc16_55.6, %.loc16_57.1 +// CHECK:STDOUT: %.loc16_70.2: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc16_70.3: = bound_method %.loc16_70.1, %.loc16_70.2 [template = constants.%.46] +// CHECK:STDOUT: %.loc16_70.4: = specific_function %.loc16_70.3, @Convert.2(constants.%.1) [template = constants.%.47] +// CHECK:STDOUT: %int.convert_checked.loc16_70: init %i32 = call %.loc16_70.4(%.loc16_70.1) [template = constants.%.48] +// CHECK:STDOUT: %.loc16_70.5: %i32 = value_of_initializer %int.convert_checked.loc16_70 [template = constants.%.48] +// CHECK:STDOUT: %.loc16_70.6: %i32 = converted %.loc16_70.1, %.loc16_70.5 [template = constants.%.48] +// CHECK:STDOUT: %.loc16_71.1: ref %i32 = array_index %.loc16_57.2, %.loc16_70.6 +// CHECK:STDOUT: %.loc16_71.2: %i32 = bind_value %.loc16_71.1 +// CHECK:STDOUT: %.loc16_38.2: type = value_of_initializer %int.make_type_signed.loc16_38 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_38.3: type = converted %int.make_type_signed.loc16_38, %.loc16_38.2 [template = constants.%i32] // CHECK:STDOUT: assign file.%array_index.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/eval/fail_symbolic.carbon b/toolchain/check/testdata/eval/fail_symbolic.carbon index 99f200cabac6..0483c2980069 100644 --- a/toolchain/check/testdata/eval/fail_symbolic.carbon +++ b/toolchain/check/testdata/eval/fail_symbolic.carbon @@ -19,23 +19,26 @@ fn G(N:! i32) { // CHECK:STDOUT: --- fail_symbolic.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt.1: i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.24: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.25: = bound_method %N.1, %Convert.15 [symbolic] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.25(%N.1) [symbolic] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.4, @impl.3(%.1) [template] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.13) [template] +// CHECK:STDOUT: %.20: = bound_method %N.1, %Convert.13 [symbolic] +// CHECK:STDOUT: %.21: = specific_function %.20, @Convert.4(%.1) [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.21(%N.1) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -49,37 +52,41 @@ fn G(N:! i32) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %N.patt.loc12_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc12_6.1, runtime_param [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc12_6.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc12_6.1, runtime_param [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc12_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc12_6.2 (constants.%N.1)] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed.loc12, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc12_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc12_6.2 (constants.%N.1)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @G(%N.loc12_6.1: i32) { -// CHECK:STDOUT: %N.loc12_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc12_6.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc12_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: generic fn @G(%N.loc12_6.1: %i32) { +// CHECK:STDOUT: %N.loc12_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc12_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc12_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc16_16.5: = bound_method %N.loc12_6.2, constants.%Convert.15 [symbolic = %.loc16_16.5 (constants.%.25)] -// CHECK:STDOUT: %int.convert_checked.loc16_16.2: init Core.IntLiteral = call %.loc16_16.5(%N.loc12_6.2) [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc16_16.6: = bound_method %N.loc12_6.2, constants.%Convert.13 [symbolic = %.loc16_16.6 (constants.%.20)] +// CHECK:STDOUT: %.loc16_16.7: = specific_function %.loc16_16.6, @Convert.4(constants.%.1) [symbolic = %.loc16_16.7 (constants.%.21)] +// CHECK:STDOUT: %int.convert_checked.loc16_16.2: init Core.IntLiteral = call %.loc16_16.7(%N.loc12_6.2) [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%N.param_patt: i32) { +// CHECK:STDOUT: fn(%N.param_patt: %i32) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %N.ref: i32 = name_ref N, %N.loc12_6.1 [symbolic = %N.loc12_6.2 (constants.%N.1)] -// CHECK:STDOUT: %.loc16_11.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] -// CHECK:STDOUT: %.loc16_11.2: type = converted %int.make_type_32.loc16, %.loc16_11.1 [template = i32] -// CHECK:STDOUT: %.loc16_16.1: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_16.2: = bound_method %N.ref, %.loc16_16.1 [symbolic = %.loc16_16.5 (constants.%.25)] -// CHECK:STDOUT: %int.convert_checked.loc16_16.1: init Core.IntLiteral = call %.loc16_16.2(%N.ref) [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc16_16.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc16_16.1 [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc16_16.4: Core.IntLiteral = converted %N.ref, %.loc16_16.3 [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc16_17: type = array_type %.loc16_16.4, i32 [template = ] +// CHECK:STDOUT: %.loc16_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%.loc16_11.1) [template = constants.%i32] +// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc12_6.1 [symbolic = %N.loc12_6.2 (constants.%N.1)] +// CHECK:STDOUT: %.loc16_11.2: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_11.3: type = converted %int.make_type_signed.loc16, %.loc16_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_16.1: %Convert.type.2 = interface_witness_access constants.%.19, element0 [template = constants.%Convert.13] +// CHECK:STDOUT: %.loc16_16.2: = bound_method %N.ref, %.loc16_16.1 [symbolic = %.loc16_16.6 (constants.%.20)] +// CHECK:STDOUT: %.loc16_16.3: = specific_function %.loc16_16.2, @Convert.4(constants.%.1) [symbolic = %.loc16_16.7 (constants.%.21)] +// CHECK:STDOUT: %int.convert_checked.loc16_16.1: init Core.IntLiteral = call %.loc16_16.3(%N.ref) [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc16_16.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc16_16.1 [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc16_16.5: Core.IntLiteral = converted %N.ref, %.loc16_16.4 [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc16_17: type = array_type %.loc16_16.5, %i32 [template = ] // CHECK:STDOUT: %k.var: ref = var k // CHECK:STDOUT: %k: ref = bind_name k, %k.var // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon b/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon index 96d1261d4f6c..08f5cad1097e 100644 --- a/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon +++ b/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon @@ -23,22 +23,24 @@ fn H() -> i32 { // CHECK:STDOUT: --- in_place_tuple_init.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -56,13 +58,15 @@ fn H() -> i32 { // CHECK:STDOUT: %return.patt: %tuple.type.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_20.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_12, %int.make_type_32.loc11_17) -// CHECK:STDOUT: %.loc11_20.2: type = value_of_initializer %int.make_type_32.loc11_12 [template = i32] -// CHECK:STDOUT: %.loc11_20.3: type = converted %int.make_type_32.loc11_12, %.loc11_20.2 [template = i32] -// CHECK:STDOUT: %.loc11_20.4: type = value_of_initializer %int.make_type_32.loc11_17 [template = i32] -// CHECK:STDOUT: %.loc11_20.5: type = converted %int.make_type_32.loc11_17, %.loc11_20.4 [template = i32] +// CHECK:STDOUT: %.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_12: init type = call constants.%Int(%.loc11_12) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_17: init type = call constants.%Int(%.loc11_17) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_20.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_12, %int.make_type_signed.loc11_17) +// CHECK:STDOUT: %.loc11_20.2: type = value_of_initializer %int.make_type_signed.loc11_12 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_20.3: type = converted %int.make_type_signed.loc11_12, %.loc11_20.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_20.4: type = value_of_initializer %int.make_type_signed.loc11_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_20.5: type = converted %int.make_type_signed.loc11_17, %.loc11_20.4 [template = constants.%i32] // CHECK:STDOUT: %.loc11_20.6: type = converted %.loc11_20.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param @@ -71,26 +75,29 @@ fn H() -> i32 { // CHECK:STDOUT: %return.patt: %tuple.type.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc13_12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_20.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc13_12, %int.make_type_32.loc13_17) -// CHECK:STDOUT: %.loc13_20.2: type = value_of_initializer %int.make_type_32.loc13_12 [template = i32] -// CHECK:STDOUT: %.loc13_20.3: type = converted %int.make_type_32.loc13_12, %.loc13_20.2 [template = i32] -// CHECK:STDOUT: %.loc13_20.4: type = value_of_initializer %int.make_type_32.loc13_17 [template = i32] -// CHECK:STDOUT: %.loc13_20.5: type = converted %int.make_type_32.loc13_17, %.loc13_20.4 [template = i32] +// CHECK:STDOUT: %.loc13_12: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_12: init type = call constants.%Int(%.loc13_12) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_17: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_17: init type = call constants.%Int(%.loc13_17) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_20.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc13_12, %int.make_type_signed.loc13_17) +// CHECK:STDOUT: %.loc13_20.2: type = value_of_initializer %int.make_type_signed.loc13_12 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_20.3: type = converted %int.make_type_signed.loc13_12, %.loc13_20.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_20.4: type = value_of_initializer %int.make_type_signed.loc13_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_20.5: type = converted %int.make_type_signed.loc13_17, %.loc13_20.4 [template = constants.%i32] // CHECK:STDOUT: %.loc13_20.6: type = converted %.loc13_20.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc19_11.2: type = converted %int.make_type_32, %.loc19_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc19_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc19_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc19_11.3: type = converted %int.make_type_signed, %.loc19_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -98,13 +105,15 @@ fn H() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %return: %tuple.type.2 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc14_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_19.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc14_11, %int.make_type_32.loc14_16) -// CHECK:STDOUT: %.loc14_19.2: type = value_of_initializer %int.make_type_32.loc14_11 [template = i32] -// CHECK:STDOUT: %.loc14_19.3: type = converted %int.make_type_32.loc14_11, %.loc14_19.2 [template = i32] -// CHECK:STDOUT: %.loc14_19.4: type = value_of_initializer %int.make_type_32.loc14_16 [template = i32] -// CHECK:STDOUT: %.loc14_19.5: type = converted %int.make_type_32.loc14_16, %.loc14_19.4 [template = i32] +// CHECK:STDOUT: %.loc14_11: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_11: init type = call constants.%Int(%.loc14_11) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_16: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_16: init type = call constants.%Int(%.loc14_16) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_19.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_11, %int.make_type_signed.loc14_16) +// CHECK:STDOUT: %.loc14_19.2: type = value_of_initializer %int.make_type_signed.loc14_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_19.3: type = converted %int.make_type_signed.loc14_11, %.loc14_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_19.4: type = value_of_initializer %int.make_type_signed.loc14_16 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_19.5: type = converted %int.make_type_signed.loc14_16, %.loc14_19.4 [template = constants.%i32] // CHECK:STDOUT: %.loc14_19.6: type = converted %.loc14_19.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %v.var: ref %tuple.type.2 = var v // CHECK:STDOUT: %v: ref %tuple.type.2 = bind_name v, %v.var @@ -123,15 +132,15 @@ fn H() -> i32 { // CHECK:STDOUT: return %F.call.loc16 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @H() -> i32 { +// CHECK:STDOUT: fn @H() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [template = constants.%G] // CHECK:STDOUT: %.loc20_11.1: ref %tuple.type.2 = temporary_storage // CHECK:STDOUT: %G.call: init %tuple.type.2 = call %G.ref() to %.loc20_11.1 -// CHECK:STDOUT: %.loc20_14: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc20_14: Core.IntLiteral = int_value 0 [template = constants.%.3] // CHECK:STDOUT: %.loc20_11.2: ref %tuple.type.2 = temporary %.loc20_11.1, %G.call -// CHECK:STDOUT: %.loc20_13.1: ref i32 = tuple_access %.loc20_11.2, element0 -// CHECK:STDOUT: %.loc20_13.2: i32 = bind_value %.loc20_13.1 +// CHECK:STDOUT: %.loc20_13.1: ref %i32 = tuple_access %.loc20_11.2, element0 +// CHECK:STDOUT: %.loc20_13.2: %i32 = bind_value %.loc20_13.1 // CHECK:STDOUT: return %.loc20_13.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/call.carbon b/toolchain/check/testdata/function/builtin/call.carbon index 3a187c902d3f..3e0f0e3d3768 100644 --- a/toolchain/check/testdata/function/builtin/call.carbon +++ b/toolchain/check/testdata/function/builtin/call.carbon @@ -15,33 +15,38 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: --- call.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Add.type: type = fn_type @Add [template] // CHECK:STDOUT: %Add: %Add.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.30: %i32 = int_value 3 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%.1) [template] // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] -// CHECK:STDOUT: %.31: i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.16 [template] +// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.15 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.4(%.1) [template] // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.35: type = array_type %.34, i32 [template] +// CHECK:STDOUT: %.35: type = array_type %.34, %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -56,57 +61,64 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %int.make_type_32.loc11_27 [template = i32] -// CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_32.loc11_27, %.loc11_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed.loc11_11, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%.loc11_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.2: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.3: type = converted %int.make_type_signed.loc11_19, %.loc11_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_27: init type = call constants.%Int(%.loc11_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_27.2: type = value_of_initializer %int.make_type_signed.loc11_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_27.3: type = converted %int.make_type_signed.loc11_27, %.loc11_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc13_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_11.1) [template = constants.%i32] // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] -// CHECK:STDOUT: %.loc13_20.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc13_23.1: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc13_20.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_20.3: = bound_method %.loc13_20.1, %.loc13_20.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc13_20: init i32 = call %.loc13_20.3(%.loc13_20.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc13_20.4: i32 = value_of_initializer %int.convert_checked.loc13_20 [template = constants.%.28] -// CHECK:STDOUT: %.loc13_20.5: i32 = converted %.loc13_20.1, %.loc13_20.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc13_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_23.3: = bound_method %.loc13_23.1, %.loc13_23.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc13_23: init i32 = call %.loc13_23.3(%.loc13_23.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc13_23.4: i32 = value_of_initializer %int.convert_checked.loc13_23 [template = constants.%.30] -// CHECK:STDOUT: %.loc13_23.5: i32 = converted %.loc13_23.1, %.loc13_23.4 [template = constants.%.30] -// CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%.loc13_20.5, %.loc13_23.5) [template = constants.%.31] -// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_32, %.loc13_11.1 [template = i32] -// CHECK:STDOUT: %.loc13_19.1: %Convert.type.5 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %.loc13_19.2: = bound_method %int.sadd, %.loc13_19.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc13_19.3: i32 = value_of_initializer %int.sadd [template = constants.%.31] -// CHECK:STDOUT: %.loc13_19.4: i32 = converted %int.sadd, %.loc13_19.3 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc13_19: init Core.IntLiteral = call %.loc13_19.2(%.loc13_19.4) [template = constants.%.34] -// CHECK:STDOUT: %.loc13_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc13_19 [template = constants.%.34] -// CHECK:STDOUT: %.loc13_19.6: Core.IntLiteral = converted %int.sadd, %.loc13_19.5 [template = constants.%.34] -// CHECK:STDOUT: %.loc13_25: type = array_type %.loc13_19.6, i32 [template = constants.%.35] +// CHECK:STDOUT: %.loc13_20.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc13_23.1: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc13_20.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_20.3: = bound_method %.loc13_20.1, %.loc13_20.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc13_20.4: = specific_function %.loc13_20.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc13_20: init %i32 = call %.loc13_20.4(%.loc13_20.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc13_20.5: %i32 = value_of_initializer %int.convert_checked.loc13_20 [template = constants.%.26] +// CHECK:STDOUT: %.loc13_20.6: %i32 = converted %.loc13_20.1, %.loc13_20.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc13_23.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_23.3: = bound_method %.loc13_23.1, %.loc13_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc13_23.4: = specific_function %.loc13_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc13_23: init %i32 = call %.loc13_23.4(%.loc13_23.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc13_23.5: %i32 = value_of_initializer %int.convert_checked.loc13_23 [template = constants.%.29] +// CHECK:STDOUT: %.loc13_23.6: %i32 = converted %.loc13_23.1, %.loc13_23.5 [template = constants.%.29] +// CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%.loc13_20.6, %.loc13_23.6) [template = constants.%.30] +// CHECK:STDOUT: %.loc13_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_11.3: type = converted %int.make_type_signed, %.loc13_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_19.1: %Convert.type.6 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc13_19.2: = bound_method %int.sadd, %.loc13_19.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc13_19.3: = specific_function %.loc13_19.2, @Convert.4(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %.loc13_19.4: %i32 = value_of_initializer %int.sadd [template = constants.%.30] +// CHECK:STDOUT: %.loc13_19.5: %i32 = converted %int.sadd, %.loc13_19.4 [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc13_19: init Core.IntLiteral = call %.loc13_19.3(%.loc13_19.5) [template = constants.%.34] +// CHECK:STDOUT: %.loc13_19.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc13_19 [template = constants.%.34] +// CHECK:STDOUT: %.loc13_19.7: Core.IntLiteral = converted %int.sadd, %.loc13_19.6 [template = constants.%.34] +// CHECK:STDOUT: %.loc13_25: type = array_type %.loc13_19.7, %i32 [template = constants.%.35] // CHECK:STDOUT: %arr.var: ref %.35 = var arr // CHECK:STDOUT: %arr: ref %.35 = bind_name arr, %arr.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @Add(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/definition.carbon b/toolchain/check/testdata/function/builtin/definition.carbon index 32c6fe65b68c..00b4aa78bc10 100644 --- a/toolchain/check/testdata/function/builtin/definition.carbon +++ b/toolchain/check/testdata/function/builtin/definition.carbon @@ -13,15 +13,17 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: --- definition.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Add.type: type = fn_type @Add [template] // CHECK:STDOUT: %Add: %Add.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -34,30 +36,33 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %int.make_type_32.loc11_27 [template = i32] -// CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_32.loc11_27, %.loc11_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed.loc11_11, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%.loc11_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.2: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.3: type = converted %int.make_type_signed.loc11_19, %.loc11_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_27: init type = call constants.%Int(%.loc11_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_27.2: type = value_of_initializer %int.make_type_signed.loc11_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_27.3: type = converted %int.make_type_signed.loc11_27, %.loc11_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @Add(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/fail_redefined.carbon b/toolchain/check/testdata/function/builtin/fail_redefined.carbon index baa640acf815..7ed34f24f2b7 100644 --- a/toolchain/check/testdata/function/builtin/fail_redefined.carbon +++ b/toolchain/check/testdata/function/builtin/fail_redefined.carbon @@ -40,8 +40,10 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: --- fail_redefined.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] @@ -52,7 +54,7 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -67,162 +69,180 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl.loc11: %A.type = fn_decl @A [template = constants.%A] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %m.patt: i32 = binding_pattern m -// CHECK:STDOUT: %m.param_patt: i32 = value_param_pattern %m.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %m.patt: %i32 = binding_pattern m +// CHECK:STDOUT: %m.param_patt: %i32 = value_param_pattern %m.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11_9, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17.1: type = value_of_initializer %int.make_type_32.loc11_17 [template = i32] -// CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_32.loc11_17, %.loc11_17.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_32.loc11_25 [template = i32] -// CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_32.loc11_25, %.loc11_25.1 [template = i32] -// CHECK:STDOUT: %n.param.loc11: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n.loc11: i32 = bind_name n, %n.param.loc11 -// CHECK:STDOUT: %m.param.loc11: i32 = value_param runtime_param1 -// CHECK:STDOUT: %m.loc11: i32 = bind_name m, %m.param.loc11 -// CHECK:STDOUT: %return.param.loc11: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %.loc11_22: ref i32 = return_slot %return.param.loc11 +// CHECK:STDOUT: %.loc11_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%.loc11_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.3: type = converted %int.make_type_signed.loc11_9, %.loc11_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_17: init type = call constants.%Int(%.loc11_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_17, %.loc11_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_25: init type = call constants.%Int(%.loc11_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.2: type = value_of_initializer %int.make_type_signed.loc11_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.3: type = converted %int.make_type_signed.loc11_25, %.loc11_25.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param.loc11: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n.loc11: %i32 = bind_name n, %n.param.loc11 +// CHECK:STDOUT: %m.param.loc11: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %m.loc11: %i32 = bind_name m, %m.param.loc11 +// CHECK:STDOUT: %return.param.loc11: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %.loc11_22: ref %i32 = return_slot %return.param.loc11 // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl.loc19: %A.type = fn_decl @A [template = constants.%A] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %m.patt: i32 = binding_pattern m -// CHECK:STDOUT: %m.param_patt: i32 = value_param_pattern %m.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %m.patt: %i32 = binding_pattern m +// CHECK:STDOUT: %m.param_patt: %i32 = value_param_pattern %m.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc19_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_9.1: type = value_of_initializer %int.make_type_32.loc19_9 [template = i32] -// CHECK:STDOUT: %.loc19_9.2: type = converted %int.make_type_32.loc19_9, %.loc19_9.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc19_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_32.loc19_17 [template = i32] -// CHECK:STDOUT: %.loc19_17.2: type = converted %int.make_type_32.loc19_17, %.loc19_17.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc19_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_25.1: type = value_of_initializer %int.make_type_32.loc19_25 [template = i32] -// CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_32.loc19_25, %.loc19_25.1 [template = i32] -// CHECK:STDOUT: %n.param.loc19: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n.loc19: i32 = bind_name n, %n.param.loc19 -// CHECK:STDOUT: %m.param.loc19: i32 = value_param runtime_param1 -// CHECK:STDOUT: %m.loc19: i32 = bind_name m, %m.param.loc19 -// CHECK:STDOUT: %return.param.loc19: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param.loc19 +// CHECK:STDOUT: %.loc19_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19_9: init type = call constants.%Int(%.loc19_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_9.2: type = value_of_initializer %int.make_type_signed.loc19_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_9.3: type = converted %int.make_type_signed.loc19_9, %.loc19_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19_17: init type = call constants.%Int(%.loc19_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_17.2: type = value_of_initializer %int.make_type_signed.loc19_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_17.3: type = converted %int.make_type_signed.loc19_17, %.loc19_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19_25: init type = call constants.%Int(%.loc19_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_25.2: type = value_of_initializer %int.make_type_signed.loc19_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_25.3: type = converted %int.make_type_signed.loc19_25, %.loc19_25.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param.loc19: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n.loc19: %i32 = bind_name n, %n.param.loc19 +// CHECK:STDOUT: %m.param.loc19: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %m.loc19: %i32 = bind_name m, %m.param.loc19 +// CHECK:STDOUT: %return.param.loc19: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param.loc19 // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl.loc21: %B.type = fn_decl @B [template = constants.%B] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %m.patt: i32 = binding_pattern m -// CHECK:STDOUT: %m.param_patt: i32 = value_param_pattern %m.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %m.patt: %i32 = binding_pattern m +// CHECK:STDOUT: %m.param_patt: %i32 = value_param_pattern %m.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc21_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_9.1: type = value_of_initializer %int.make_type_32.loc21_9 [template = i32] -// CHECK:STDOUT: %.loc21_9.2: type = converted %int.make_type_32.loc21_9, %.loc21_9.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc21_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_17.1: type = value_of_initializer %int.make_type_32.loc21_17 [template = i32] -// CHECK:STDOUT: %.loc21_17.2: type = converted %int.make_type_32.loc21_17, %.loc21_17.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc21_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_25.1: type = value_of_initializer %int.make_type_32.loc21_25 [template = i32] -// CHECK:STDOUT: %.loc21_25.2: type = converted %int.make_type_32.loc21_25, %.loc21_25.1 [template = i32] -// CHECK:STDOUT: %n.param.loc21: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n.loc21: i32 = bind_name n, %n.param.loc21 -// CHECK:STDOUT: %m.param.loc21: i32 = value_param runtime_param1 -// CHECK:STDOUT: %m.loc21: i32 = bind_name m, %m.param.loc21 -// CHECK:STDOUT: %return.param.loc21: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %.loc21_22: ref i32 = return_slot %return.param.loc21 +// CHECK:STDOUT: %.loc21_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21_9: init type = call constants.%Int(%.loc21_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_9.2: type = value_of_initializer %int.make_type_signed.loc21_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_9.3: type = converted %int.make_type_signed.loc21_9, %.loc21_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21_17: init type = call constants.%Int(%.loc21_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_17.2: type = value_of_initializer %int.make_type_signed.loc21_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_17.3: type = converted %int.make_type_signed.loc21_17, %.loc21_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21_25: init type = call constants.%Int(%.loc21_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_25.2: type = value_of_initializer %int.make_type_signed.loc21_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_25.3: type = converted %int.make_type_signed.loc21_25, %.loc21_25.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param.loc21: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n.loc21: %i32 = bind_name n, %n.param.loc21 +// CHECK:STDOUT: %m.param.loc21: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %m.loc21: %i32 = bind_name m, %m.param.loc21 +// CHECK:STDOUT: %return.param.loc21: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %.loc21_22: ref %i32 = return_slot %return.param.loc21 // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl.loc29: %B.type = fn_decl @B [template = constants.%B] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %m.patt: i32 = binding_pattern m -// CHECK:STDOUT: %m.param_patt: i32 = value_param_pattern %m.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %m.patt: %i32 = binding_pattern m +// CHECK:STDOUT: %m.param_patt: %i32 = value_param_pattern %m.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc29_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc29_9.1: type = value_of_initializer %int.make_type_32.loc29_9 [template = i32] -// CHECK:STDOUT: %.loc29_9.2: type = converted %int.make_type_32.loc29_9, %.loc29_9.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc29_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc29_17.1: type = value_of_initializer %int.make_type_32.loc29_17 [template = i32] -// CHECK:STDOUT: %.loc29_17.2: type = converted %int.make_type_32.loc29_17, %.loc29_17.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc29_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc29_25.1: type = value_of_initializer %int.make_type_32.loc29_25 [template = i32] -// CHECK:STDOUT: %.loc29_25.2: type = converted %int.make_type_32.loc29_25, %.loc29_25.1 [template = i32] -// CHECK:STDOUT: %n.param.loc29: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n.loc29: i32 = bind_name n, %n.param.loc29 -// CHECK:STDOUT: %m.param.loc29: i32 = value_param runtime_param1 -// CHECK:STDOUT: %m.loc29: i32 = bind_name m, %m.param.loc29 -// CHECK:STDOUT: %return.param.loc29: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param.loc29 +// CHECK:STDOUT: %.loc29_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc29_9: init type = call constants.%Int(%.loc29_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc29_9.2: type = value_of_initializer %int.make_type_signed.loc29_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc29_9.3: type = converted %int.make_type_signed.loc29_9, %.loc29_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc29_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc29_17: init type = call constants.%Int(%.loc29_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc29_17.2: type = value_of_initializer %int.make_type_signed.loc29_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc29_17.3: type = converted %int.make_type_signed.loc29_17, %.loc29_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc29_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc29_25: init type = call constants.%Int(%.loc29_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc29_25.2: type = value_of_initializer %int.make_type_signed.loc29_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc29_25.3: type = converted %int.make_type_signed.loc29_25, %.loc29_25.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param.loc29: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n.loc29: %i32 = bind_name n, %n.param.loc29 +// CHECK:STDOUT: %m.param.loc29: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %m.loc29: %i32 = bind_name m, %m.param.loc29 +// CHECK:STDOUT: %return.param.loc29: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param.loc29 // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl.loc31: %C.type = fn_decl @C [template = constants.%C] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %m.patt: i32 = binding_pattern m -// CHECK:STDOUT: %m.param_patt: i32 = value_param_pattern %m.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %m.patt: %i32 = binding_pattern m +// CHECK:STDOUT: %m.param_patt: %i32 = value_param_pattern %m.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc31_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc31_9.1: type = value_of_initializer %int.make_type_32.loc31_9 [template = i32] -// CHECK:STDOUT: %.loc31_9.2: type = converted %int.make_type_32.loc31_9, %.loc31_9.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc31_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc31_17.1: type = value_of_initializer %int.make_type_32.loc31_17 [template = i32] -// CHECK:STDOUT: %.loc31_17.2: type = converted %int.make_type_32.loc31_17, %.loc31_17.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc31_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc31_25.1: type = value_of_initializer %int.make_type_32.loc31_25 [template = i32] -// CHECK:STDOUT: %.loc31_25.2: type = converted %int.make_type_32.loc31_25, %.loc31_25.1 [template = i32] -// CHECK:STDOUT: %n.param.loc31: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n.loc31: i32 = bind_name n, %n.param.loc31 -// CHECK:STDOUT: %m.param.loc31: i32 = value_param runtime_param1 -// CHECK:STDOUT: %m.loc31: i32 = bind_name m, %m.param.loc31 -// CHECK:STDOUT: %return.param.loc31: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %.loc31_22: ref i32 = return_slot %return.param.loc31 +// CHECK:STDOUT: %.loc31_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc31_9: init type = call constants.%Int(%.loc31_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc31_9.2: type = value_of_initializer %int.make_type_signed.loc31_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc31_9.3: type = converted %int.make_type_signed.loc31_9, %.loc31_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc31_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc31_17: init type = call constants.%Int(%.loc31_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc31_17.2: type = value_of_initializer %int.make_type_signed.loc31_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc31_17.3: type = converted %int.make_type_signed.loc31_17, %.loc31_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc31_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc31_25: init type = call constants.%Int(%.loc31_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc31_25.2: type = value_of_initializer %int.make_type_signed.loc31_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc31_25.3: type = converted %int.make_type_signed.loc31_25, %.loc31_25.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param.loc31: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n.loc31: %i32 = bind_name n, %n.param.loc31 +// CHECK:STDOUT: %m.param.loc31: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %m.loc31: %i32 = bind_name m, %m.param.loc31 +// CHECK:STDOUT: %return.param.loc31: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %.loc31_22: ref %i32 = return_slot %return.param.loc31 // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl.loc38: %C.type = fn_decl @C [template = constants.%C] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %m.patt: i32 = binding_pattern m -// CHECK:STDOUT: %m.param_patt: i32 = value_param_pattern %m.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %m.patt: %i32 = binding_pattern m +// CHECK:STDOUT: %m.param_patt: %i32 = value_param_pattern %m.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc38_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc38_9.1: type = value_of_initializer %int.make_type_32.loc38_9 [template = i32] -// CHECK:STDOUT: %.loc38_9.2: type = converted %int.make_type_32.loc38_9, %.loc38_9.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc38_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc38_17.1: type = value_of_initializer %int.make_type_32.loc38_17 [template = i32] -// CHECK:STDOUT: %.loc38_17.2: type = converted %int.make_type_32.loc38_17, %.loc38_17.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc38_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc38_25.1: type = value_of_initializer %int.make_type_32.loc38_25 [template = i32] -// CHECK:STDOUT: %.loc38_25.2: type = converted %int.make_type_32.loc38_25, %.loc38_25.1 [template = i32] -// CHECK:STDOUT: %n.param.loc38: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n.loc38: i32 = bind_name n, %n.param.loc38 -// CHECK:STDOUT: %m.param.loc38: i32 = value_param runtime_param1 -// CHECK:STDOUT: %m.loc38: i32 = bind_name m, %m.param.loc38 -// CHECK:STDOUT: %return.param.loc38: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param.loc38 +// CHECK:STDOUT: %.loc38_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc38_9: init type = call constants.%Int(%.loc38_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc38_9.2: type = value_of_initializer %int.make_type_signed.loc38_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc38_9.3: type = converted %int.make_type_signed.loc38_9, %.loc38_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc38_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc38_17: init type = call constants.%Int(%.loc38_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc38_17.2: type = value_of_initializer %int.make_type_signed.loc38_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc38_17.3: type = converted %int.make_type_signed.loc38_17, %.loc38_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc38_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc38_25: init type = call constants.%Int(%.loc38_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc38_25.2: type = value_of_initializer %int.make_type_signed.loc38_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc38_25.3: type = converted %int.make_type_signed.loc38_25, %.loc38_25.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param.loc38: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n.loc38: %i32 = bind_name n, %n.param.loc38 +// CHECK:STDOUT: %m.param.loc38: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %m.loc38: %i32 = bind_name m, %m.param.loc38 +// CHECK:STDOUT: %return.param.loc38: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param.loc38 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @A(%n.param_patt: i32, %m.param_patt: i32) -> i32 = "int.sadd" { +// CHECK:STDOUT: fn @A(%n.param_patt: %i32, %m.param_patt: %i32) -> %i32 = "int.sadd" { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n.loc19 +// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n.loc19 // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%n.param_patt: i32, %m.param_patt: i32) -> i32 = "int.sadd" { +// CHECK:STDOUT: fn @B(%n.param_patt: %i32, %m.param_patt: %i32) -> %i32 = "int.sadd" { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n.loc21 +// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n.loc21 // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%n.param_patt: i32, %m.param_patt: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @C(%n.param_patt: %i32, %m.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/method.carbon b/toolchain/check/testdata/function/builtin/method.carbon index ca35cd60b073..bd0c8f727792 100644 --- a/toolchain/check/testdata/function/builtin/method.carbon +++ b/toolchain/check/testdata/function/builtin/method.carbon @@ -27,41 +27,46 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %.1: type = assoc_entity_type %I.type, %F.type.1 [template] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, @I.%F.decl [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.3 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.3: = interface_witness (%F.2) [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(i32) [template] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %.4: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] // CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.2, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.29: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 1 [template] -// CHECK:STDOUT: %.31: = bound_method %.30, %F.2 [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.12 [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.7, @impl.6(%.3) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.26: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.27: = specific_function %.26, @Convert.7(%.3) [template] +// CHECK:STDOUT: %.28: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.29: = bound_method %.28, %F.2 [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.2, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.3, @impl.2(%.3) [template] // CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] // CHECK:STDOUT: %.34: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %.35: = bound_method %.32, %Convert.16 [template] -// CHECK:STDOUT: %.36: i32 = int_value 2 [template] -// CHECK:STDOUT: %.37: i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.17: type = fn_type @Convert.13 [template] +// CHECK:STDOUT: %.35: = bound_method %.30, %Convert.16 [template] +// CHECK:STDOUT: %.36: = specific_function %.35, @Convert.3(%.3) [template] +// CHECK:STDOUT: %.37: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.38: %i32 = int_value 3 [template] +// CHECK:STDOUT: %Convert.type.17: type = fn_type @Convert.5, @impl.4(%.3) [template] // CHECK:STDOUT: %Convert.17: %Convert.type.17 = struct_value () [template] -// CHECK:STDOUT: %.38: = interface_witness (%Convert.17) [template] -// CHECK:STDOUT: %.39: = bound_method %.37, %Convert.17 [template] -// CHECK:STDOUT: %.40: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.41: type = array_type %.40, i32 [template] +// CHECK:STDOUT: %.39: = interface_witness (%Convert.17) [template] +// CHECK:STDOUT: %.40: = bound_method %.38, %Convert.17 [template] +// CHECK:STDOUT: %.41: = specific_function %.40, @Convert.5(%.3) [template] +// CHECK:STDOUT: %.42: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.43: type = array_type %.42, %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .As = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.51 +// CHECK:STDOUT: .ImplicitAs = %import_ref.38 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -76,44 +81,50 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @impl.1 [template] {} { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32, %.loc15_6.1 [template = i32] +// CHECK:STDOUT: %.loc15_6.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_6.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_6.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_6.3: type = converted %int.make_type_signed, %.loc15_6.2 [template = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc19_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_17: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %int.make_type_32.loc19_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_22.1: type = value_of_initializer %int.make_type_32.loc19_22 [template = i32] -// CHECK:STDOUT: %.loc19_22.2: type = converted %int.make_type_32.loc19_22, %.loc19_22.1 [template = i32] -// CHECK:STDOUT: %.loc19_19.1: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc19_19.2: = bound_method %.loc19_17, %.loc19_19.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc19_19: init i32 = call %.loc19_19.2(%.loc19_17) [template = constants.%.30] -// CHECK:STDOUT: %.loc19_19.3: i32 = value_of_initializer %int.convert_checked.loc19_19 [template = constants.%.30] -// CHECK:STDOUT: %.loc19_19.4: i32 = converted %.loc19_17, %.loc19_19.3 [template = constants.%.30] +// CHECK:STDOUT: %.loc19_11.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc19_11: init type = call constants.%Int(%.loc19_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_17: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc19_22.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc19_22: init type = call constants.%Int(%.loc19_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_22.2: type = value_of_initializer %int.make_type_signed.loc19_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_22.3: type = converted %int.make_type_signed.loc19_22, %.loc19_22.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_19.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc19_19.2: = bound_method %.loc19_17, %.loc19_19.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc19_19.3: = specific_function %.loc19_19.2, @Convert.7(constants.%.3) [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc19_19: init %i32 = call %.loc19_19.3(%.loc19_17) [template = constants.%.28] +// CHECK:STDOUT: %.loc19_19.4: %i32 = value_of_initializer %int.convert_checked.loc19_19 [template = constants.%.28] +// CHECK:STDOUT: %.loc19_19.5: %i32 = converted %.loc19_17, %.loc19_19.4 [template = constants.%.28] // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%I.type] // CHECK:STDOUT: %F.ref: %.1 = name_ref F, @I.%.loc12 [template = constants.%.2] -// CHECK:STDOUT: %.loc19_26.1: %F.type.1 = interface_witness_access constants.%.3, element0 [template = constants.%F.2] -// CHECK:STDOUT: %.loc19_26.2: = bound_method %.loc19_19.4, %.loc19_26.1 [template = constants.%.31] -// CHECK:STDOUT: %.loc19_33.1: Core.IntLiteral = int_value 2 [template = constants.%.32] -// CHECK:STDOUT: %.loc19_33.2: %Convert.type.4 = interface_witness_access constants.%.34, element0 [template = constants.%Convert.16] +// CHECK:STDOUT: %.loc19_26.1: %F.type.1 = interface_witness_access constants.%.4, element0 [template = constants.%F.2] +// CHECK:STDOUT: %.loc19_26.2: = bound_method %.loc19_19.5, %.loc19_26.1 [template = constants.%.29] +// CHECK:STDOUT: %.loc19_33.1: Core.IntLiteral = int_value 2 [template = constants.%.30] +// CHECK:STDOUT: %.loc19_33.2: %Convert.type.15 = interface_witness_access constants.%.34, element0 [template = constants.%Convert.16] // CHECK:STDOUT: %.loc19_33.3: = bound_method %.loc19_33.1, %.loc19_33.2 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc19_33: init i32 = call %.loc19_33.3(%.loc19_33.1) [template = constants.%.36] -// CHECK:STDOUT: %.loc19_33.4: i32 = value_of_initializer %int.convert_checked.loc19_33 [template = constants.%.36] -// CHECK:STDOUT: %.loc19_33.5: i32 = converted %.loc19_33.1, %.loc19_33.4 [template = constants.%.36] -// CHECK:STDOUT: %int.sadd: init i32 = call %.loc19_26.2(%.loc19_19.4, %.loc19_33.5) [template = constants.%.37] -// CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_32.loc19_11 [template = i32] -// CHECK:STDOUT: %.loc19_11.2: type = converted %int.make_type_32.loc19_11, %.loc19_11.1 [template = i32] -// CHECK:STDOUT: %.loc19_32.1: %Convert.type.7 = interface_witness_access constants.%.38, element0 [template = constants.%Convert.17] -// CHECK:STDOUT: %.loc19_32.2: = bound_method %int.sadd, %.loc19_32.1 [template = constants.%.39] -// CHECK:STDOUT: %.loc19_32.3: i32 = value_of_initializer %int.sadd [template = constants.%.37] -// CHECK:STDOUT: %.loc19_32.4: i32 = converted %int.sadd, %.loc19_32.3 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc19_32: init Core.IntLiteral = call %.loc19_32.2(%.loc19_32.4) [template = constants.%.40] -// CHECK:STDOUT: %.loc19_32.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc19_32 [template = constants.%.40] -// CHECK:STDOUT: %.loc19_32.6: Core.IntLiteral = converted %int.sadd, %.loc19_32.5 [template = constants.%.40] -// CHECK:STDOUT: %.loc19_35: type = array_type %.loc19_32.6, i32 [template = constants.%.41] -// CHECK:STDOUT: %arr.var: ref %.41 = var arr -// CHECK:STDOUT: %arr: ref %.41 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc19_33.4: = specific_function %.loc19_33.3, @Convert.3(constants.%.3) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc19_33: init %i32 = call %.loc19_33.4(%.loc19_33.1) [template = constants.%.37] +// CHECK:STDOUT: %.loc19_33.5: %i32 = value_of_initializer %int.convert_checked.loc19_33 [template = constants.%.37] +// CHECK:STDOUT: %.loc19_33.6: %i32 = converted %.loc19_33.1, %.loc19_33.5 [template = constants.%.37] +// CHECK:STDOUT: %int.sadd: init %i32 = call %.loc19_26.2(%.loc19_19.5, %.loc19_33.6) [template = constants.%.38] +// CHECK:STDOUT: %.loc19_11.2: type = value_of_initializer %int.make_type_signed.loc19_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_11.3: type = converted %int.make_type_signed.loc19_11, %.loc19_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_32.1: %Convert.type.7 = interface_witness_access constants.%.39, element0 [template = constants.%Convert.17] +// CHECK:STDOUT: %.loc19_32.2: = bound_method %int.sadd, %.loc19_32.1 [template = constants.%.40] +// CHECK:STDOUT: %.loc19_32.3: = specific_function %.loc19_32.2, @Convert.5(constants.%.3) [template = constants.%.41] +// CHECK:STDOUT: %.loc19_32.4: %i32 = value_of_initializer %int.sadd [template = constants.%.38] +// CHECK:STDOUT: %.loc19_32.5: %i32 = converted %int.sadd, %.loc19_32.4 [template = constants.%.38] +// CHECK:STDOUT: %int.convert_checked.loc19_32: init Core.IntLiteral = call %.loc19_32.3(%.loc19_32.5) [template = constants.%.42] +// CHECK:STDOUT: %.loc19_32.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc19_32 [template = constants.%.42] +// CHECK:STDOUT: %.loc19_32.7: Core.IntLiteral = converted %int.sadd, %.loc19_32.6 [template = constants.%.42] +// CHECK:STDOUT: %.loc19_35: type = array_type %.loc19_32.7, %i32 [template = constants.%.43] +// CHECK:STDOUT: %arr.var: ref %.43 = var arr +// CHECK:STDOUT: %arr: ref %.43 = bind_name arr, %arr.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -150,32 +161,35 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: witness = (%F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %.loc15_6.2 as %I.ref { +// CHECK:STDOUT: impl @impl.1: %.loc15_6.3 as %I.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { -// CHECK:STDOUT: %self.patt: i32 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: i32 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %other.patt: i32 = binding_pattern other -// CHECK:STDOUT: %other.param_patt: i32 = value_param_pattern %other.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %self.patt: %i32 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %i32 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %other.patt: %i32 = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %i32 = value_param_pattern %other.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc16_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_14.1: type = value_of_initializer %int.make_type_32.loc16_14 [template = i32] -// CHECK:STDOUT: %.loc16_14.2: type = converted %int.make_type_32.loc16_14, %.loc16_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc16_26: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_26.1: type = value_of_initializer %int.make_type_32.loc16_26 [template = i32] -// CHECK:STDOUT: %.loc16_26.2: type = converted %int.make_type_32.loc16_26, %.loc16_26.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc16_34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_34.1: type = value_of_initializer %int.make_type_32.loc16_34 [template = i32] -// CHECK:STDOUT: %.loc16_34.2: type = converted %int.make_type_32.loc16_34, %.loc16_34.1 [template = i32] -// CHECK:STDOUT: %self.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %self: i32 = bind_name self, %self.param -// CHECK:STDOUT: %other.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %other: i32 = bind_name other, %other.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc16_14.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc16_14: init type = call constants.%Int(%.loc16_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_14.2: type = value_of_initializer %int.make_type_signed.loc16_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_14.3: type = converted %int.make_type_signed.loc16_14, %.loc16_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_26.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc16_26: init type = call constants.%Int(%.loc16_26.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_26.2: type = value_of_initializer %int.make_type_signed.loc16_26 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_26.3: type = converted %int.make_type_signed.loc16_26, %.loc16_26.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_34.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc16_34: init type = call constants.%Int(%.loc16_34.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_34.2: type = value_of_initializer %int.make_type_signed.loc16_34 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_34.3: type = converted %int.make_type_signed.loc16_34, %.loc16_34.2 [template = constants.%i32] +// CHECK:STDOUT: %self.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %self: %i32 = bind_name self, %self.param +// CHECK:STDOUT: %other.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %other: %i32 = bind_name other, %other.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15_15: = interface_witness (%F.decl) [template = constants.%.3] +// CHECK:STDOUT: %.loc15_15: = interface_witness (%F.decl) [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl @@ -188,13 +202,13 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self (%Self.1)](%other.param_patt: @F.1.%Self (%Self.1)) -> @F.1.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2[%self.param_patt: i32](%other.param_patt: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @F.2[%self.param_patt: %i32](%other.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Self.1) { // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.1(i32) { -// CHECK:STDOUT: %Self => i32 +// CHECK:STDOUT: specific @F.1(constants.%i32) { +// CHECK:STDOUT: %Self => constants.%i32 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon index a14ad28562e2..1446b9808808 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon @@ -12,8 +12,8 @@ package Core; -fn Int32() -> type = "int.make_type_32"; fn IntLiteral() -> type = "int_literal.make_type"; +fn Int(N: IntLiteral()) -> type = "int.make_type_signed"; interface Add { fn Op[self: Self](other: Self) -> Self; @@ -52,10 +52,10 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: --- core.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %Add.type: type = facet_type <@Add> [template] // CHECK:STDOUT: %Self.1: %Add.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] @@ -80,50 +80,45 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %.5: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.2 [symbolic] // CHECK:STDOUT: %.6: %.5 = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.7 [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.7: = interface_witness (%Op.2) [template] -// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %.8: = interface_witness (%Op.2) [template] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%i32)> [template] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.1, @As(i32) [template] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.1, @As(%i32) [template] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [template] -// CHECK:STDOUT: %.8: type = assoc_entity_type %As.type.3, %Convert.type.4 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, @As.%Convert.decl [template] -// CHECK:STDOUT: %.10: = interface_witness (%Convert.3) [template] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %As.type.3, %Convert.type.4 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, @As.%Convert.decl [template] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.3) [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.4 [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.2, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.2, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [template] -// CHECK:STDOUT: %.11: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.6 [template] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, @ImplicitAs.%Convert.decl [template] -// CHECK:STDOUT: %.13: = interface_witness (%Convert.5) [template] +// CHECK:STDOUT: %.12: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.6 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, @ImplicitAs.%Convert.decl [template] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.5) [template] // CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] // CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5 [template] // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [template] // CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.2, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [template] -// CHECK:STDOUT: %.14: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.8 [template] -// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, @ImplicitAs.%Convert.decl [template] -// CHECK:STDOUT: %.16: = interface_witness (%Convert.7) [template] +// CHECK:STDOUT: %.15: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.8 [template] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, @ImplicitAs.%Convert.decl [template] +// CHECK:STDOUT: %.17: = interface_witness (%Convert.7) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int32 = %Int32.decl // CHECK:STDOUT: .IntLiteral = %IntLiteral.decl +// CHECK:STDOUT: .Int = %Int.decl // CHECK:STDOUT: .Add = %Add.decl // CHECK:STDOUT: .As = %As.decl // CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] { -// CHECK:STDOUT: %return.patt: type = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 -// CHECK:STDOUT: %return: ref type = return_slot %return.param -// CHECK:STDOUT: } // CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] { // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0 @@ -131,6 +126,21 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 // CHECK:STDOUT: %return: ref type = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] { +// CHECK:STDOUT: %N.patt: Core.IntLiteral = binding_pattern N +// CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: type = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_22.2: type = converted %int_literal.make_type, %.loc5_22.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %N: Core.IntLiteral = bind_name N, %N.param +// CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 +// CHECK:STDOUT: %return: ref type = return_slot %return.param +// CHECK:STDOUT: } // CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%Add.type] {} {} // CHECK:STDOUT: %As.decl: %As.type.1 = interface_decl @As [template = constants.%As] { // CHECK:STDOUT: %T.patt.loc11_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_14.2 (constants.%T.patt)] @@ -147,9 +157,10 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %T.loc15_22.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc15_22.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.1 [template] {} { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_6.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc19_6.2: type = converted %int.make_type_32, %.loc19_6.1 [template = i32] +// CHECK:STDOUT: %.loc19_6.1: Core.IntLiteral = int_value 32 [template = constants.%.7] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc19_6.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_6.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc19_6.3: type = converted %int.make_type_signed, %.loc19_6.2 [template = constants.%i32] // CHECK:STDOUT: %Add.ref: type = name_ref Add, file.%Add.decl [template = constants.%Add.type] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 [template] {} { @@ -158,10 +169,11 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %.loc23_17.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc23_17.2: type = converted %int_literal.make_type, %.loc23_17.1 [template = Core.IntLiteral] // CHECK:STDOUT: %As.ref: %As.type.1 = name_ref As, file.%As.decl [template = constants.%As] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_24.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc23_24.2: type = converted %int.make_type_32, %.loc23_24.1 [template = i32] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(i32)> [template = constants.%As.type.3] +// CHECK:STDOUT: %.loc23_25: Core.IntLiteral = int_value 32 [template = constants.%.7] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc23_25) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_24.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc23_24.2: type = converted %int.make_type_signed, %.loc23_24.1 [template = constants.%i32] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(constants.%i32)> [template = constants.%As.type.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.3 [template] {} { // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] @@ -169,15 +181,17 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %.loc27_17.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc27_17.2: type = converted %int_literal.make_type, %.loc27_17.1 [template = Core.IntLiteral] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, file.%ImplicitAs.decl [template = constants.%ImplicitAs] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc27_32.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc27_32.2: type = converted %int.make_type_32, %.loc27_32.1 [template = i32] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %.loc27_33: Core.IntLiteral = int_value 32 [template = constants.%.7] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc27_33) [template = constants.%i32] +// CHECK:STDOUT: %.loc27_32.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc27_32.2: type = converted %int.make_type_signed, %.loc27_32.1 [template = constants.%i32] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32)> [template = constants.%ImplicitAs.type.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.4 [template] {} { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc31_6.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc31_6.2: type = converted %int.make_type_32, %.loc31_6.1 [template = i32] +// CHECK:STDOUT: %.loc31_6.1: Core.IntLiteral = int_value 32 [template = constants.%.7] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc31_6.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc31_6.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc31_6.3: type = converted %int.make_type_signed, %.loc31_6.2 [template = constants.%i32] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, file.%ImplicitAs.decl [template = constants.%ImplicitAs] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] @@ -299,26 +313,26 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %.loc19_6.2 as %Add.ref { +// CHECK:STDOUT: impl @impl.1: %.loc19_6.3 as %Add.ref { // CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { -// CHECK:STDOUT: %self.patt: i32 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: i32 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %other.patt: i32 = binding_pattern other -// CHECK:STDOUT: %other.param_patt: i32 = value_param_pattern %other.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %self.patt: %i32 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %i32 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %other.patt: %i32 = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %i32 = value_param_pattern %other.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc20_15: type = name_ref Self, @impl.1.%.loc19_6.2 [template = i32] -// CHECK:STDOUT: %Self.ref.loc20_28: type = name_ref Self, @impl.1.%.loc19_6.2 [template = i32] -// CHECK:STDOUT: %Self.ref.loc20_37: type = name_ref Self, @impl.1.%.loc19_6.2 [template = i32] -// CHECK:STDOUT: %self.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %self: i32 = bind_name self, %self.param -// CHECK:STDOUT: %other.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %other: i32 = bind_name other, %other.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %Self.ref.loc20_15: type = name_ref Self, @impl.1.%.loc19_6.3 [template = constants.%i32] +// CHECK:STDOUT: %Self.ref.loc20_28: type = name_ref Self, @impl.1.%.loc19_6.3 [template = constants.%i32] +// CHECK:STDOUT: %Self.ref.loc20_37: type = name_ref Self, @impl.1.%.loc19_6.3 [template = constants.%i32] +// CHECK:STDOUT: %self.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %self: %i32 = bind_name self, %self.param +// CHECK:STDOUT: %other.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %other: %i32 = bind_name other, %other.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19_17: = interface_witness (%Op.decl) [template = constants.%.7] +// CHECK:STDOUT: %.loc19_17: = interface_witness (%Op.decl) [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -329,19 +343,20 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Convert.decl: %Convert.type.3 = fn_decl @Convert.3 [template = constants.%Convert.3] { // CHECK:STDOUT: %self.patt: Core.IntLiteral = binding_pattern self // CHECK:STDOUT: %self.param_patt: Core.IntLiteral = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.2.%.loc23_17.2 [template = Core.IntLiteral] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc24_31.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc24_31.2: type = converted %int.make_type_32, %.loc24_31.1 [template = i32] +// CHECK:STDOUT: %.loc24_31.1: Core.IntLiteral = int_value 32 [template = constants.%.7] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc24_31.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc24_31.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc24_31.3: type = converted %int.make_type_signed, %.loc24_31.2 [template = constants.%i32] // CHECK:STDOUT: %self.param: Core.IntLiteral = value_param runtime_param0 // CHECK:STDOUT: %self: Core.IntLiteral = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc23_30: = interface_witness (%Convert.decl) [template = constants.%.10] +// CHECK:STDOUT: %.loc23_30: = interface_witness (%Convert.decl) [template = constants.%.11] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl @@ -352,53 +367,54 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Convert.decl: %Convert.type.5 = fn_decl @Convert.4 [template = constants.%Convert.5] { // CHECK:STDOUT: %self.patt: Core.IntLiteral = binding_pattern self // CHECK:STDOUT: %self.param_patt: Core.IntLiteral = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.3.%.loc27_17.2 [template = Core.IntLiteral] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc28_31.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc28_31.2: type = converted %int.make_type_32, %.loc28_31.1 [template = i32] +// CHECK:STDOUT: %.loc28_31.1: Core.IntLiteral = int_value 32 [template = constants.%.7] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc28_31.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc28_31.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc28_31.3: type = converted %int.make_type_signed, %.loc28_31.2 [template = constants.%i32] // CHECK:STDOUT: %self.param: Core.IntLiteral = value_param runtime_param0 // CHECK:STDOUT: %self: Core.IntLiteral = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc27_38: = interface_witness (%Convert.decl) [template = constants.%.13] +// CHECK:STDOUT: %.loc27_38: = interface_witness (%Convert.decl) [template = constants.%.14] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl // CHECK:STDOUT: witness = %.loc27_38 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: %.loc31_6.2 as %ImplicitAs.type { +// CHECK:STDOUT: impl @impl.4: %.loc31_6.3 as %ImplicitAs.type { // CHECK:STDOUT: %Convert.decl: %Convert.type.7 = fn_decl @Convert.5 [template = constants.%Convert.7] { -// CHECK:STDOUT: %self.patt: i32 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: i32 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %self.patt: %i32 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %i32 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.4.%.loc31_6.2 [template = i32] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.4.%.loc31_6.3 [template = constants.%i32] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc32_42.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc32_42.2: type = converted %int_literal.make_type, %.loc32_42.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %self.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %self: i32 = bind_name self, %self.param +// CHECK:STDOUT: %self.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %self: %i32 = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc31_38: = interface_witness (%Convert.decl) [template = constants.%.16] +// CHECK:STDOUT: %.loc31_38: = interface_witness (%Convert.decl) [template = constants.%.17] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl // CHECK:STDOUT: witness = %.loc31_38 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; -// CHECK:STDOUT: // CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Int(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; +// CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.1(@Add.%Self: %Add.type) { // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: @@ -421,13 +437,13 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: fn[%self.param_patt: @Convert.2.%Self (%Self.3)]() -> @Convert.2.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.2[%self.param_patt: i32](%other.param_patt: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %i32](%other.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.3[%self.param_patt: Core.IntLiteral]() -> i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @Convert.3[%self.param_patt: Core.IntLiteral]() -> %i32 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.4[%self.param_patt: Core.IntLiteral]() -> i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @Convert.4[%self.param_patt: Core.IntLiteral]() -> %i32 = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.5[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn @Convert.5[%self.param_patt: %i32]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.1(constants.%Self.1) { // CHECK:STDOUT: %Self => constants.%Self.1 @@ -475,44 +491,44 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %T.patt.loc15_22.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Op.1(i32) { -// CHECK:STDOUT: %Self => i32 +// CHECK:STDOUT: specific @Op.1(constants.%i32) { +// CHECK:STDOUT: %Self => constants.%i32 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(i32) { -// CHECK:STDOUT: %T.loc11_14.2 => i32 -// CHECK:STDOUT: %T.patt.loc11_14.2 => i32 +// CHECK:STDOUT: specific @As(constants.%i32) { +// CHECK:STDOUT: %T.loc11_14.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc11_14.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type => constants.%As.type.3 // CHECK:STDOUT: %Self.2 => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.4 // CHECK:STDOUT: %Convert => constants.%Convert.4 -// CHECK:STDOUT: %.loc12_32.2 => constants.%.8 -// CHECK:STDOUT: %.loc12_32.3 => constants.%.9 +// CHECK:STDOUT: %.loc12_32.2 => constants.%.9 +// CHECK:STDOUT: %.loc12_32.3 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.1(i32, Core.IntLiteral) { -// CHECK:STDOUT: %T => i32 +// CHECK:STDOUT: specific @Convert.1(constants.%i32, Core.IntLiteral) { +// CHECK:STDOUT: %T => constants.%i32 // CHECK:STDOUT: %As.type => constants.%As.type.3 // CHECK:STDOUT: %Self => Core.IntLiteral // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(i32) { -// CHECK:STDOUT: %T.loc15_22.2 => i32 -// CHECK:STDOUT: %T.patt.loc15_22.2 => i32 +// CHECK:STDOUT: specific @ImplicitAs(constants.%i32) { +// CHECK:STDOUT: %T.loc15_22.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc15_22.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 // CHECK:STDOUT: %Self.2 => constants.%Self.3 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.6 // CHECK:STDOUT: %Convert => constants.%Convert.6 -// CHECK:STDOUT: %.loc16_32.2 => constants.%.11 -// CHECK:STDOUT: %.loc16_32.3 => constants.%.12 +// CHECK:STDOUT: %.loc16_32.2 => constants.%.12 +// CHECK:STDOUT: %.loc16_32.3 => constants.%.13 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(i32, Core.IntLiteral) { -// CHECK:STDOUT: %T => i32 +// CHECK:STDOUT: specific @Convert.2(constants.%i32, Core.IntLiteral) { +// CHECK:STDOUT: %T => constants.%i32 // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 // CHECK:STDOUT: %Self => Core.IntLiteral // CHECK:STDOUT: } @@ -526,22 +542,24 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Self.2 => constants.%Self.3 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.8 // CHECK:STDOUT: %Convert => constants.%Convert.8 -// CHECK:STDOUT: %.loc16_32.2 => constants.%.14 -// CHECK:STDOUT: %.loc16_32.3 => constants.%.15 +// CHECK:STDOUT: %.loc16_32.2 => constants.%.15 +// CHECK:STDOUT: %.loc16_32.3 => constants.%.16 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(Core.IntLiteral, i32) { +// CHECK:STDOUT: specific @Convert.2(Core.IntLiteral, constants.%i32) { // CHECK:STDOUT: %T => Core.IntLiteral // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 -// CHECK:STDOUT: %Self => i32 +// CHECK:STDOUT: %Self => constants.%i32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- user.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%T)> [symbolic] // CHECK:STDOUT: %Self.1: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] @@ -549,103 +567,103 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Self.2: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @As(%T) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.2: type = assoc_entity_type %As.type.2, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, imports.%import_ref.6 [symbolic] -// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(i32) [template] +// CHECK:STDOUT: %.3: type = assoc_entity_type %As.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%i32)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: type = assoc_entity_type %As.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template] -// CHECK:STDOUT: %.6: %.2 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %.5: type = assoc_entity_type %As.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.7: %.3 = assoc_entity element0, imports.%import_ref.7 [symbolic] // CHECK:STDOUT: %Add.type: type = facet_type <@Add> [template] // CHECK:STDOUT: %Self.3: %Add.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic] // CHECK:STDOUT: %Self.4: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Self.5: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2, @ImplicitAs(%T) [symbolic] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic] -// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.3 [symbolic] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.23 [symbolic] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.3 [symbolic] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.23 [symbolic] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [template] -// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.4 [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.24 [template] +// CHECK:STDOUT: %.10: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.4 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.24 [template] // CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.2, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.11: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.5 [template] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.28 [template] +// CHECK:STDOUT: %.12: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.5 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.28 [template] // CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [template] -// CHECK:STDOUT: %.13: = interface_witness (%Convert.6) [template] -// CHECK:STDOUT: %.14: = bound_method %.1, %Convert.6 [template] -// CHECK:STDOUT: %.15: i32 = int_value 1 [template] -// CHECK:STDOUT: %.16: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.17: = bound_method %.16, %Convert.6 [template] -// CHECK:STDOUT: %.18: i32 = int_value 2 [template] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.6) [template] +// CHECK:STDOUT: %.15: = bound_method %.2, %Convert.6 [template] +// CHECK:STDOUT: %.16: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.17: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.18: = bound_method %.17, %Convert.6 [template] +// CHECK:STDOUT: %.19: %i32 = int_value 2 [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %.19: type = assoc_entity_type %Add.type, %Op.type.1 [template] -// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.30 [template] +// CHECK:STDOUT: %.20: type = assoc_entity_type %Add.type, %Op.type.1 [template] +// CHECK:STDOUT: %.21: %.20 = assoc_entity element0, imports.%import_ref.30 [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.21: = interface_witness (%Op.2) [template] -// CHECK:STDOUT: %.22: = bound_method %.15, %Op.2 [template] -// CHECK:STDOUT: %.23: i32 = int_value 3 [template] -// CHECK:STDOUT: %.24: %.7 = assoc_entity element0, imports.%import_ref.32 [symbolic] +// CHECK:STDOUT: %.22: = interface_witness (%Op.2) [template] +// CHECK:STDOUT: %.23: = bound_method %.16, %Op.2 [template] +// CHECK:STDOUT: %.24: %i32 = int_value 3 [template] +// CHECK:STDOUT: %.25: %.8 = assoc_entity element0, imports.%import_ref.32 [symbolic] // CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.4 [template] // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.7) [template] -// CHECK:STDOUT: %.26: = bound_method %.23, %Convert.7 [template] -// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template] -// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %.31: = bound_method %.27, %Convert.6 [template] -// CHECK:STDOUT: %.32: = bound_method %.30, %Convert.6 [template] -// CHECK:STDOUT: %.33: i32 = int_value 4 [template] -// CHECK:STDOUT: %.34: = bound_method %.23, %Op.2 [template] -// CHECK:STDOUT: %.35: i32 = int_value 7 [template] -// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, i32) [template] -// CHECK:STDOUT: %.36: i32 = int_value 0 [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.7) [template] +// CHECK:STDOUT: %.27: = bound_method %.24, %Convert.7 [template] +// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.29: type = array_type %.28, %i32 [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.32: = bound_method %.28, %Convert.6 [template] +// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.6 [template] +// CHECK:STDOUT: %.34: %i32 = int_value 4 [template] +// CHECK:STDOUT: %.35: = bound_method %.24, %Op.2 [template] +// CHECK:STDOUT: %.36: %i32 = int_value 7 [template] +// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, %i32) [template] +// CHECK:STDOUT: %.37: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.5 [template] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [template] -// CHECK:STDOUT: %.37: = interface_witness (%Convert.8) [template] -// CHECK:STDOUT: %.38: = bound_method %.27, %Convert.8 [template] -// CHECK:STDOUT: %.39: = bound_method %.30, %Convert.8 [template] -// CHECK:STDOUT: %array: %.28 = tuple_value (%.23, %.33, %.35) [template] +// CHECK:STDOUT: %.38: = interface_witness (%Convert.8) [template] +// CHECK:STDOUT: %.39: = bound_method %.28, %Convert.8 [template] +// CHECK:STDOUT: %.40: = bound_method %.31, %Convert.8 [template] +// CHECK:STDOUT: %array: %.29 = tuple_value (%.24, %.34, %.36) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .As = %import_ref.2 // CHECK:STDOUT: .Add = %import_ref.29 // CHECK:STDOUT: .ImplicitAs = %import_ref.31 // CHECK:STDOUT: import Core//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst+60, unloaded -// CHECK:STDOUT: %import_ref.4: @As.%.1 (%.2) = import_ref Core//default, inst+82, loaded [symbolic = @As.%.2 (constants.%.6)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//default, inst+75, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//default, inst+75, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Core//default, inst+18, unloaded -// CHECK:STDOUT: %import_ref.9: %.19 = import_ref Core//default, inst+46, loaded [template = constants.%.20] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//default, inst+41, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//default, inst+132, loaded [template = i32] -// CHECK:STDOUT: %import_ref.12: type = import_ref Core//default, inst+133, loaded [template = constants.%Add.type] -// CHECK:STDOUT: %import_ref.13: = import_ref Core//default, inst+153, loaded [template = constants.%.21] -// CHECK:STDOUT: %import_ref.14: type = import_ref Core//default, inst+158, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.15: type = import_ref Core//default, inst+163, loaded [template = constants.%As.type.3] -// CHECK:STDOUT: %import_ref.16: = import_ref Core//default, inst+185, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.17 = import_ref Core//default, inst+100, unloaded -// CHECK:STDOUT: %import_ref.18: @ImplicitAs.%.1 (%.7) = import_ref Core//default, inst+122, loaded [symbolic = @ImplicitAs.%.2 (constants.%.24)] -// CHECK:STDOUT: %import_ref.19 = import_ref Core//default, inst+115, unloaded -// CHECK:STDOUT: %import_ref.20: type = import_ref Core//default, inst+190, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.21: type = import_ref Core//default, inst+195, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.22: = import_ref Core//default, inst+217, loaded [template = constants.%.37] -// CHECK:STDOUT: %import_ref.23 = import_ref Core//default, inst+115, unloaded -// CHECK:STDOUT: %import_ref.25: type = import_ref Core//default, inst+221, loaded [template = i32] -// CHECK:STDOUT: %import_ref.26: type = import_ref Core//default, inst+227, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.27: = import_ref Core//default, inst+250, loaded [template = constants.%.25] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst+68, unloaded +// CHECK:STDOUT: %import_ref.4: @As.%.1 (%.3) = import_ref Core//default, inst+90, loaded [symbolic = @As.%.2 (constants.%.7)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//default, inst+83, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//default, inst+83, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Core//default, inst+26, unloaded +// CHECK:STDOUT: %import_ref.9: %.20 = import_ref Core//default, inst+54, loaded [template = constants.%.21] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//default, inst+49, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref Core//default, inst+143, loaded [template = constants.%i32] +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//default, inst+144, loaded [template = constants.%Add.type] +// CHECK:STDOUT: %import_ref.13: = import_ref Core//default, inst+164, loaded [template = constants.%.22] +// CHECK:STDOUT: %import_ref.14: type = import_ref Core//default, inst+169, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//default, inst+175, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.16: = import_ref Core//default, inst+198, loaded [template = constants.%.14] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//default, inst+108, unloaded +// CHECK:STDOUT: %import_ref.18: @ImplicitAs.%.1 (%.8) = import_ref Core//default, inst+130, loaded [symbolic = @ImplicitAs.%.2 (constants.%.25)] +// CHECK:STDOUT: %import_ref.19 = import_ref Core//default, inst+123, unloaded +// CHECK:STDOUT: %import_ref.20: type = import_ref Core//default, inst+203, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//default, inst+209, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.22: = import_ref Core//default, inst+232, loaded [template = constants.%.38] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//default, inst+123, unloaded +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//default, inst+237, loaded [template = constants.%i32] +// CHECK:STDOUT: %import_ref.26: type = import_ref Core//default, inst+243, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.27: = import_ref Core//default, inst+266, loaded [template = constants.%.26] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -654,40 +672,43 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_17: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32.loc4_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_22.1: type = value_of_initializer %int.make_type_32.loc4_22 [template = i32] -// CHECK:STDOUT: %.loc4_22.2: type = converted %int.make_type_32.loc4_22, %.loc4_22.1 [template = i32] -// CHECK:STDOUT: %.loc4_19.1: %Convert.type.2 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.6] -// CHECK:STDOUT: %.loc4_19.2: = bound_method %.loc4_17, %.loc4_19.1 [template = constants.%.14] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init i32 = call %.loc4_19.2(%.loc4_17) [template = constants.%.15] -// CHECK:STDOUT: %.loc4_19.3: i32 = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.15] -// CHECK:STDOUT: %.loc4_19.4: i32 = converted %.loc4_17, %.loc4_19.3 [template = constants.%.15] -// CHECK:STDOUT: %.loc4_30: Core.IntLiteral = int_value 2 [template = constants.%.16] -// CHECK:STDOUT: %int.make_type_32.loc4_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_35.1: type = value_of_initializer %int.make_type_32.loc4_35 [template = i32] -// CHECK:STDOUT: %.loc4_35.2: type = converted %int.make_type_32.loc4_35, %.loc4_35.1 [template = i32] -// CHECK:STDOUT: %.loc4_32.1: %Convert.type.2 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.6] -// CHECK:STDOUT: %.loc4_32.2: = bound_method %.loc4_30, %.loc4_32.1 [template = constants.%.17] -// CHECK:STDOUT: %int.convert_checked.loc4_32: init i32 = call %.loc4_32.2(%.loc4_30) [template = constants.%.18] -// CHECK:STDOUT: %.loc4_32.3: i32 = value_of_initializer %int.convert_checked.loc4_32 [template = constants.%.18] -// CHECK:STDOUT: %.loc4_32.4: i32 = converted %.loc4_30, %.loc4_32.3 [template = constants.%.18] -// CHECK:STDOUT: %.loc4_27.1: %Op.type.1 = interface_witness_access constants.%.21, element0 [template = constants.%Op.2] -// CHECK:STDOUT: %.loc4_27.2: = bound_method %.loc4_19.4, %.loc4_27.1 [template = constants.%.22] -// CHECK:STDOUT: %int.sadd: init i32 = call %.loc4_27.2(%.loc4_19.4, %.loc4_32.4) [template = constants.%.23] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4_11, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_27.3: %Convert.type.5 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.7] -// CHECK:STDOUT: %.loc4_27.4: = bound_method %int.sadd, %.loc4_27.3 [template = constants.%.26] -// CHECK:STDOUT: %.loc4_27.5: i32 = value_of_initializer %int.sadd [template = constants.%.23] -// CHECK:STDOUT: %.loc4_27.6: i32 = converted %int.sadd, %.loc4_27.5 [template = constants.%.23] -// CHECK:STDOUT: %int.convert_checked.loc4_27: init Core.IntLiteral = call %.loc4_27.4(%.loc4_27.6) [template = constants.%.27] -// CHECK:STDOUT: %.loc4_27.7: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_27 [template = constants.%.27] -// CHECK:STDOUT: %.loc4_27.8: Core.IntLiteral = converted %int.sadd, %.loc4_27.7 [template = constants.%.27] -// CHECK:STDOUT: %.loc4_39: type = array_type %.loc4_27.8, i32 [template = constants.%.28] -// CHECK:STDOUT: %arr.var: ref %.28 = var arr -// CHECK:STDOUT: %arr: ref %.28 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_17: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_22: init type = call constants.%Int(%.loc4_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_22.2: type = value_of_initializer %int.make_type_signed.loc4_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_22.3: type = converted %int.make_type_signed.loc4_22, %.loc4_22.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_19.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.6] +// CHECK:STDOUT: %.loc4_19.2: = bound_method %.loc4_17, %.loc4_19.1 [template = constants.%.15] +// CHECK:STDOUT: %int.convert_checked.loc4_19: init %i32 = call %.loc4_19.2(%.loc4_17) [template = constants.%.16] +// CHECK:STDOUT: %.loc4_19.3: %i32 = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%.16] +// CHECK:STDOUT: %.loc4_19.4: %i32 = converted %.loc4_17, %.loc4_19.3 [template = constants.%.16] +// CHECK:STDOUT: %.loc4_30: Core.IntLiteral = int_value 2 [template = constants.%.17] +// CHECK:STDOUT: %.loc4_35.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_35: init type = call constants.%Int(%.loc4_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_35.2: type = value_of_initializer %int.make_type_signed.loc4_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_35.3: type = converted %int.make_type_signed.loc4_35, %.loc4_35.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_32.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.6] +// CHECK:STDOUT: %.loc4_32.2: = bound_method %.loc4_30, %.loc4_32.1 [template = constants.%.18] +// CHECK:STDOUT: %int.convert_checked.loc4_32: init %i32 = call %.loc4_32.2(%.loc4_30) [template = constants.%.19] +// CHECK:STDOUT: %.loc4_32.3: %i32 = value_of_initializer %int.convert_checked.loc4_32 [template = constants.%.19] +// CHECK:STDOUT: %.loc4_32.4: %i32 = converted %.loc4_30, %.loc4_32.3 [template = constants.%.19] +// CHECK:STDOUT: %.loc4_27.1: %Op.type.1 = interface_witness_access constants.%.22, element0 [template = constants.%Op.2] +// CHECK:STDOUT: %.loc4_27.2: = bound_method %.loc4_19.4, %.loc4_27.1 [template = constants.%.23] +// CHECK:STDOUT: %int.sadd: init %i32 = call %.loc4_27.2(%.loc4_19.4, %.loc4_32.4) [template = constants.%.24] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4_11, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_27.3: %Convert.type.5 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.7] +// CHECK:STDOUT: %.loc4_27.4: = bound_method %int.sadd, %.loc4_27.3 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_27.5: %i32 = value_of_initializer %int.sadd [template = constants.%.24] +// CHECK:STDOUT: %.loc4_27.6: %i32 = converted %int.sadd, %.loc4_27.5 [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc4_27: init Core.IntLiteral = call %.loc4_27.4(%.loc4_27.6) [template = constants.%.28] +// CHECK:STDOUT: %.loc4_27.7: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_27 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_27.8: Core.IntLiteral = converted %int.sadd, %.loc4_27.7 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_39: type = array_type %.loc4_27.8, %i32 [template = constants.%.29] +// CHECK:STDOUT: %arr.var: ref %.29 = var arr +// CHECK:STDOUT: %arr: ref %.29 = bind_name arr, %arr.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @As(constants.%T: type) { @@ -699,8 +720,8 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @As(%T) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.2)] -// CHECK:STDOUT: %.2: @As.%.1 (%.2) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %.2: @As.%.1 (%.3) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -726,8 +747,8 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.5)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @ImplicitAs(%T) [symbolic = %Convert.type (constants.%Convert.type.3)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.3) [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.7) = assoc_entity element0, imports.%import_ref.23 [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.3) [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.8) = assoc_entity element0, imports.%import_ref.23 [symbolic = %.2 (constants.%.9)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -757,7 +778,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: witness = imports.%import_ref.27 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; +// CHECK:STDOUT: fn @Int(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.1(constants.%T: type, constants.%Self.1: @As.%As.type (%As.type.2)) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] @@ -775,7 +796,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: fn[%self.param_patt: @Convert.2.%Self (%Self.5)]() -> @Convert.2.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.3[%self.param_patt: Core.IntLiteral]() -> i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @Convert.3[%self.param_patt: Core.IntLiteral]() -> %i32 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.1(constants.%Self.3: %Add.type) { // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.3)] @@ -783,57 +804,59 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self (%Self.3)](%other.param_patt: @Op.1.%Self (%Self.3)) -> @Op.1.%Self (%Self.3); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.2[%self.param_patt: i32](%other.param_patt: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %i32](%other.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.4[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn @Convert.4[%self.param_patt: %i32]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.5[%self.param_patt: Core.IntLiteral]() -> i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @Convert.5[%self.param_patt: Core.IntLiteral]() -> %i32 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc4_44: Core.IntLiteral = int_value 3 [template = constants.%.27] -// CHECK:STDOUT: %.loc4_47: Core.IntLiteral = int_value 4 [template = constants.%.30] -// CHECK:STDOUT: %.loc4_51: Core.IntLiteral = int_value 3 [template = constants.%.27] -// CHECK:STDOUT: %int.make_type_32.loc4_56: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_56.1: type = value_of_initializer %int.make_type_32.loc4_56 [template = i32] -// CHECK:STDOUT: %.loc4_56.2: type = converted %int.make_type_32.loc4_56, %.loc4_56.1 [template = i32] -// CHECK:STDOUT: %.loc4_53.1: %Convert.type.2 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.6] -// CHECK:STDOUT: %.loc4_53.2: = bound_method %.loc4_51, %.loc4_53.1 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc4_53: init i32 = call %.loc4_53.2(%.loc4_51) [template = constants.%.23] -// CHECK:STDOUT: %.loc4_53.3: i32 = value_of_initializer %int.convert_checked.loc4_53 [template = constants.%.23] -// CHECK:STDOUT: %.loc4_53.4: i32 = converted %.loc4_51, %.loc4_53.3 [template = constants.%.23] -// CHECK:STDOUT: %.loc4_64: Core.IntLiteral = int_value 4 [template = constants.%.30] -// CHECK:STDOUT: %int.make_type_32.loc4_69: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_69.1: type = value_of_initializer %int.make_type_32.loc4_69 [template = i32] -// CHECK:STDOUT: %.loc4_69.2: type = converted %int.make_type_32.loc4_69, %.loc4_69.1 [template = i32] -// CHECK:STDOUT: %.loc4_66.1: %Convert.type.2 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.6] -// CHECK:STDOUT: %.loc4_66.2: = bound_method %.loc4_64, %.loc4_66.1 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc4_66: init i32 = call %.loc4_66.2(%.loc4_64) [template = constants.%.33] -// CHECK:STDOUT: %.loc4_66.3: i32 = value_of_initializer %int.convert_checked.loc4_66 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_66.4: i32 = converted %.loc4_64, %.loc4_66.3 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_61.1: %Op.type.1 = interface_witness_access constants.%.21, element0 [template = constants.%Op.2] -// CHECK:STDOUT: %.loc4_61.2: = bound_method %.loc4_53.4, %.loc4_61.1 [template = constants.%.34] -// CHECK:STDOUT: %int.sadd: init i32 = call %.loc4_61.2(%.loc4_53.4, %.loc4_66.4) [template = constants.%.35] +// CHECK:STDOUT: %.loc4_44: Core.IntLiteral = int_value 3 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_47: Core.IntLiteral = int_value 4 [template = constants.%.31] +// CHECK:STDOUT: %.loc4_51: Core.IntLiteral = int_value 3 [template = constants.%.28] +// CHECK:STDOUT: %.loc4_56.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_56: init type = call constants.%Int(%.loc4_56.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_56.2: type = value_of_initializer %int.make_type_signed.loc4_56 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_56.3: type = converted %int.make_type_signed.loc4_56, %.loc4_56.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_53.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.6] +// CHECK:STDOUT: %.loc4_53.2: = bound_method %.loc4_51, %.loc4_53.1 [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc4_53: init %i32 = call %.loc4_53.2(%.loc4_51) [template = constants.%.24] +// CHECK:STDOUT: %.loc4_53.3: %i32 = value_of_initializer %int.convert_checked.loc4_53 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_53.4: %i32 = converted %.loc4_51, %.loc4_53.3 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_64: Core.IntLiteral = int_value 4 [template = constants.%.31] +// CHECK:STDOUT: %.loc4_69.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_69: init type = call constants.%Int(%.loc4_69.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_69.2: type = value_of_initializer %int.make_type_signed.loc4_69 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_69.3: type = converted %int.make_type_signed.loc4_69, %.loc4_69.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_66.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.6] +// CHECK:STDOUT: %.loc4_66.2: = bound_method %.loc4_64, %.loc4_66.1 [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc4_66: init %i32 = call %.loc4_66.2(%.loc4_64) [template = constants.%.34] +// CHECK:STDOUT: %.loc4_66.3: %i32 = value_of_initializer %int.convert_checked.loc4_66 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_66.4: %i32 = converted %.loc4_64, %.loc4_66.3 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_61.1: %Op.type.1 = interface_witness_access constants.%.22, element0 [template = constants.%Op.2] +// CHECK:STDOUT: %.loc4_61.2: = bound_method %.loc4_53.4, %.loc4_61.1 [template = constants.%.35] +// CHECK:STDOUT: %int.sadd: init %i32 = call %.loc4_61.2(%.loc4_53.4, %.loc4_66.4) [template = constants.%.36] // CHECK:STDOUT: %.loc4_73.1: %tuple.type = tuple_literal (%.loc4_44, %.loc4_47, %int.sadd) -// CHECK:STDOUT: %.loc4_73.2: %Convert.type.4 = interface_witness_access constants.%.37, element0 [template = constants.%Convert.8] -// CHECK:STDOUT: %.loc4_73.3: = bound_method %.loc4_44, %.loc4_73.2 [template = constants.%.38] -// CHECK:STDOUT: %int.convert_checked.loc4_73.1: init i32 = call %.loc4_73.3(%.loc4_44) [template = constants.%.23] -// CHECK:STDOUT: %.loc4_73.4: init i32 = converted %.loc4_44, %int.convert_checked.loc4_73.1 [template = constants.%.23] -// CHECK:STDOUT: %.loc4_73.5: i32 = int_value 0 [template = constants.%.36] -// CHECK:STDOUT: %.loc4_73.6: ref i32 = array_index file.%arr.var, %.loc4_73.5 -// CHECK:STDOUT: %.loc4_73.7: init i32 = initialize_from %.loc4_73.4 to %.loc4_73.6 [template = constants.%.23] -// CHECK:STDOUT: %.loc4_73.8: %Convert.type.4 = interface_witness_access constants.%.37, element0 [template = constants.%Convert.8] -// CHECK:STDOUT: %.loc4_73.9: = bound_method %.loc4_47, %.loc4_73.8 [template = constants.%.39] -// CHECK:STDOUT: %int.convert_checked.loc4_73.2: init i32 = call %.loc4_73.9(%.loc4_47) [template = constants.%.33] -// CHECK:STDOUT: %.loc4_73.10: init i32 = converted %.loc4_47, %int.convert_checked.loc4_73.2 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_73.11: i32 = int_value 1 [template = constants.%.15] -// CHECK:STDOUT: %.loc4_73.12: ref i32 = array_index file.%arr.var, %.loc4_73.11 -// CHECK:STDOUT: %.loc4_73.13: init i32 = initialize_from %.loc4_73.10 to %.loc4_73.12 [template = constants.%.33] -// CHECK:STDOUT: %.loc4_73.14: i32 = int_value 2 [template = constants.%.18] -// CHECK:STDOUT: %.loc4_73.15: ref i32 = array_index file.%arr.var, %.loc4_73.14 -// CHECK:STDOUT: %.loc4_73.16: init i32 = initialize_from %int.sadd to %.loc4_73.15 [template = constants.%.35] -// CHECK:STDOUT: %.loc4_73.17: init %.28 = array_init (%.loc4_73.7, %.loc4_73.13, %.loc4_73.16) to file.%arr.var [template = constants.%array] -// CHECK:STDOUT: %.loc4_74: init %.28 = converted %.loc4_73.1, %.loc4_73.17 [template = constants.%array] +// CHECK:STDOUT: %.loc4_73.2: %Convert.type.4 = interface_witness_access constants.%.38, element0 [template = constants.%Convert.8] +// CHECK:STDOUT: %.loc4_73.3: = bound_method %.loc4_44, %.loc4_73.2 [template = constants.%.39] +// CHECK:STDOUT: %int.convert_checked.loc4_73.1: init %i32 = call %.loc4_73.3(%.loc4_44) [template = constants.%.24] +// CHECK:STDOUT: %.loc4_73.4: init %i32 = converted %.loc4_44, %int.convert_checked.loc4_73.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_73.5: Core.IntLiteral = int_value 0 [template = constants.%.37] +// CHECK:STDOUT: %.loc4_73.6: ref %i32 = array_index file.%arr.var, %.loc4_73.5 +// CHECK:STDOUT: %.loc4_73.7: init %i32 = initialize_from %.loc4_73.4 to %.loc4_73.6 [template = constants.%.24] +// CHECK:STDOUT: %.loc4_73.8: %Convert.type.4 = interface_witness_access constants.%.38, element0 [template = constants.%Convert.8] +// CHECK:STDOUT: %.loc4_73.9: = bound_method %.loc4_47, %.loc4_73.8 [template = constants.%.40] +// CHECK:STDOUT: %int.convert_checked.loc4_73.2: init %i32 = call %.loc4_73.9(%.loc4_47) [template = constants.%.34] +// CHECK:STDOUT: %.loc4_73.10: init %i32 = converted %.loc4_47, %int.convert_checked.loc4_73.2 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_73.11: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_73.12: ref %i32 = array_index file.%arr.var, %.loc4_73.11 +// CHECK:STDOUT: %.loc4_73.13: init %i32 = initialize_from %.loc4_73.10 to %.loc4_73.12 [template = constants.%.34] +// CHECK:STDOUT: %.loc4_73.14: Core.IntLiteral = int_value 2 [template = constants.%.17] +// CHECK:STDOUT: %.loc4_73.15: ref %i32 = array_index file.%arr.var, %.loc4_73.14 +// CHECK:STDOUT: %.loc4_73.16: init %i32 = initialize_from %int.sadd to %.loc4_73.15 [template = constants.%.36] +// CHECK:STDOUT: %.loc4_73.17: init %.29 = array_init (%.loc4_73.7, %.loc4_73.13, %.loc4_73.16) to file.%arr.var [template = constants.%array] +// CHECK:STDOUT: %.loc4_74: init %.29 = converted %.loc4_73.1, %.loc4_73.17 [template = constants.%array] // CHECK:STDOUT: assign file.%arr.var, %.loc4_74 // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -859,17 +882,17 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(i32) { -// CHECK:STDOUT: %T => i32 -// CHECK:STDOUT: %T.patt => i32 +// CHECK:STDOUT: specific @As(constants.%i32) { +// CHECK:STDOUT: %T => constants.%i32 +// CHECK:STDOUT: %T.patt => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type => constants.%As.type.3 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.1 => constants.%.4 -// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.2 => constants.%.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%T) { @@ -877,17 +900,17 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(i32) { -// CHECK:STDOUT: %T => i32 -// CHECK:STDOUT: %T.patt => i32 +// CHECK:STDOUT: specific @ImplicitAs(constants.%i32) { +// CHECK:STDOUT: %T => constants.%i32 +// CHECK:STDOUT: %T.patt => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 // CHECK:STDOUT: %Self => constants.%Self.5 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.4 // CHECK:STDOUT: %Convert => constants.%Convert.4 -// CHECK:STDOUT: %.1 => constants.%.9 -// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %.2 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(%T) { @@ -915,8 +938,8 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Self => constants.%Self.5 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5 // CHECK:STDOUT: %Convert => constants.%Convert.5 -// CHECK:STDOUT: %.1 => constants.%.11 -// CHECK:STDOUT: %.2 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.2 => constants.%.13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.1(constants.%Self.3) { diff --git a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon index 6e738d6786cf..7e0c2e20975d 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon @@ -12,12 +12,14 @@ package Core library "[[@TEST_NAME]]"; -fn Int32() -> type = "int.make_type_32"; -fn TestAdd(a: i32, b: i32) -> i32 = "int.sadd"; fn IntLiteral() -> type = "int_literal.make_type"; -fn AsIntLiteral(a: i32) -> IntLiteral() = "int.convert_checked"; +fn Int(N: IntLiteral()) -> type = "int.make_type_signed"; + fn AsI32(a: IntLiteral()) -> i32 = "int.convert_checked"; +fn AsIntLiteral(a: i32) -> IntLiteral() = "int.convert_checked"; + +fn TestAdd(a: i32, b: i32) -> i32 = "int.sadd"; // --- use.carbon @@ -28,56 +30,27 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: --- core.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %TestAdd.type: type = fn_type @TestAdd [template] -// CHECK:STDOUT: %TestAdd: %TestAdd.type = struct_value () [template] // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] -// CHECK:STDOUT: %AsIntLiteral.type: type = fn_type @AsIntLiteral [template] -// CHECK:STDOUT: %AsIntLiteral: %AsIntLiteral.type = struct_value () [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %AsI32.type: type = fn_type @AsI32 [template] // CHECK:STDOUT: %AsI32: %AsI32.type = struct_value () [template] +// CHECK:STDOUT: %AsIntLiteral.type: type = fn_type @AsIntLiteral [template] +// CHECK:STDOUT: %AsIntLiteral: %AsIntLiteral.type = struct_value () [template] +// CHECK:STDOUT: %TestAdd.type: type = fn_type @TestAdd [template] +// CHECK:STDOUT: %TestAdd: %TestAdd.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int32 = %Int32.decl -// CHECK:STDOUT: .TestAdd = %TestAdd.decl // CHECK:STDOUT: .IntLiteral = %IntLiteral.decl -// CHECK:STDOUT: .AsIntLiteral = %AsIntLiteral.decl +// CHECK:STDOUT: .Int = %Int.decl // CHECK:STDOUT: .AsI32 = %AsI32.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] { -// CHECK:STDOUT: %return.patt: type = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 -// CHECK:STDOUT: %return: ref type = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %TestAdd.decl: %TestAdd.type = fn_decl @TestAdd [template = constants.%TestAdd] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc5_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_15.1: type = value_of_initializer %int.make_type_32.loc5_15 [template = i32] -// CHECK:STDOUT: %.loc5_15.2: type = converted %int.make_type_32.loc5_15, %.loc5_15.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_23.1: type = value_of_initializer %int.make_type_32.loc5_23 [template = i32] -// CHECK:STDOUT: %.loc5_23.2: type = converted %int.make_type_32.loc5_23, %.loc5_23.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_31: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_31.1: type = value_of_initializer %int.make_type_32.loc5_31 [template = i32] -// CHECK:STDOUT: %.loc5_31.2: type = converted %int.make_type_32.loc5_31, %.loc5_31.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: .AsIntLiteral = %AsIntLiteral.decl +// CHECK:STDOUT: .TestAdd = %TestAdd.decl // CHECK:STDOUT: } // CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] { // CHECK:STDOUT: %return.patt: type = return_slot_pattern @@ -86,88 +59,134 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 // CHECK:STDOUT: %return: ref type = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %AsIntLiteral.decl: %AsIntLiteral.type = fn_decl @AsIntLiteral [template = constants.%AsIntLiteral] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] { +// CHECK:STDOUT: %N.patt: Core.IntLiteral = binding_pattern N +// CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: type = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_20.2: type = converted %int.make_type_32, %.loc8_20.1 [template = i32] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_39.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_39.2: type = converted %int_literal.make_type, %.loc8_39.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 -// CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param +// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc6_22.2: type = converted %int_literal.make_type, %.loc6_22.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %N: Core.IntLiteral = bind_name N, %N.param +// CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 +// CHECK:STDOUT: %return: ref type = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %AsI32.decl: %AsI32.type = fn_decl @AsI32 [template = constants.%AsI32] { // CHECK:STDOUT: %a.patt: Core.IntLiteral = binding_pattern a // CHECK:STDOUT: %a.param_patt: Core.IntLiteral = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc9_24.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc9_24.2: type = converted %int_literal.make_type, %.loc9_24.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_30.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc9_30.2: type = converted %int.make_type_32, %.loc9_30.1 [template = i32] +// CHECK:STDOUT: %.loc8_24.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc8_24.2: type = converted %int_literal.make_type, %.loc8_24.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc8_30.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_30.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_30.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_30.3: type = converted %int.make_type_signed, %.loc8_30.2 [template = constants.%i32] // CHECK:STDOUT: %a.param: Core.IntLiteral = value_param runtime_param0 // CHECK:STDOUT: %a: Core.IntLiteral = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %AsIntLiteral.decl: %AsIntLiteral.type = fn_decl @AsIntLiteral [template = constants.%AsIntLiteral] { +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %.loc9_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc9_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc9_20.3: type = converted %int.make_type_signed, %.loc9_20.2 [template = constants.%i32] +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc9_39.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc9_39.2: type = converted %int_literal.make_type, %.loc9_39.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 +// CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %TestAdd.decl: %TestAdd.type = fn_decl @TestAdd [template = constants.%TestAdd] { +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %.loc11_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_15: init type = call constants.%Int(%.loc11_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_15.2: type = value_of_initializer %int.make_type_signed.loc11_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_15.3: type = converted %int.make_type_signed.loc11_15, %.loc11_15.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_23: init type = call constants.%Int(%.loc11_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_23.2: type = value_of_initializer %int.make_type_signed.loc11_23 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_23.3: type = converted %int.make_type_signed.loc11_23, %.loc11_23.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_31.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_31: init type = call constants.%Int(%.loc11_31.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_31.2: type = value_of_initializer %int.make_type_signed.loc11_31 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_31.3: type = converted %int.make_type_signed.loc11_31, %.loc11_31.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAdd(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; -// CHECK:STDOUT: // CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AsIntLiteral(%a.param_patt: i32) -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn @Int(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AsI32(%a.param_patt: Core.IntLiteral) -> i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @AsI32(%a.param_patt: Core.IntLiteral) -> %i32 = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @AsIntLiteral(%a.param_patt: %i32) -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @TestAdd(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: --- use.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %AsIntLiteral.type: type = fn_type @AsIntLiteral [template] // CHECK:STDOUT: %AsIntLiteral: %AsIntLiteral.type = struct_value () [template] // CHECK:STDOUT: %TestAdd.type: type = fn_type @TestAdd [template] // CHECK:STDOUT: %TestAdd: %TestAdd.type = struct_value () [template] // CHECK:STDOUT: %AsI32.type: type = fn_type @AsI32 [template] // CHECK:STDOUT: %AsI32: %AsI32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: i32 = int_value 1 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.4: i32 = int_value 2 [template] -// CHECK:STDOUT: %.5: i32 = int_value 3 [template] -// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.7: type = array_type %.6, i32 [template] -// CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, i32) [template] -// CHECK:STDOUT: %.9: i32 = int_value 0 [template] -// CHECK:STDOUT: %array: %.7 = tuple_value (%.2, %.4, %.5) [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.5: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.6: %i32 = int_value 3 [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.8: type = array_type %.7, %i32 [template] +// CHECK:STDOUT: %tuple.type: type = tuple_type (%i32, %i32, %i32) [template] +// CHECK:STDOUT: %.10: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %array: %.8 = tuple_value (%.3, %.5, %.6) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .AsIntLiteral = %import_ref.2 // CHECK:STDOUT: .TestAdd = %import_ref.3 // CHECK:STDOUT: .AsI32 = %import_ref.4 // CHECK:STDOUT: import Core//core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %AsIntLiteral.type = import_ref Core//core, inst+55, loaded [template = constants.%AsIntLiteral] -// CHECK:STDOUT: %import_ref.3: %TestAdd.type = import_ref Core//core, inst+30, loaded [template = constants.%TestAdd] -// CHECK:STDOUT: %import_ref.4: %AsI32.type = import_ref Core//core, inst+73, loaded [template = constants.%AsI32] +// CHECK:STDOUT: %import_ref.2: %AsIntLiteral.type = import_ref Core//core, inst+61, loaded [template = constants.%AsIntLiteral] +// CHECK:STDOUT: %import_ref.3: %TestAdd.type = import_ref Core//core, inst+88, loaded [template = constants.%TestAdd] +// CHECK:STDOUT: %import_ref.4: %AsI32.type = import_ref Core//core, inst+42, loaded [template = constants.%AsI32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -176,70 +195,71 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] // CHECK:STDOUT: %Core.ref.loc4_16: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AsIntLiteral.ref: %AsIntLiteral.type = name_ref AsIntLiteral, imports.%import_ref.2 [template = constants.%AsIntLiteral] // CHECK:STDOUT: %Core.ref.loc4_34: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %TestAdd.ref: %TestAdd.type = name_ref TestAdd, imports.%import_ref.3 [template = constants.%TestAdd] // CHECK:STDOUT: %Core.ref.loc4_47: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AsI32.ref.loc4_51: %AsI32.type = name_ref AsI32, imports.%import_ref.4 [template = constants.%AsI32] -// CHECK:STDOUT: %.loc4_58: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %int.convert_checked.loc4_57: init i32 = call %AsI32.ref.loc4_51(%.loc4_58) [template = constants.%.2] +// CHECK:STDOUT: %.loc4_58: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %int.convert_checked.loc4_57: init %i32 = call %AsI32.ref.loc4_51(%.loc4_58) [template = constants.%.3] // CHECK:STDOUT: %Core.ref.loc4_62: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AsI32.ref.loc4_66: %AsI32.type = name_ref AsI32, imports.%import_ref.4 [template = constants.%AsI32] -// CHECK:STDOUT: %.loc4_73: Core.IntLiteral = int_value 2 [template = constants.%.3] -// CHECK:STDOUT: %int.convert_checked.loc4_72: init i32 = call %AsI32.ref.loc4_66(%.loc4_73) [template = constants.%.4] -// CHECK:STDOUT: %.loc4_57.1: i32 = value_of_initializer %int.convert_checked.loc4_57 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_57.2: i32 = converted %int.convert_checked.loc4_57, %.loc4_57.1 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_72.1: i32 = value_of_initializer %int.convert_checked.loc4_72 [template = constants.%.4] -// CHECK:STDOUT: %.loc4_72.2: i32 = converted %int.convert_checked.loc4_72, %.loc4_72.1 [template = constants.%.4] -// CHECK:STDOUT: %int.sadd: init i32 = call %TestAdd.ref(%.loc4_57.2, %.loc4_72.2) [template = constants.%.5] -// CHECK:STDOUT: %.loc4_46.1: i32 = value_of_initializer %int.sadd [template = constants.%.5] -// CHECK:STDOUT: %.loc4_46.2: i32 = converted %int.sadd, %.loc4_46.1 [template = constants.%.5] -// CHECK:STDOUT: %int.convert_checked.loc4_33: init Core.IntLiteral = call %AsIntLiteral.ref(%.loc4_46.2) [template = constants.%.6] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_33.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_33 [template = constants.%.6] -// CHECK:STDOUT: %.loc4_33.2: Core.IntLiteral = converted %int.convert_checked.loc4_33, %.loc4_33.1 [template = constants.%.6] -// CHECK:STDOUT: %.loc4_77: type = array_type %.loc4_33.2, i32 [template = constants.%.7] -// CHECK:STDOUT: %arr.var: ref %.7 = var arr -// CHECK:STDOUT: %arr: ref %.7 = bind_name arr, %arr.var +// CHECK:STDOUT: %.loc4_73: Core.IntLiteral = int_value 2 [template = constants.%.4] +// CHECK:STDOUT: %int.convert_checked.loc4_72: init %i32 = call %AsI32.ref.loc4_66(%.loc4_73) [template = constants.%.5] +// CHECK:STDOUT: %.loc4_57.1: %i32 = value_of_initializer %int.convert_checked.loc4_57 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_57.2: %i32 = converted %int.convert_checked.loc4_57, %.loc4_57.1 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_72.1: %i32 = value_of_initializer %int.convert_checked.loc4_72 [template = constants.%.5] +// CHECK:STDOUT: %.loc4_72.2: %i32 = converted %int.convert_checked.loc4_72, %.loc4_72.1 [template = constants.%.5] +// CHECK:STDOUT: %int.sadd: init %i32 = call %TestAdd.ref(%.loc4_57.2, %.loc4_72.2) [template = constants.%.6] +// CHECK:STDOUT: %.loc4_46.1: %i32 = value_of_initializer %int.sadd [template = constants.%.6] +// CHECK:STDOUT: %.loc4_46.2: %i32 = converted %int.sadd, %.loc4_46.1 [template = constants.%.6] +// CHECK:STDOUT: %int.convert_checked.loc4_33: init Core.IntLiteral = call %AsIntLiteral.ref(%.loc4_46.2) [template = constants.%.7] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_33.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_33 [template = constants.%.7] +// CHECK:STDOUT: %.loc4_33.2: Core.IntLiteral = converted %int.convert_checked.loc4_33, %.loc4_33.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc4_77: type = array_type %.loc4_33.2, %i32 [template = constants.%.8] +// CHECK:STDOUT: %arr.var: ref %.8 = var arr +// CHECK:STDOUT: %arr: ref %.8 = bind_name arr, %arr.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; +// CHECK:STDOUT: fn @Int(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AsIntLiteral(%a.param_patt: i32) -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn @AsIntLiteral(%a.param_patt: %i32) -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAdd(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn @TestAdd(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AsI32(%a.param_patt: Core.IntLiteral) -> i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @AsI32(%a.param_patt: Core.IntLiteral) -> %i32 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Core.ref.loc4_82: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AsI32.ref.loc4_86: %AsI32.type = name_ref AsI32, imports.%import_ref.4 [template = constants.%AsI32] -// CHECK:STDOUT: %.loc4_93: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %int.convert_checked.loc4_92: init i32 = call %AsI32.ref.loc4_86(%.loc4_93) [template = constants.%.2] +// CHECK:STDOUT: %.loc4_93: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %int.convert_checked.loc4_92: init %i32 = call %AsI32.ref.loc4_86(%.loc4_93) [template = constants.%.3] // CHECK:STDOUT: %Core.ref.loc4_97: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AsI32.ref.loc4_101: %AsI32.type = name_ref AsI32, imports.%import_ref.4 [template = constants.%AsI32] -// CHECK:STDOUT: %.loc4_108: Core.IntLiteral = int_value 2 [template = constants.%.3] -// CHECK:STDOUT: %int.convert_checked.loc4_107: init i32 = call %AsI32.ref.loc4_101(%.loc4_108) [template = constants.%.4] +// CHECK:STDOUT: %.loc4_108: Core.IntLiteral = int_value 2 [template = constants.%.4] +// CHECK:STDOUT: %int.convert_checked.loc4_107: init %i32 = call %AsI32.ref.loc4_101(%.loc4_108) [template = constants.%.5] // CHECK:STDOUT: %Core.ref.loc4_112: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AsI32.ref.loc4_116: %AsI32.type = name_ref AsI32, imports.%import_ref.4 [template = constants.%AsI32] -// CHECK:STDOUT: %.loc4_123: Core.IntLiteral = int_value 3 [template = constants.%.6] -// CHECK:STDOUT: %int.convert_checked.loc4_122: init i32 = call %AsI32.ref.loc4_116(%.loc4_123) [template = constants.%.5] +// CHECK:STDOUT: %.loc4_123: Core.IntLiteral = int_value 3 [template = constants.%.7] +// CHECK:STDOUT: %int.convert_checked.loc4_122: init %i32 = call %AsI32.ref.loc4_116(%.loc4_123) [template = constants.%.6] // CHECK:STDOUT: %.loc4_125.1: %tuple.type = tuple_literal (%int.convert_checked.loc4_92, %int.convert_checked.loc4_107, %int.convert_checked.loc4_122) -// CHECK:STDOUT: %.loc4_125.2: i32 = int_value 0 [template = constants.%.9] -// CHECK:STDOUT: %.loc4_125.3: ref i32 = array_index file.%arr.var, %.loc4_125.2 -// CHECK:STDOUT: %.loc4_125.4: init i32 = initialize_from %int.convert_checked.loc4_92 to %.loc4_125.3 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_125.5: i32 = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_125.6: ref i32 = array_index file.%arr.var, %.loc4_125.5 -// CHECK:STDOUT: %.loc4_125.7: init i32 = initialize_from %int.convert_checked.loc4_107 to %.loc4_125.6 [template = constants.%.4] -// CHECK:STDOUT: %.loc4_125.8: i32 = int_value 2 [template = constants.%.4] -// CHECK:STDOUT: %.loc4_125.9: ref i32 = array_index file.%arr.var, %.loc4_125.8 -// CHECK:STDOUT: %.loc4_125.10: init i32 = initialize_from %int.convert_checked.loc4_122 to %.loc4_125.9 [template = constants.%.5] -// CHECK:STDOUT: %.loc4_125.11: init %.7 = array_init (%.loc4_125.4, %.loc4_125.7, %.loc4_125.10) to file.%arr.var [template = constants.%array] -// CHECK:STDOUT: %.loc4_126: init %.7 = converted %.loc4_125.1, %.loc4_125.11 [template = constants.%array] +// CHECK:STDOUT: %.loc4_125.2: Core.IntLiteral = int_value 0 [template = constants.%.10] +// CHECK:STDOUT: %.loc4_125.3: ref %i32 = array_index file.%arr.var, %.loc4_125.2 +// CHECK:STDOUT: %.loc4_125.4: init %i32 = initialize_from %int.convert_checked.loc4_92 to %.loc4_125.3 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_125.5: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_125.6: ref %i32 = array_index file.%arr.var, %.loc4_125.5 +// CHECK:STDOUT: %.loc4_125.7: init %i32 = initialize_from %int.convert_checked.loc4_107 to %.loc4_125.6 [template = constants.%.5] +// CHECK:STDOUT: %.loc4_125.8: Core.IntLiteral = int_value 2 [template = constants.%.4] +// CHECK:STDOUT: %.loc4_125.9: ref %i32 = array_index file.%arr.var, %.loc4_125.8 +// CHECK:STDOUT: %.loc4_125.10: init %i32 = initialize_from %int.convert_checked.loc4_122 to %.loc4_125.9 [template = constants.%.6] +// CHECK:STDOUT: %.loc4_125.11: init %.8 = array_init (%.loc4_125.4, %.loc4_125.7, %.loc4_125.10) to file.%arr.var [template = constants.%array] +// CHECK:STDOUT: %.loc4_126: init %.8 = converted %.loc4_125.1, %.loc4_125.11 [template = constants.%array] // CHECK:STDOUT: assign file.%arr.var, %.loc4_126 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/fail_not_callable.carbon b/toolchain/check/testdata/function/call/fail_not_callable.carbon index 3161e003c22e..27185323d772 100644 --- a/toolchain/check/testdata/function/call/fail_not_callable.carbon +++ b/toolchain/check/testdata/function/call/fail_not_callable.carbon @@ -20,14 +20,16 @@ fn Run() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.2: String = string_literal "hello" [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.3: String = string_literal "hello" [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -44,12 +46,13 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_10.2: type = converted %int.make_type_32, %.loc15_10.1 [template = i32] -// CHECK:STDOUT: %x.var: ref i32 = var x -// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var -// CHECK:STDOUT: %.loc15_16: String = string_literal "hello" [template = constants.%.2] +// CHECK:STDOUT: %.loc15_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_10.3: type = converted %int.make_type_signed, %.loc15_10.2 [template = constants.%i32] +// CHECK:STDOUT: %x.var: ref %i32 = var x +// CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var +// CHECK:STDOUT: %.loc15_16: String = string_literal "hello" [template = constants.%.3] // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/fail_param_count.carbon b/toolchain/check/testdata/function/call/fail_param_count.carbon index c7c774cbc59c..4ccfca6e199d 100644 --- a/toolchain/check/testdata/function/call/fail_param_count.carbon +++ b/toolchain/check/testdata/function/call/fail_param_count.carbon @@ -69,21 +69,23 @@ fn Main() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Run0.type: type = fn_type @Run0 [template] // CHECK:STDOUT: %Run0: %Run0.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Run1.type: type = fn_type @Run1 [template] // CHECK:STDOUT: %Run1: %Run1.type = struct_value () [template] // CHECK:STDOUT: %Run2.type: type = fn_type @Run2 [template] // CHECK:STDOUT: %Run2: %Run2.type = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -100,31 +102,34 @@ fn Main() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Run0.decl: %Run0.type = fn_decl @Run0 [template = constants.%Run0] {} {} // CHECK:STDOUT: %Run1.decl: %Run1.type = fn_decl @Run1 [template = constants.%Run1] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_12.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_12.2: type = converted %int.make_type_32, %.loc12_12.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %.loc12_12.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_12.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_12.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_12.3: type = converted %int.make_type_signed, %.loc12_12.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %Run2.decl: %Run2.type = fn_decl @Run2 [template = constants.%Run2] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc13_12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_12.1: type = value_of_initializer %int.make_type_32.loc13_12 [template = i32] -// CHECK:STDOUT: %.loc13_12.2: type = converted %int.make_type_32.loc13_12, %.loc13_12.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_20.1: type = value_of_initializer %int.make_type_32.loc13_20 [template = i32] -// CHECK:STDOUT: %.loc13_20.2: type = converted %int.make_type_32.loc13_20, %.loc13_20.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %.loc13_12.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_12: init type = call constants.%Int(%.loc13_12.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_12.2: type = value_of_initializer %int.make_type_signed.loc13_12 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_12.3: type = converted %int.make_type_signed.loc13_12, %.loc13_12.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13_20: init type = call constants.%Int(%.loc13_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_20.2: type = value_of_initializer %int.make_type_signed.loc13_20 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_20.3: type = converted %int.make_type_signed.loc13_20, %.loc13_20.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } @@ -134,12 +139,12 @@ fn Main() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Run1(%a.param_patt: i32) { +// CHECK:STDOUT: fn @Run1(%a.param_patt: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Run2(%a.param_patt: i32, %b.param_patt: i32) { +// CHECK:STDOUT: fn @Run2(%a.param_patt: %i32, %b.param_patt: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -147,17 +152,17 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Run0.ref.loc23: %Run0.type = name_ref Run0, file.%Run0.decl [template = constants.%Run0] -// CHECK:STDOUT: %.loc23: Core.IntLiteral = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc23: Core.IntLiteral = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %Run0.ref.loc31: %Run0.type = name_ref Run0, file.%Run0.decl [template = constants.%Run0] -// CHECK:STDOUT: %.loc31_8: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc31_11: Core.IntLiteral = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc31_8: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc31_11: Core.IntLiteral = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %Run1.ref.loc40: %Run1.type = name_ref Run1, file.%Run1.decl [template = constants.%Run1] // CHECK:STDOUT: %Run1.ref.loc48: %Run1.type = name_ref Run1, file.%Run1.decl [template = constants.%Run1] -// CHECK:STDOUT: %.loc48_8: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc48_11: Core.IntLiteral = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc48_8: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc48_11: Core.IntLiteral = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %Run2.ref.loc57: %Run2.type = name_ref Run2, file.%Run2.decl [template = constants.%Run2] // CHECK:STDOUT: %Run2.ref.loc64: %Run2.type = name_ref Run2, file.%Run2.decl [template = constants.%Run2] -// CHECK:STDOUT: %.loc64: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc64: Core.IntLiteral = int_value 0 [template = constants.%.3] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index e809294d3896..ad483128ee2a 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -26,19 +26,21 @@ fn F() { // CHECK:STDOUT: --- fail_param_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: f64 = float_literal 1 [template] +// CHECK:STDOUT: %.2: f64 = float_literal 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -53,19 +55,20 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %.loc11_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.3: type = converted %int.make_type_signed, %.loc11_9.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%a.param_patt: i32) { +// CHECK:STDOUT: fn @G(%a.param_patt: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -73,8 +76,8 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [template = constants.%G] -// CHECK:STDOUT: %.loc23_5.1: f64 = float_literal 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc23_5.2: i32 = converted %.loc23_5.1, [template = ] +// CHECK:STDOUT: %.loc23_5.1: f64 = float_literal 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc23_5.2: %i32 = converted %.loc23_5.1, [template = ] // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon index 63341c9cf42b..7be16a2f30fc 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -31,14 +31,16 @@ fn Run() { // CHECK:STDOUT: %.2: f64 = float_literal 1 [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Float = %import_ref.1 -// CHECK:STDOUT: .Int32 = %import_ref.2 +// CHECK:STDOUT: .Int = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -74,14 +76,15 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc20_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc20_10.2: type = converted %int.make_type_32, %.loc20_10.1 [template = i32] -// CHECK:STDOUT: %x.var: ref i32 = var x -// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var +// CHECK:STDOUT: %.loc20_10.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc20_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc20_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc20_10.3: type = converted %int.make_type_signed, %.loc20_10.2 [template = constants.%i32] +// CHECK:STDOUT: %x.var: ref %i32 = var x +// CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var // CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %Foo.call: init f64 = call %Foo.ref() -// CHECK:STDOUT: %.loc20_21: i32 = converted %Foo.call, [template = ] +// CHECK:STDOUT: %.loc20_21: %i32 = converted %Foo.call, [template = ] // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index cba9ece2fdb7..91e1bbd93fb1 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -19,24 +19,27 @@ fn Main() { // CHECK:STDOUT: --- i32.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Echo.type: type = fn_type @Echo [template] // CHECK:STDOUT: %Echo: %Echo.type = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -51,46 +54,50 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Echo.decl: %Echo.type = fn_decl @Echo [template = constants.%Echo] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_32.loc11_12 [template = i32] -// CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_32.loc11_12, %.loc11_12.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_20.1: type = value_of_initializer %int.make_type_32.loc11_20 [template = i32] -// CHECK:STDOUT: %.loc11_20.2: type = converted %int.make_type_32.loc11_20, %.loc11_20.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_12.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_12: init type = call constants.%Int(%.loc11_12.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_12.2: type = value_of_initializer %int.make_type_signed.loc11_12 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_12.3: type = converted %int.make_type_signed.loc11_12, %.loc11_12.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_20: init type = call constants.%Int(%.loc11_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_20.2: type = value_of_initializer %int.make_type_signed.loc11_20 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_20.3: type = converted %int.make_type_signed.loc11_20, %.loc11_20.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Echo(%a.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @Echo(%a.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: return %a.ref // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_10.2: type = converted %int.make_type_32, %.loc16_10.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc16_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc16_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc16_10.3: type = converted %int.make_type_signed, %.loc16_10.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %Echo.ref: %Echo.type = name_ref Echo, file.%Echo.decl [template = constants.%Echo] -// CHECK:STDOUT: %.loc16_21.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc16_21.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_21.3: = bound_method %.loc16_21.1, %.loc16_21.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc16_21.3(%.loc16_21.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc16_21.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc16_21.5: i32 = converted %.loc16_21.1, %.loc16_21.4 [template = constants.%.27] -// CHECK:STDOUT: %Echo.call: init i32 = call %Echo.ref(%.loc16_21.5) +// CHECK:STDOUT: %.loc16_21.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc16_21.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc16_21.3: = bound_method %.loc16_21.1, %.loc16_21.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc16_21.4: = specific_function %.loc16_21.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc16_21.4(%.loc16_21.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc16_21.5: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc16_21.6: %i32 = converted %.loc16_21.1, %.loc16_21.5 [template = constants.%.25] +// CHECK:STDOUT: %Echo.call: init %i32 = call %Echo.ref(%.loc16_21.6) // CHECK:STDOUT: assign %b.var, %Echo.call // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index 513c44f50a14..b2b9099ddc24 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -19,33 +19,37 @@ fn Main() { // CHECK:STDOUT: --- more_param_ir.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.27) [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 6 [template] -// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 6 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.25) [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %.28: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -60,60 +64,65 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed.loc11_11, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%.loc11_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.2: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.3: type = converted %int.make_type_signed.loc11_19, %.loc11_19.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a.param_patt: i32, %b.param_patt: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: %i32, %b.param_patt: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_15.1: %tuple.type.1 = tuple_literal (%int.make_type_32) -// CHECK:STDOUT: %.loc14_15.2: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_15.3: type = converted %int.make_type_32, %.loc14_15.2 [template = i32] +// CHECK:STDOUT: %.loc14_11: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_11) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_15.1: %tuple.type.1 = tuple_literal (%int.make_type_signed) +// CHECK:STDOUT: %.loc14_15.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_15.3: type = converted %int.make_type_signed, %.loc14_15.2 [template = constants.%i32] // CHECK:STDOUT: %.loc14_15.4: type = converted %.loc14_15.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var -// CHECK:STDOUT: %.loc14_20: Core.IntLiteral = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc14_20: Core.IntLiteral = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %.loc14_22.1: %tuple.type.3 = tuple_literal (%.loc14_20) -// CHECK:STDOUT: %.loc14_22.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_22.3: = bound_method %.loc14_20, %.loc14_22.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc14: init i32 = call %.loc14_22.3(%.loc14_20) [template = constants.%.27] -// CHECK:STDOUT: %.loc14_22.4: init i32 = converted %.loc14_20, %int.convert_checked.loc14 [template = constants.%.27] -// CHECK:STDOUT: %.loc14_22.5: init %tuple.type.2 = tuple_init (%.loc14_22.4) to %x.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc14_23: init %tuple.type.2 = converted %.loc14_22.1, %.loc14_22.5 [template = constants.%tuple] +// CHECK:STDOUT: %.loc14_22.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_22.3: = bound_method %.loc14_20, %.loc14_22.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc14_22.4: = specific_function %.loc14_22.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %.loc14_22.4(%.loc14_20) [template = constants.%.25] +// CHECK:STDOUT: %.loc14_22.5: init %i32 = converted %.loc14_20, %int.convert_checked.loc14 [template = constants.%.25] +// CHECK:STDOUT: %.loc14_22.6: init %tuple.type.2 = tuple_init (%.loc14_22.5) to %x.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc14_23: init %tuple.type.2 = converted %.loc14_22.1, %.loc14_22.6 [template = constants.%tuple] // CHECK:STDOUT: assign %x.var, %.loc14_23 // CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %x.ref: ref %tuple.type.2 = name_ref x, %x -// CHECK:STDOUT: %.loc16_9: Core.IntLiteral = int_value 0 [template = constants.%.28] -// CHECK:STDOUT: %.loc16_8.1: ref i32 = tuple_access %x.ref, element0 -// CHECK:STDOUT: %.loc16_12.1: Core.IntLiteral = int_value 6 [template = constants.%.29] -// CHECK:STDOUT: %.loc16_8.2: i32 = bind_value %.loc16_8.1 -// CHECK:STDOUT: %.loc16_12.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_12.3: = bound_method %.loc16_12.1, %.loc16_12.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc16: init i32 = call %.loc16_12.3(%.loc16_12.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc16_12.4: i32 = value_of_initializer %int.convert_checked.loc16 [template = constants.%.31] -// CHECK:STDOUT: %.loc16_12.5: i32 = converted %.loc16_12.1, %.loc16_12.4 [template = constants.%.31] -// CHECK:STDOUT: %Foo.call: init %empty_tuple.type = call %Foo.ref(%.loc16_8.2, %.loc16_12.5) +// CHECK:STDOUT: %.loc16_9: Core.IntLiteral = int_value 0 [template = constants.%.26] +// CHECK:STDOUT: %.loc16_8.1: ref %i32 = tuple_access %x.ref, element0 +// CHECK:STDOUT: %.loc16_12.1: Core.IntLiteral = int_value 6 [template = constants.%.27] +// CHECK:STDOUT: %.loc16_8.2: %i32 = bind_value %.loc16_8.1 +// CHECK:STDOUT: %.loc16_12.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc16_12.3: = bound_method %.loc16_12.1, %.loc16_12.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc16_12.4: = specific_function %.loc16_12.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %.loc16_12.4(%.loc16_12.1) [template = constants.%.30] +// CHECK:STDOUT: %.loc16_12.5: %i32 = value_of_initializer %int.convert_checked.loc16 [template = constants.%.30] +// CHECK:STDOUT: %.loc16_12.6: %i32 = converted %.loc16_12.1, %.loc16_12.5 [template = constants.%.30] +// CHECK:STDOUT: %Foo.call: init %empty_tuple.type = call %Foo.ref(%.loc16_8.2, %.loc16_12.6) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/params_one.carbon b/toolchain/check/testdata/function/call/params_one.carbon index fdfccac1c7bd..636010830682 100644 --- a/toolchain/check/testdata/function/call/params_one.carbon +++ b/toolchain/check/testdata/function/call/params_one.carbon @@ -17,25 +17,28 @@ fn Main() { // CHECK:STDOUT: --- params_one.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -50,19 +53,20 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a.param_patt: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -70,13 +74,14 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] -// CHECK:STDOUT: %.loc14_7.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc14_7.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_7.3: = bound_method %.loc14_7.1, %.loc14_7.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc14_7.3(%.loc14_7.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc14_7.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc14_7.5: i32 = converted %.loc14_7.1, %.loc14_7.4 [template = constants.%.27] -// CHECK:STDOUT: %Foo.call: init %empty_tuple.type = call %Foo.ref(%.loc14_7.5) +// CHECK:STDOUT: %.loc14_7.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_7.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_7.3: = bound_method %.loc14_7.1, %.loc14_7.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc14_7.4: = specific_function %.loc14_7.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc14_7.4(%.loc14_7.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc14_7.5: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc14_7.6: %i32 = converted %.loc14_7.1, %.loc14_7.5 [template = constants.%.25] +// CHECK:STDOUT: %Foo.call: init %empty_tuple.type = call %Foo.ref(%.loc14_7.6) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/params_one_comma.carbon b/toolchain/check/testdata/function/call/params_one_comma.carbon index 7d7e72db0b2b..7078b5d19059 100644 --- a/toolchain/check/testdata/function/call/params_one_comma.carbon +++ b/toolchain/check/testdata/function/call/params_one_comma.carbon @@ -18,25 +18,28 @@ fn Main() { // CHECK:STDOUT: --- params_one_comma.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -51,19 +54,20 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a.param_patt: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -71,21 +75,23 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Foo.ref.loc14: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] -// CHECK:STDOUT: %.loc14_7.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc14_7.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_7.3: = bound_method %.loc14_7.1, %.loc14_7.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc14: init i32 = call %.loc14_7.3(%.loc14_7.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc14_7.4: i32 = value_of_initializer %int.convert_checked.loc14 [template = constants.%.27] -// CHECK:STDOUT: %.loc14_7.5: i32 = converted %.loc14_7.1, %.loc14_7.4 [template = constants.%.27] -// CHECK:STDOUT: %Foo.call.loc14: init %empty_tuple.type = call %Foo.ref.loc14(%.loc14_7.5) +// CHECK:STDOUT: %.loc14_7.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_7.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_7.3: = bound_method %.loc14_7.1, %.loc14_7.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc14_7.4: = specific_function %.loc14_7.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %.loc14_7.4(%.loc14_7.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc14_7.5: %i32 = value_of_initializer %int.convert_checked.loc14 [template = constants.%.25] +// CHECK:STDOUT: %.loc14_7.6: %i32 = converted %.loc14_7.1, %.loc14_7.5 [template = constants.%.25] +// CHECK:STDOUT: %Foo.call.loc14: init %empty_tuple.type = call %Foo.ref.loc14(%.loc14_7.6) // CHECK:STDOUT: %Foo.ref.loc15: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] -// CHECK:STDOUT: %.loc15_7.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc15_7.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_7.3: = bound_method %.loc15_7.1, %.loc15_7.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc15: init i32 = call %.loc15_7.3(%.loc15_7.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc15_7.4: i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%.27] -// CHECK:STDOUT: %.loc15_7.5: i32 = converted %.loc15_7.1, %.loc15_7.4 [template = constants.%.27] -// CHECK:STDOUT: %Foo.call.loc15: init %empty_tuple.type = call %Foo.ref.loc15(%.loc15_7.5) +// CHECK:STDOUT: %.loc15_7.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_7.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_7.3: = bound_method %.loc15_7.1, %.loc15_7.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc15_7.4: = specific_function %.loc15_7.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %.loc15_7.4(%.loc15_7.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc15_7.5: %i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%.25] +// CHECK:STDOUT: %.loc15_7.6: %i32 = converted %.loc15_7.1, %.loc15_7.5 [template = constants.%.25] +// CHECK:STDOUT: %Foo.call.loc15: init %empty_tuple.type = call %Foo.ref.loc15(%.loc15_7.6) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/params_two.carbon b/toolchain/check/testdata/function/call/params_two.carbon index 9503bf4789da..3239b9238afa 100644 --- a/toolchain/check/testdata/function/call/params_two.carbon +++ b/toolchain/check/testdata/function/call/params_two.carbon @@ -17,28 +17,32 @@ fn Main() { // CHECK:STDOUT: --- params_two.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -53,26 +57,28 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed.loc11_11, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%.loc11_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.2: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.3: type = converted %int.make_type_signed.loc11_19, %.loc11_19.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a.param_patt: i32, %b.param_patt: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: %i32, %b.param_patt: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -80,19 +86,21 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] -// CHECK:STDOUT: %.loc14_7.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc14_10.1: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc14_7.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_7.3: = bound_method %.loc14_7.1, %.loc14_7.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc14_7: init i32 = call %.loc14_7.3(%.loc14_7.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc14_7.4: i32 = value_of_initializer %int.convert_checked.loc14_7 [template = constants.%.28] -// CHECK:STDOUT: %.loc14_7.5: i32 = converted %.loc14_7.1, %.loc14_7.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc14_10.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_10.3: = bound_method %.loc14_10.1, %.loc14_10.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc14_10: init i32 = call %.loc14_10.3(%.loc14_10.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc14_10.4: i32 = value_of_initializer %int.convert_checked.loc14_10 [template = constants.%.30] -// CHECK:STDOUT: %.loc14_10.5: i32 = converted %.loc14_10.1, %.loc14_10.4 [template = constants.%.30] -// CHECK:STDOUT: %Foo.call: init %empty_tuple.type = call %Foo.ref(%.loc14_7.5, %.loc14_10.5) +// CHECK:STDOUT: %.loc14_7.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_10.1: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc14_7.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_7.3: = bound_method %.loc14_7.1, %.loc14_7.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc14_7.4: = specific_function %.loc14_7.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc14_7: init %i32 = call %.loc14_7.4(%.loc14_7.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc14_7.5: %i32 = value_of_initializer %int.convert_checked.loc14_7 [template = constants.%.26] +// CHECK:STDOUT: %.loc14_7.6: %i32 = converted %.loc14_7.1, %.loc14_7.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc14_10.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_10.3: = bound_method %.loc14_10.1, %.loc14_10.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc14_10.4: = specific_function %.loc14_10.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc14_10: init %i32 = call %.loc14_10.4(%.loc14_10.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc14_10.5: %i32 = value_of_initializer %int.convert_checked.loc14_10 [template = constants.%.29] +// CHECK:STDOUT: %.loc14_10.6: %i32 = converted %.loc14_10.1, %.loc14_10.5 [template = constants.%.29] +// CHECK:STDOUT: %Foo.call: init %empty_tuple.type = call %Foo.ref(%.loc14_7.6, %.loc14_10.6) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/params_two_comma.carbon b/toolchain/check/testdata/function/call/params_two_comma.carbon index 8cd8d29820df..cdd0a4754c14 100644 --- a/toolchain/check/testdata/function/call/params_two_comma.carbon +++ b/toolchain/check/testdata/function/call/params_two_comma.carbon @@ -18,28 +18,32 @@ fn Main() { // CHECK:STDOUT: --- params_two_comma.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.27: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -54,26 +58,28 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed.loc11_11, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%.loc11_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.2: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.3: type = converted %int.make_type_signed.loc11_19, %.loc11_19.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a.param_patt: i32, %b.param_patt: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: %i32, %b.param_patt: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -81,33 +87,37 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Foo.ref.loc14: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] -// CHECK:STDOUT: %.loc14_7.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc14_10.1: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc14_7.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_7.3: = bound_method %.loc14_7.1, %.loc14_7.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc14_7: init i32 = call %.loc14_7.3(%.loc14_7.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc14_7.4: i32 = value_of_initializer %int.convert_checked.loc14_7 [template = constants.%.28] -// CHECK:STDOUT: %.loc14_7.5: i32 = converted %.loc14_7.1, %.loc14_7.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc14_10.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_10.3: = bound_method %.loc14_10.1, %.loc14_10.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc14_10: init i32 = call %.loc14_10.3(%.loc14_10.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc14_10.4: i32 = value_of_initializer %int.convert_checked.loc14_10 [template = constants.%.30] -// CHECK:STDOUT: %.loc14_10.5: i32 = converted %.loc14_10.1, %.loc14_10.4 [template = constants.%.30] -// CHECK:STDOUT: %Foo.call.loc14: init %empty_tuple.type = call %Foo.ref.loc14(%.loc14_7.5, %.loc14_10.5) +// CHECK:STDOUT: %.loc14_7.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_10.1: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc14_7.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_7.3: = bound_method %.loc14_7.1, %.loc14_7.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc14_7.4: = specific_function %.loc14_7.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc14_7: init %i32 = call %.loc14_7.4(%.loc14_7.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc14_7.5: %i32 = value_of_initializer %int.convert_checked.loc14_7 [template = constants.%.26] +// CHECK:STDOUT: %.loc14_7.6: %i32 = converted %.loc14_7.1, %.loc14_7.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc14_10.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_10.3: = bound_method %.loc14_10.1, %.loc14_10.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc14_10.4: = specific_function %.loc14_10.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc14_10: init %i32 = call %.loc14_10.4(%.loc14_10.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc14_10.5: %i32 = value_of_initializer %int.convert_checked.loc14_10 [template = constants.%.29] +// CHECK:STDOUT: %.loc14_10.6: %i32 = converted %.loc14_10.1, %.loc14_10.5 [template = constants.%.29] +// CHECK:STDOUT: %Foo.call.loc14: init %empty_tuple.type = call %Foo.ref.loc14(%.loc14_7.6, %.loc14_10.6) // CHECK:STDOUT: %Foo.ref.loc15: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] -// CHECK:STDOUT: %.loc15_7.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc15_10.1: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc15_7.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_7.3: = bound_method %.loc15_7.1, %.loc15_7.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc15_7: init i32 = call %.loc15_7.3(%.loc15_7.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc15_7.4: i32 = value_of_initializer %int.convert_checked.loc15_7 [template = constants.%.28] -// CHECK:STDOUT: %.loc15_7.5: i32 = converted %.loc15_7.1, %.loc15_7.4 [template = constants.%.28] -// CHECK:STDOUT: %.loc15_10.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_10.3: = bound_method %.loc15_10.1, %.loc15_10.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc15_10: init i32 = call %.loc15_10.3(%.loc15_10.1) [template = constants.%.30] -// CHECK:STDOUT: %.loc15_10.4: i32 = value_of_initializer %int.convert_checked.loc15_10 [template = constants.%.30] -// CHECK:STDOUT: %.loc15_10.5: i32 = converted %.loc15_10.1, %.loc15_10.4 [template = constants.%.30] -// CHECK:STDOUT: %Foo.call.loc15: init %empty_tuple.type = call %Foo.ref.loc15(%.loc15_7.5, %.loc15_10.5) +// CHECK:STDOUT: %.loc15_7.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_10.1: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_7.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_7.3: = bound_method %.loc15_7.1, %.loc15_7.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc15_7.4: = specific_function %.loc15_7.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc15_7: init %i32 = call %.loc15_7.4(%.loc15_7.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc15_7.5: %i32 = value_of_initializer %int.convert_checked.loc15_7 [template = constants.%.26] +// CHECK:STDOUT: %.loc15_7.6: %i32 = converted %.loc15_7.1, %.loc15_7.5 [template = constants.%.26] +// CHECK:STDOUT: %.loc15_10.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_10.3: = bound_method %.loc15_10.1, %.loc15_10.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc15_10.4: = specific_function %.loc15_10.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc15_10: init %i32 = call %.loc15_10.4(%.loc15_10.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc15_10.5: %i32 = value_of_initializer %int.convert_checked.loc15_10 [template = constants.%.29] +// CHECK:STDOUT: %.loc15_10.6: %i32 = converted %.loc15_10.1, %.loc15_10.5 [template = constants.%.29] +// CHECK:STDOUT: %Foo.call.loc15: init %empty_tuple.type = call %Foo.ref.loc15(%.loc15_7.6, %.loc15_10.6) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon index 959d820a0351..55230047aa8d 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon @@ -16,15 +16,17 @@ fn F(n: i32, a: [i32; n]*); // CHECK:STDOUT: --- fail_param_in_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -37,25 +39,27 @@ fn F(n: i32, a: [i32; n]*); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %a.patt: = binding_pattern a // CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc14_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_32.loc14_9 [template = i32] -// CHECK:STDOUT: %.loc14_9.2: type = converted %int.make_type_32.loc14_9, %.loc14_9.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n -// CHECK:STDOUT: %.loc14_18.1: type = value_of_initializer %int.make_type_32.loc14_18 [template = i32] -// CHECK:STDOUT: %.loc14_18.2: type = converted %int.make_type_32.loc14_18, %.loc14_18.1 [template = i32] +// CHECK:STDOUT: %.loc14_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_9: init type = call constants.%Int(%.loc14_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_9.2: type = value_of_initializer %int.make_type_signed.loc14_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_9.3: type = converted %int.make_type_signed.loc14_9, %.loc14_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_18: init type = call constants.%Int(%.loc14_18.1) [template = constants.%i32] +// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n +// CHECK:STDOUT: %.loc14_18.2: type = value_of_initializer %int.make_type_signed.loc14_18 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_18.3: type = converted %int.make_type_signed.loc14_18, %.loc14_18.2 [template = constants.%i32] // CHECK:STDOUT: %.loc14_25: type = ptr_type [template = ] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %a.param: = value_param runtime_param1 // CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n.param_patt: i32, %a.param_patt: ); +// CHECK:STDOUT: fn @F(%n.param_patt: %i32, %a.param_patt: ); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon index b74e67740907..4d5eaef753d4 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon @@ -19,15 +19,17 @@ fn F(n: i32, n: i32); // CHECK:STDOUT: --- fail_param_redecl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -40,23 +42,25 @@ fn F(n: i32, n: i32); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %n.patt.loc17_6: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt.loc17_7: i32 = value_param_pattern %n.patt.loc17_6, runtime_param0 -// CHECK:STDOUT: %n.patt.loc17_14: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt.loc17_15: i32 = value_param_pattern %n.patt.loc17_14, runtime_param1 +// CHECK:STDOUT: %n.patt.loc17_6: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt.loc17_7: %i32 = value_param_pattern %n.patt.loc17_6, runtime_param0 +// CHECK:STDOUT: %n.patt.loc17_14: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt.loc17_15: %i32 = value_param_pattern %n.patt.loc17_14, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc17_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_9.1: type = value_of_initializer %int.make_type_32.loc17_9 [template = i32] -// CHECK:STDOUT: %.loc17_9.2: type = converted %int.make_type_32.loc17_9, %.loc17_9.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc17_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_17.1: type = value_of_initializer %int.make_type_32.loc17_17 [template = i32] -// CHECK:STDOUT: %.loc17_17.2: type = converted %int.make_type_32.loc17_17, %.loc17_17.1 [template = i32] -// CHECK:STDOUT: %n.param.loc17_7: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n.loc17_6: i32 = bind_name n, %n.param.loc17_7 -// CHECK:STDOUT: %n.param.loc17_15: i32 = value_param runtime_param1 -// CHECK:STDOUT: %n.loc17_14: i32 = bind_name n, %n.param.loc17_15 +// CHECK:STDOUT: %.loc17_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc17_9: init type = call constants.%Int(%.loc17_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_9.2: type = value_of_initializer %int.make_type_signed.loc17_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_9.3: type = converted %int.make_type_signed.loc17_9, %.loc17_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc17_17: init type = call constants.%Int(%.loc17_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_17.2: type = value_of_initializer %int.make_type_signed.loc17_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_17.3: type = converted %int.make_type_signed.loc17_17, %.loc17_17.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param.loc17_7: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n.loc17_6: %i32 = bind_name n, %n.param.loc17_7 +// CHECK:STDOUT: %n.param.loc17_15: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %n.loc17_14: %i32 = bind_name n, %n.param.loc17_15 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n.param_patt.loc17_7: i32, %n.param_patt.loc17_15: i32); +// CHECK:STDOUT: fn @F(%n.param_patt.loc17_7: %i32, %n.param_patt.loc17_15: %i32); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index 43620e73a09c..a2061be7699f 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -260,13 +260,15 @@ import library "extern_api"; // CHECK:STDOUT: constants { // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.1: type = struct_type {.c: i32} [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] +// CHECK:STDOUT: %.2: type = struct_type {.c: %i32} [template] // CHECK:STDOUT: %C.type: type = fn_type @C [template] // CHECK:STDOUT: %C: %C.type = struct_value () [template] // CHECK:STDOUT: %D.type: type = fn_type @D [template] @@ -277,7 +279,7 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -295,41 +297,45 @@ import library "extern_api"; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc5_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_9.1: type = value_of_initializer %int.make_type_32.loc5_9 [template = i32] -// CHECK:STDOUT: %.loc5_9.2: type = converted %int.make_type_32.loc5_9, %.loc5_9.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_17.1: type = value_of_initializer %int.make_type_32.loc5_17 [template = i32] -// CHECK:STDOUT: %.loc5_17.2: type = converted %int.make_type_32.loc5_17, %.loc5_17.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc5_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_9: init type = call constants.%Int(%.loc5_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_9.2: type = value_of_initializer %int.make_type_signed.loc5_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_9.3: type = converted %int.make_type_signed.loc5_9, %.loc5_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_17: init type = call constants.%Int(%.loc5_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_17.2: type = value_of_initializer %int.make_type_signed.loc5_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_17.3: type = converted %int.make_type_signed.loc5_17, %.loc5_17.2 [template = constants.%i32] +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] { // CHECK:STDOUT: %c.patt: %tuple.type.2 = binding_pattern c // CHECK:STDOUT: %c.param_patt: %tuple.type.2 = value_param_pattern %c.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.1 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.1 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc6_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_14.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc6_10) -// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_32.loc6_10 [template = i32] -// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_32.loc6_10, %.loc6_14.2 [template = i32] +// CHECK:STDOUT: %.loc6_10: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_10: init type = call constants.%Int(%.loc6_10) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc6_10) +// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_signed.loc6_10 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_signed.loc6_10, %.loc6_14.2 [template = constants.%i32] // CHECK:STDOUT: %.loc6_14.4: type = converted %.loc6_14.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %int.make_type_32.loc6_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_25.1: type = value_of_initializer %int.make_type_32.loc6_25 [template = i32] -// CHECK:STDOUT: %.loc6_25.2: type = converted %int.make_type_32.loc6_25, %.loc6_25.1 [template = i32] -// CHECK:STDOUT: %.loc6_28: type = struct_type {.c: i32} [template = constants.%.1] +// CHECK:STDOUT: %.loc6_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_25: init type = call constants.%Int(%.loc6_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_25.2: type = value_of_initializer %int.make_type_signed.loc6_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_25.3: type = converted %int.make_type_signed.loc6_25, %.loc6_25.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_28: type = struct_type {.c: %i32} [template = constants.%.2] // CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0 // CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref %.1 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.1 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %NS: = namespace [template] { @@ -340,9 +346,9 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%b.param_patt: i32) -> i32; +// CHECK:STDOUT: fn @B(%b.param_patt: %i32) -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%c.param_patt: %tuple.type.2) -> %.1; +// CHECK:STDOUT: fn @C(%c.param_patt: %tuple.type.2) -> %.2; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @D(); // CHECK:STDOUT: @@ -353,13 +359,15 @@ import library "extern_api"; // CHECK:STDOUT: constants { // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.1: type = struct_type {.c: i32} [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] +// CHECK:STDOUT: %.2: type = struct_type {.c: %i32} [template] // CHECK:STDOUT: %C.type: type = fn_type @C [template] // CHECK:STDOUT: %C: %C.type = struct_value () [template] // CHECK:STDOUT: %D.type: type = fn_type @D [template] @@ -370,7 +378,7 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -388,41 +396,45 @@ import library "extern_api"; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc5_44: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_44.1: type = value_of_initializer %int.make_type_32.loc5_44 [template = i32] -// CHECK:STDOUT: %.loc5_44.2: type = converted %int.make_type_32.loc5_44, %.loc5_44.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_52: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_52.1: type = value_of_initializer %int.make_type_32.loc5_52 [template = i32] -// CHECK:STDOUT: %.loc5_52.2: type = converted %int.make_type_32.loc5_52, %.loc5_52.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc5_44.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_44: init type = call constants.%Int(%.loc5_44.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_44.2: type = value_of_initializer %int.make_type_signed.loc5_44 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_44.3: type = converted %int.make_type_signed.loc5_44, %.loc5_44.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_52.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_52: init type = call constants.%Int(%.loc5_52.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_52.2: type = value_of_initializer %int.make_type_signed.loc5_52 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_52.3: type = converted %int.make_type_signed.loc5_52, %.loc5_52.2 [template = constants.%i32] +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] { // CHECK:STDOUT: %c.patt: %tuple.type.2 = binding_pattern c // CHECK:STDOUT: %c.param_patt: %tuple.type.2 = value_param_pattern %c.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.1 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.1 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc6_45: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_49.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc6_45) -// CHECK:STDOUT: %.loc6_49.2: type = value_of_initializer %int.make_type_32.loc6_45 [template = i32] -// CHECK:STDOUT: %.loc6_49.3: type = converted %int.make_type_32.loc6_45, %.loc6_49.2 [template = i32] +// CHECK:STDOUT: %.loc6_45: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_45: init type = call constants.%Int(%.loc6_45) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_49.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc6_45) +// CHECK:STDOUT: %.loc6_49.2: type = value_of_initializer %int.make_type_signed.loc6_45 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_49.3: type = converted %int.make_type_signed.loc6_45, %.loc6_49.2 [template = constants.%i32] // CHECK:STDOUT: %.loc6_49.4: type = converted %.loc6_49.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %int.make_type_32.loc6_60: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_60.1: type = value_of_initializer %int.make_type_32.loc6_60 [template = i32] -// CHECK:STDOUT: %.loc6_60.2: type = converted %int.make_type_32.loc6_60, %.loc6_60.1 [template = i32] -// CHECK:STDOUT: %.loc6_63: type = struct_type {.c: i32} [template = constants.%.1] +// CHECK:STDOUT: %.loc6_60.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_60: init type = call constants.%Int(%.loc6_60.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_60.2: type = value_of_initializer %int.make_type_signed.loc6_60 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_60.3: type = converted %int.make_type_signed.loc6_60, %.loc6_60.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_63: type = struct_type {.c: %i32} [template = constants.%.2] // CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0 // CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref %.1 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.1 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %NS: = namespace [template] { @@ -433,9 +445,9 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @A(); // CHECK:STDOUT: -// CHECK:STDOUT: extern fn @B(%b.param_patt: i32) -> i32; +// CHECK:STDOUT: extern fn @B(%b.param_patt: %i32) -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: extern fn @C(%c.param_patt: %tuple.type.2) -> %.1; +// CHECK:STDOUT: extern fn @C(%c.param_patt: %tuple.type.2) -> %.2; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @D(); // CHECK:STDOUT: @@ -447,23 +459,26 @@ import library "extern_api"; // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] -// CHECK:STDOUT: %.28: type = struct_type {.c: i32} [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.26: type = struct_type {.c: %i32} [template] // CHECK:STDOUT: %C.type: type = fn_type @C [template] // CHECK:STDOUT: %C: %C.type = struct_value () [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (i32) [template] +// CHECK:STDOUT: %tuple.type.1: type = tuple_type (%i32) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.27) [template] +// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.25) [template] // CHECK:STDOUT: %D.type: type = fn_type @D [template] // CHECK:STDOUT: %D: %D.type = struct_value () [template] // CHECK:STDOUT: %E.type: type = fn_type @E [template] @@ -472,16 +487,16 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+28, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+51, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+54, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+57, loaded +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+36, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+61, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+64, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+67, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+58, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+68, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.7 +// CHECK:STDOUT: .Int = %import_ref.7 // CHECK:STDOUT: .ImplicitAs = %import_ref.8 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -508,17 +523,19 @@ import library "extern_api"; // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] -// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_32.loc8, %.loc8_13.1 [template = i32] -// CHECK:STDOUT: %.loc8_16: type = struct_type {.c: i32} [template = constants.%.28] -// CHECK:STDOUT: %c.var: ref %.28 = var c -// CHECK:STDOUT: %c: ref %.28 = bind_name c, %c.var +// CHECK:STDOUT: %.loc7_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%.loc7_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.2: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.3: type = converted %int.make_type_signed.loc7, %.loc7_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc8_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_13.2: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_13.3: type = converted %int.make_type_signed.loc8, %.loc8_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_16: type = struct_type {.c: %i32} [template = constants.%.26] +// CHECK:STDOUT: %c.var: ref %.26 = var c +// CHECK:STDOUT: %c: ref %.26 = bind_name c, %c.var // CHECK:STDOUT: %.loc9_9.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc9_9.2: type = converted %.loc9_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d @@ -531,9 +548,9 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%b.param_patt: i32) -> i32; +// CHECK:STDOUT: fn @B(%b.param_patt: %i32) -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%c.param_patt: %tuple.type.1) -> %.28; +// CHECK:STDOUT: fn @C(%c.param_patt: %tuple.type.1) -> %.26; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @D(); // CHECK:STDOUT: @@ -545,25 +562,27 @@ import library "extern_api"; // CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] -// CHECK:STDOUT: %.loc7_16.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc7_16.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_16.3: = bound_method %.loc7_16.1, %.loc7_16.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc7: init i32 = call %.loc7_16.3(%.loc7_16.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc7_16.4: i32 = value_of_initializer %int.convert_checked.loc7 [template = constants.%.27] -// CHECK:STDOUT: %.loc7_16.5: i32 = converted %.loc7_16.1, %.loc7_16.4 [template = constants.%.27] -// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc7_16.5) +// CHECK:STDOUT: %.loc7_16.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc7_16.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_16.3: = bound_method %.loc7_16.1, %.loc7_16.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc7_16.4: = specific_function %.loc7_16.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc7: init %i32 = call %.loc7_16.4(%.loc7_16.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc7_16.5: %i32 = value_of_initializer %int.convert_checked.loc7 [template = constants.%.25] +// CHECK:STDOUT: %.loc7_16.6: %i32 = converted %.loc7_16.1, %.loc7_16.5 [template = constants.%.25] +// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc7_16.6) // CHECK:STDOUT: assign file.%b.var, %B.call // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] -// CHECK:STDOUT: %.loc8_23: Core.IntLiteral = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc8_23: Core.IntLiteral = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %.loc8_25.1: %tuple.type.2 = tuple_literal (%.loc8_23) -// CHECK:STDOUT: %.loc8_25.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_25.3: = bound_method %.loc8_23, %.loc8_25.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc8: init i32 = call %.loc8_25.3(%.loc8_23) [template = constants.%.27] -// CHECK:STDOUT: %.loc8_25.4: i32 = value_of_initializer %int.convert_checked.loc8 [template = constants.%.27] -// CHECK:STDOUT: %.loc8_25.5: i32 = converted %.loc8_23, %.loc8_25.4 [template = constants.%.27] -// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.loc8_25.5) [template = constants.%tuple] -// CHECK:STDOUT: %.loc8_25.6: %tuple.type.1 = converted %.loc8_25.1, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %C.call: init %.28 = call %C.ref(%.loc8_25.6) +// CHECK:STDOUT: %.loc8_25.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_25.3: = bound_method %.loc8_23, %.loc8_25.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc8_25.4: = specific_function %.loc8_25.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %.loc8_25.4(%.loc8_23) [template = constants.%.25] +// CHECK:STDOUT: %.loc8_25.5: %i32 = value_of_initializer %int.convert_checked.loc8 [template = constants.%.25] +// CHECK:STDOUT: %.loc8_25.6: %i32 = converted %.loc8_23, %.loc8_25.5 [template = constants.%.25] +// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.loc8_25.6) [template = constants.%tuple] +// CHECK:STDOUT: %.loc8_25.7: %tuple.type.1 = converted %.loc8_25.1, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %C.call: init %.26 = call %C.ref(%.loc8_25.7) // CHECK:STDOUT: assign file.%c.var, %C.call // CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D] // CHECK:STDOUT: %D.call: init %empty_tuple.type = call %D.ref() @@ -581,37 +600,40 @@ import library "extern_api"; // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.1: type = struct_type {.c: i32} [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] +// CHECK:STDOUT: %.2: type = struct_type {.c: %i32} [template] // CHECK:STDOUT: %C.type: type = fn_type @C [template] // CHECK:STDOUT: %C: %C.type = struct_value () [template] // CHECK:STDOUT: %D.type: type = fn_type @D [template] // CHECK:STDOUT: %D: %D.type = struct_value () [template] // CHECK:STDOUT: %E.type: type = fn_type @E [template] // CHECK:STDOUT: %E: %E.type = struct_value () [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.28) [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.26) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+57, loaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+67, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = file.%E.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.7 +// CHECK:STDOUT: .Int = %import_ref.7 // CHECK:STDOUT: .ImplicitAs = %import_ref.8 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -636,31 +658,35 @@ import library "extern_api"; // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} { -// CHECK:STDOUT: %int.make_type_32.loc23_16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_16.1: type = value_of_initializer %int.make_type_32.loc23_16 [template = i32] -// CHECK:STDOUT: %.loc23_16.2: type = converted %int.make_type_32.loc23_16, %.loc23_16.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc23_24: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_24.1: type = value_of_initializer %int.make_type_32.loc23_24 [template = i32] -// CHECK:STDOUT: %.loc23_24.2: type = converted %int.make_type_32.loc23_24, %.loc23_24.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %.loc23_21: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc23_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc23_16: init type = call constants.%Int(%.loc23_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_16.2: type = value_of_initializer %int.make_type_signed.loc23_16 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_16.3: type = converted %int.make_type_signed.loc23_16, %.loc23_16.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_24.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc23_24: init type = call constants.%Int(%.loc23_24.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_24.2: type = value_of_initializer %int.make_type_signed.loc23_24 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_24.3: type = converted %int.make_type_signed.loc23_24, %.loc23_24.2 [template = constants.%i32] +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %.loc23_21: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} { -// CHECK:STDOUT: %int.make_type_32.loc32_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc32_21.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc32_17) -// CHECK:STDOUT: %.loc32_21.2: type = value_of_initializer %int.make_type_32.loc32_17 [template = i32] -// CHECK:STDOUT: %.loc32_21.3: type = converted %int.make_type_32.loc32_17, %.loc32_21.2 [template = i32] +// CHECK:STDOUT: %.loc32_17: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc32_17: init type = call constants.%Int(%.loc32_17) [template = constants.%i32] +// CHECK:STDOUT: %.loc32_21.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc32_17) +// CHECK:STDOUT: %.loc32_21.2: type = value_of_initializer %int.make_type_signed.loc32_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc32_21.3: type = converted %int.make_type_signed.loc32_17, %.loc32_21.2 [template = constants.%i32] // CHECK:STDOUT: %.loc32_21.4: type = converted %.loc32_21.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %int.make_type_32.loc32_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc32_32.1: type = value_of_initializer %int.make_type_32.loc32_32 [template = i32] -// CHECK:STDOUT: %.loc32_32.2: type = converted %int.make_type_32.loc32_32, %.loc32_32.1 [template = i32] -// CHECK:STDOUT: %.loc32_35: type = struct_type {.c: i32} [template = constants.%.1] +// CHECK:STDOUT: %.loc32_32.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc32_32: init type = call constants.%Int(%.loc32_32.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc32_32.2: type = value_of_initializer %int.make_type_signed.loc32_32 [template = constants.%i32] +// CHECK:STDOUT: %.loc32_32.3: type = converted %int.make_type_signed.loc32_32, %.loc32_32.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc32_35: type = struct_type {.c: %i32} [template = constants.%.2] // CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0 // CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref %.1 = out_param runtime_param1 -// CHECK:STDOUT: %.loc32_24: ref %.1 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param1 +// CHECK:STDOUT: %.loc32_24: ref %.2 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] {} {} @@ -668,17 +694,19 @@ import library "extern_api"; // CHECK:STDOUT: %.loc52_9.2: type = converted %.loc52_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc53: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc53_8.1: type = value_of_initializer %int.make_type_32.loc53 [template = i32] -// CHECK:STDOUT: %.loc53_8.2: type = converted %int.make_type_32.loc53, %.loc53_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %int.make_type_32.loc54: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc54_13.1: type = value_of_initializer %int.make_type_32.loc54 [template = i32] -// CHECK:STDOUT: %.loc54_13.2: type = converted %int.make_type_32.loc54, %.loc54_13.1 [template = i32] -// CHECK:STDOUT: %.loc54_16: type = struct_type {.c: i32} [template = constants.%.1] -// CHECK:STDOUT: %c.var: ref %.1 = var c -// CHECK:STDOUT: %c: ref %.1 = bind_name c, %c.var +// CHECK:STDOUT: %.loc53_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc53: init type = call constants.%Int(%.loc53_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc53_8.2: type = value_of_initializer %int.make_type_signed.loc53 [template = constants.%i32] +// CHECK:STDOUT: %.loc53_8.3: type = converted %int.make_type_signed.loc53, %.loc53_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc54_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc54: init type = call constants.%Int(%.loc54_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc54_13.2: type = value_of_initializer %int.make_type_signed.loc54 [template = constants.%i32] +// CHECK:STDOUT: %.loc54_13.3: type = converted %int.make_type_signed.loc54, %.loc54_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc54_16: type = struct_type {.c: %i32} [template = constants.%.2] +// CHECK:STDOUT: %c.var: ref %.2 = var c +// CHECK:STDOUT: %c: ref %.2 = bind_name c, %c.var // CHECK:STDOUT: %.loc55_9.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc55_9.2: type = converted %.loc55_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d @@ -691,9 +719,9 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%b.param_patt: i32) -> i32; +// CHECK:STDOUT: fn @B(%b.param_patt: %i32) -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%c.param_patt: %tuple.type.2) -> %.1; +// CHECK:STDOUT: fn @C(%c.param_patt: %tuple.type.2) -> %.2; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @D(); // CHECK:STDOUT: @@ -705,25 +733,27 @@ import library "extern_api"; // CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc53_16.1: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc53_16.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc53_16.3: = bound_method %.loc53_16.1, %.loc53_16.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc53: init i32 = call %.loc53_16.3(%.loc53_16.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc53_16.4: i32 = value_of_initializer %int.convert_checked.loc53 [template = constants.%.28] -// CHECK:STDOUT: %.loc53_16.5: i32 = converted %.loc53_16.1, %.loc53_16.4 [template = constants.%.28] -// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc53_16.5) +// CHECK:STDOUT: %.loc53_16.1: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc53_16.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc53_16.3: = bound_method %.loc53_16.1, %.loc53_16.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc53_16.4: = specific_function %.loc53_16.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %.loc53_16.4(%.loc53_16.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc53_16.5: %i32 = value_of_initializer %int.convert_checked.loc53 [template = constants.%.26] +// CHECK:STDOUT: %.loc53_16.6: %i32 = converted %.loc53_16.1, %.loc53_16.5 [template = constants.%.26] +// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc53_16.6) // CHECK:STDOUT: assign file.%b.var, %B.call // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc54_23: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc54_23: Core.IntLiteral = int_value 1 [template = constants.%.3] // CHECK:STDOUT: %.loc54_25.1: %tuple.type.3 = tuple_literal (%.loc54_23) -// CHECK:STDOUT: %.loc54_25.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc54_25.3: = bound_method %.loc54_23, %.loc54_25.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc54: init i32 = call %.loc54_25.3(%.loc54_23) [template = constants.%.28] -// CHECK:STDOUT: %.loc54_25.4: i32 = value_of_initializer %int.convert_checked.loc54 [template = constants.%.28] -// CHECK:STDOUT: %.loc54_25.5: i32 = converted %.loc54_23, %.loc54_25.4 [template = constants.%.28] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.loc54_25.5) [template = constants.%tuple] -// CHECK:STDOUT: %.loc54_25.6: %tuple.type.2 = converted %.loc54_25.1, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %C.call: init %.1 = call %C.ref(%.loc54_25.6) +// CHECK:STDOUT: %.loc54_25.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc54_25.3: = bound_method %.loc54_23, %.loc54_25.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc54_25.4: = specific_function %.loc54_25.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %.loc54_25.4(%.loc54_23) [template = constants.%.26] +// CHECK:STDOUT: %.loc54_25.5: %i32 = value_of_initializer %int.convert_checked.loc54 [template = constants.%.26] +// CHECK:STDOUT: %.loc54_25.6: %i32 = converted %.loc54_23, %.loc54_25.5 [template = constants.%.26] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.loc54_25.6) [template = constants.%tuple] +// CHECK:STDOUT: %.loc54_25.7: %tuple.type.2 = converted %.loc54_25.1, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %C.call: init %.2 = call %C.ref(%.loc54_25.7) // CHECK:STDOUT: assign file.%c.var, %C.call // CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %D.call: init %empty_tuple.type = call %D.ref() @@ -741,37 +771,40 @@ import library "extern_api"; // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.1: type = struct_type {.c: i32} [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] +// CHECK:STDOUT: %.2: type = struct_type {.c: %i32} [template] // CHECK:STDOUT: %C.type: type = fn_type @C [template] // CHECK:STDOUT: %C: %C.type = struct_value () [template] // CHECK:STDOUT: %D.type: type = fn_type @D [template] // CHECK:STDOUT: %D: %D.type = struct_value () [template] // CHECK:STDOUT: %E.type: type = fn_type @E [template] // CHECK:STDOUT: %E: %E.type = struct_value () [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.28) [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.26) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+57, loaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+67, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = file.%E.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.7 +// CHECK:STDOUT: .Int = %import_ref.7 // CHECK:STDOUT: .ImplicitAs = %import_ref.8 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -796,31 +829,35 @@ import library "extern_api"; // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} { -// CHECK:STDOUT: %int.make_type_32.loc7_16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_16.1: type = value_of_initializer %int.make_type_32.loc7_16 [template = i32] -// CHECK:STDOUT: %.loc7_16.2: type = converted %int.make_type_32.loc7_16, %.loc7_16.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_24: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_24.1: type = value_of_initializer %int.make_type_32.loc7_24 [template = i32] -// CHECK:STDOUT: %.loc7_24.2: type = converted %int.make_type_32.loc7_24, %.loc7_24.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %.loc7_21: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc7_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_16: init type = call constants.%Int(%.loc7_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_16.2: type = value_of_initializer %int.make_type_signed.loc7_16 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_16.3: type = converted %int.make_type_signed.loc7_16, %.loc7_16.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_24.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_24: init type = call constants.%Int(%.loc7_24.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_24.2: type = value_of_initializer %int.make_type_signed.loc7_24 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_24.3: type = converted %int.make_type_signed.loc7_24, %.loc7_24.2 [template = constants.%i32] +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %.loc7_21: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} { -// CHECK:STDOUT: %int.make_type_32.loc8_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_21.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc8_17) -// CHECK:STDOUT: %.loc8_21.2: type = value_of_initializer %int.make_type_32.loc8_17 [template = i32] -// CHECK:STDOUT: %.loc8_21.3: type = converted %int.make_type_32.loc8_17, %.loc8_21.2 [template = i32] +// CHECK:STDOUT: %.loc8_17: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8_17: init type = call constants.%Int(%.loc8_17) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_21.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc8_17) +// CHECK:STDOUT: %.loc8_21.2: type = value_of_initializer %int.make_type_signed.loc8_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_21.3: type = converted %int.make_type_signed.loc8_17, %.loc8_21.2 [template = constants.%i32] // CHECK:STDOUT: %.loc8_21.4: type = converted %.loc8_21.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %int.make_type_32.loc8_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_32.1: type = value_of_initializer %int.make_type_32.loc8_32 [template = i32] -// CHECK:STDOUT: %.loc8_32.2: type = converted %int.make_type_32.loc8_32, %.loc8_32.1 [template = i32] -// CHECK:STDOUT: %.loc8_35: type = struct_type {.c: i32} [template = constants.%.1] +// CHECK:STDOUT: %.loc8_32.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8_32: init type = call constants.%Int(%.loc8_32.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_32.2: type = value_of_initializer %int.make_type_signed.loc8_32 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_32.3: type = converted %int.make_type_signed.loc8_32, %.loc8_32.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_35: type = struct_type {.c: %i32} [template = constants.%.2] // CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0 // CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref %.1 = out_param runtime_param1 -// CHECK:STDOUT: %.loc8_24: ref %.1 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param1 +// CHECK:STDOUT: %.loc8_24: ref %.2 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] {} {} @@ -828,17 +865,19 @@ import library "extern_api"; // CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_8.2: type = converted %int.make_type_32.loc13, %.loc13_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] -// CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32.loc14, %.loc14_13.1 [template = i32] -// CHECK:STDOUT: %.loc14_16: type = struct_type {.c: i32} [template = constants.%.1] -// CHECK:STDOUT: %c.var: ref %.1 = var c -// CHECK:STDOUT: %c: ref %.1 = bind_name c, %c.var +// CHECK:STDOUT: %.loc13_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8.3: type = converted %int.make_type_signed.loc13, %.loc13_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc14_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%.loc14_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_13.2: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_13.3: type = converted %int.make_type_signed.loc14, %.loc14_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_16: type = struct_type {.c: %i32} [template = constants.%.2] +// CHECK:STDOUT: %c.var: ref %.2 = var c +// CHECK:STDOUT: %c: ref %.2 = bind_name c, %c.var // CHECK:STDOUT: %.loc15_9.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc15_9.2: type = converted %.loc15_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d @@ -851,9 +890,9 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @A(); // CHECK:STDOUT: -// CHECK:STDOUT: extern fn @B(%b.param_patt: i32) -> i32; +// CHECK:STDOUT: extern fn @B(%b.param_patt: %i32) -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: extern fn @C(%c.param_patt: %tuple.type.2) -> %.1; +// CHECK:STDOUT: extern fn @C(%c.param_patt: %tuple.type.2) -> %.2; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @D(); // CHECK:STDOUT: @@ -865,25 +904,27 @@ import library "extern_api"; // CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc13_16.1: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc13_16.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_16.3: = bound_method %.loc13_16.1, %.loc13_16.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc13: init i32 = call %.loc13_16.3(%.loc13_16.1) [template = constants.%.28] -// CHECK:STDOUT: %.loc13_16.4: i32 = value_of_initializer %int.convert_checked.loc13 [template = constants.%.28] -// CHECK:STDOUT: %.loc13_16.5: i32 = converted %.loc13_16.1, %.loc13_16.4 [template = constants.%.28] -// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc13_16.5) +// CHECK:STDOUT: %.loc13_16.1: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc13_16.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_16.3: = bound_method %.loc13_16.1, %.loc13_16.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc13_16.4: = specific_function %.loc13_16.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %.loc13_16.4(%.loc13_16.1) [template = constants.%.26] +// CHECK:STDOUT: %.loc13_16.5: %i32 = value_of_initializer %int.convert_checked.loc13 [template = constants.%.26] +// CHECK:STDOUT: %.loc13_16.6: %i32 = converted %.loc13_16.1, %.loc13_16.5 [template = constants.%.26] +// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc13_16.6) // CHECK:STDOUT: assign file.%b.var, %B.call // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc14_23: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_23: Core.IntLiteral = int_value 1 [template = constants.%.3] // CHECK:STDOUT: %.loc14_25.1: %tuple.type.3 = tuple_literal (%.loc14_23) -// CHECK:STDOUT: %.loc14_25.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_25.3: = bound_method %.loc14_23, %.loc14_25.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc14: init i32 = call %.loc14_25.3(%.loc14_23) [template = constants.%.28] -// CHECK:STDOUT: %.loc14_25.4: i32 = value_of_initializer %int.convert_checked.loc14 [template = constants.%.28] -// CHECK:STDOUT: %.loc14_25.5: i32 = converted %.loc14_23, %.loc14_25.4 [template = constants.%.28] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.loc14_25.5) [template = constants.%tuple] -// CHECK:STDOUT: %.loc14_25.6: %tuple.type.2 = converted %.loc14_25.1, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %C.call: init %.1 = call %C.ref(%.loc14_25.6) +// CHECK:STDOUT: %.loc14_25.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_25.3: = bound_method %.loc14_23, %.loc14_25.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc14_25.4: = specific_function %.loc14_25.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %.loc14_25.4(%.loc14_23) [template = constants.%.26] +// CHECK:STDOUT: %.loc14_25.5: %i32 = value_of_initializer %int.convert_checked.loc14 [template = constants.%.26] +// CHECK:STDOUT: %.loc14_25.6: %i32 = converted %.loc14_23, %.loc14_25.5 [template = constants.%.26] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.loc14_25.6) [template = constants.%tuple] +// CHECK:STDOUT: %.loc14_25.7: %tuple.type.2 = converted %.loc14_25.1, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %C.call: init %.2 = call %C.ref(%.loc14_25.7) // CHECK:STDOUT: assign file.%c.var, %C.call // CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %D.call: init %empty_tuple.type = call %D.ref() @@ -901,23 +942,26 @@ import library "extern_api"; // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] -// CHECK:STDOUT: %.28: type = struct_type {.c: i32} [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.26: type = struct_type {.c: %i32} [template] // CHECK:STDOUT: %C.type: type = fn_type @C [template] // CHECK:STDOUT: %C: %C.type = struct_value () [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (i32) [template] +// CHECK:STDOUT: %tuple.type.1: type = tuple_type (%i32) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.27) [template] +// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.25) [template] // CHECK:STDOUT: %D.type: type = fn_type @D [template] // CHECK:STDOUT: %D: %D.type = struct_value () [template] // CHECK:STDOUT: %E.type: type = fn_type @E [template] @@ -926,16 +970,16 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+28, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+51, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+54, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+57, loaded +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+36, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+61, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+64, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+67, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+58, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+68, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.12 +// CHECK:STDOUT: .Int = %import_ref.12 // CHECK:STDOUT: .ImplicitAs = %import_ref.13 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -962,17 +1006,19 @@ import library "extern_api"; // CHECK:STDOUT: %.loc52_9.2: type = converted %.loc52_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc53: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc53_8.1: type = value_of_initializer %int.make_type_32.loc53 [template = i32] -// CHECK:STDOUT: %.loc53_8.2: type = converted %int.make_type_32.loc53, %.loc53_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %int.make_type_32.loc54: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc54_13.1: type = value_of_initializer %int.make_type_32.loc54 [template = i32] -// CHECK:STDOUT: %.loc54_13.2: type = converted %int.make_type_32.loc54, %.loc54_13.1 [template = i32] -// CHECK:STDOUT: %.loc54_16: type = struct_type {.c: i32} [template = constants.%.28] -// CHECK:STDOUT: %c.var: ref %.28 = var c -// CHECK:STDOUT: %c: ref %.28 = bind_name c, %c.var +// CHECK:STDOUT: %.loc53_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc53: init type = call constants.%Int(%.loc53_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc53_8.2: type = value_of_initializer %int.make_type_signed.loc53 [template = constants.%i32] +// CHECK:STDOUT: %.loc53_8.3: type = converted %int.make_type_signed.loc53, %.loc53_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc54_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc54: init type = call constants.%Int(%.loc54_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc54_13.2: type = value_of_initializer %int.make_type_signed.loc54 [template = constants.%i32] +// CHECK:STDOUT: %.loc54_13.3: type = converted %int.make_type_signed.loc54, %.loc54_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc54_16: type = struct_type {.c: %i32} [template = constants.%.26] +// CHECK:STDOUT: %c.var: ref %.26 = var c +// CHECK:STDOUT: %c: ref %.26 = bind_name c, %c.var // CHECK:STDOUT: %.loc55_9.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc55_9.2: type = converted %.loc55_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d @@ -985,9 +1031,9 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%b.param_patt: i32) -> i32; +// CHECK:STDOUT: fn @B(%b.param_patt: %i32) -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%c.param_patt: %tuple.type.1) -> %.28; +// CHECK:STDOUT: fn @C(%c.param_patt: %tuple.type.1) -> %.26; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @D(); // CHECK:STDOUT: @@ -999,25 +1045,27 @@ import library "extern_api"; // CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] -// CHECK:STDOUT: %.loc53_16.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc53_16.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc53_16.3: = bound_method %.loc53_16.1, %.loc53_16.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc53: init i32 = call %.loc53_16.3(%.loc53_16.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc53_16.4: i32 = value_of_initializer %int.convert_checked.loc53 [template = constants.%.27] -// CHECK:STDOUT: %.loc53_16.5: i32 = converted %.loc53_16.1, %.loc53_16.4 [template = constants.%.27] -// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc53_16.5) +// CHECK:STDOUT: %.loc53_16.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc53_16.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc53_16.3: = bound_method %.loc53_16.1, %.loc53_16.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc53_16.4: = specific_function %.loc53_16.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %.loc53_16.4(%.loc53_16.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc53_16.5: %i32 = value_of_initializer %int.convert_checked.loc53 [template = constants.%.25] +// CHECK:STDOUT: %.loc53_16.6: %i32 = converted %.loc53_16.1, %.loc53_16.5 [template = constants.%.25] +// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc53_16.6) // CHECK:STDOUT: assign file.%b.var, %B.call // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] -// CHECK:STDOUT: %.loc54_23: Core.IntLiteral = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc54_23: Core.IntLiteral = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %.loc54_25.1: %tuple.type.2 = tuple_literal (%.loc54_23) -// CHECK:STDOUT: %.loc54_25.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc54_25.3: = bound_method %.loc54_23, %.loc54_25.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc54: init i32 = call %.loc54_25.3(%.loc54_23) [template = constants.%.27] -// CHECK:STDOUT: %.loc54_25.4: i32 = value_of_initializer %int.convert_checked.loc54 [template = constants.%.27] -// CHECK:STDOUT: %.loc54_25.5: i32 = converted %.loc54_23, %.loc54_25.4 [template = constants.%.27] -// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.loc54_25.5) [template = constants.%tuple] -// CHECK:STDOUT: %.loc54_25.6: %tuple.type.1 = converted %.loc54_25.1, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %C.call: init %.28 = call %C.ref(%.loc54_25.6) +// CHECK:STDOUT: %.loc54_25.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc54_25.3: = bound_method %.loc54_23, %.loc54_25.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc54_25.4: = specific_function %.loc54_25.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %.loc54_25.4(%.loc54_23) [template = constants.%.25] +// CHECK:STDOUT: %.loc54_25.5: %i32 = value_of_initializer %int.convert_checked.loc54 [template = constants.%.25] +// CHECK:STDOUT: %.loc54_25.6: %i32 = converted %.loc54_23, %.loc54_25.5 [template = constants.%.25] +// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.loc54_25.6) [template = constants.%tuple] +// CHECK:STDOUT: %.loc54_25.7: %tuple.type.1 = converted %.loc54_25.1, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %C.call: init %.26 = call %C.ref(%.loc54_25.7) // CHECK:STDOUT: assign file.%c.var, %C.call // CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D] // CHECK:STDOUT: %D.call: init %empty_tuple.type = call %D.ref() @@ -1035,23 +1083,26 @@ import library "extern_api"; // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] -// CHECK:STDOUT: %.28: type = struct_type {.c: i32} [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.26: type = struct_type {.c: %i32} [template] // CHECK:STDOUT: %C.type: type = fn_type @C [template] // CHECK:STDOUT: %C: %C.type = struct_value () [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (i32) [template] +// CHECK:STDOUT: %tuple.type.1: type = tuple_type (%i32) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.27) [template] +// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.25) [template] // CHECK:STDOUT: %D.type: type = fn_type @D [template] // CHECK:STDOUT: %D: %D.type = struct_value () [template] // CHECK:STDOUT: %E.type: type = fn_type @E [template] @@ -1060,16 +1111,16 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//extern_api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//extern_api, inst+28, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//extern_api, inst+51, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//extern_api, inst+54, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+57, loaded +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//extern_api, inst+36, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//extern_api, inst+61, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//extern_api, inst+64, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+67, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//extern_api, inst+58, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//extern_api, inst+68, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.12 +// CHECK:STDOUT: .Int = %import_ref.12 // CHECK:STDOUT: .ImplicitAs = %import_ref.13 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -1096,17 +1147,19 @@ import library "extern_api"; // CHECK:STDOUT: %.loc51_9.2: type = converted %.loc51_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc52: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc52_8.1: type = value_of_initializer %int.make_type_32.loc52 [template = i32] -// CHECK:STDOUT: %.loc52_8.2: type = converted %int.make_type_32.loc52, %.loc52_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %int.make_type_32.loc53: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc53_13.1: type = value_of_initializer %int.make_type_32.loc53 [template = i32] -// CHECK:STDOUT: %.loc53_13.2: type = converted %int.make_type_32.loc53, %.loc53_13.1 [template = i32] -// CHECK:STDOUT: %.loc53_16: type = struct_type {.c: i32} [template = constants.%.28] -// CHECK:STDOUT: %c.var: ref %.28 = var c -// CHECK:STDOUT: %c: ref %.28 = bind_name c, %c.var +// CHECK:STDOUT: %.loc52_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc52: init type = call constants.%Int(%.loc52_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc52_8.2: type = value_of_initializer %int.make_type_signed.loc52 [template = constants.%i32] +// CHECK:STDOUT: %.loc52_8.3: type = converted %int.make_type_signed.loc52, %.loc52_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc53_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc53: init type = call constants.%Int(%.loc53_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc53_13.2: type = value_of_initializer %int.make_type_signed.loc53 [template = constants.%i32] +// CHECK:STDOUT: %.loc53_13.3: type = converted %int.make_type_signed.loc53, %.loc53_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc53_16: type = struct_type {.c: %i32} [template = constants.%.26] +// CHECK:STDOUT: %c.var: ref %.26 = var c +// CHECK:STDOUT: %c: ref %.26 = bind_name c, %c.var // CHECK:STDOUT: %.loc54_9.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc54_9.2: type = converted %.loc54_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d @@ -1119,9 +1172,9 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @A(); // CHECK:STDOUT: -// CHECK:STDOUT: extern fn @B(%b.param_patt: i32) -> i32; +// CHECK:STDOUT: extern fn @B(%b.param_patt: %i32) -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: extern fn @C(%c.param_patt: %tuple.type.1) -> %.28; +// CHECK:STDOUT: extern fn @C(%c.param_patt: %tuple.type.1) -> %.26; // CHECK:STDOUT: // CHECK:STDOUT: extern fn @D(); // CHECK:STDOUT: @@ -1133,25 +1186,27 @@ import library "extern_api"; // CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] -// CHECK:STDOUT: %.loc52_16.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc52_16.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc52_16.3: = bound_method %.loc52_16.1, %.loc52_16.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc52: init i32 = call %.loc52_16.3(%.loc52_16.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc52_16.4: i32 = value_of_initializer %int.convert_checked.loc52 [template = constants.%.27] -// CHECK:STDOUT: %.loc52_16.5: i32 = converted %.loc52_16.1, %.loc52_16.4 [template = constants.%.27] -// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc52_16.5) +// CHECK:STDOUT: %.loc52_16.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc52_16.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc52_16.3: = bound_method %.loc52_16.1, %.loc52_16.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc52_16.4: = specific_function %.loc52_16.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc52: init %i32 = call %.loc52_16.4(%.loc52_16.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc52_16.5: %i32 = value_of_initializer %int.convert_checked.loc52 [template = constants.%.25] +// CHECK:STDOUT: %.loc52_16.6: %i32 = converted %.loc52_16.1, %.loc52_16.5 [template = constants.%.25] +// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc52_16.6) // CHECK:STDOUT: assign file.%b.var, %B.call // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] -// CHECK:STDOUT: %.loc53_23: Core.IntLiteral = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc53_23: Core.IntLiteral = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %.loc53_25.1: %tuple.type.2 = tuple_literal (%.loc53_23) -// CHECK:STDOUT: %.loc53_25.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc53_25.3: = bound_method %.loc53_23, %.loc53_25.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc53: init i32 = call %.loc53_25.3(%.loc53_23) [template = constants.%.27] -// CHECK:STDOUT: %.loc53_25.4: i32 = value_of_initializer %int.convert_checked.loc53 [template = constants.%.27] -// CHECK:STDOUT: %.loc53_25.5: i32 = converted %.loc53_23, %.loc53_25.4 [template = constants.%.27] -// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.loc53_25.5) [template = constants.%tuple] -// CHECK:STDOUT: %.loc53_25.6: %tuple.type.1 = converted %.loc53_25.1, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %C.call: init %.28 = call %C.ref(%.loc53_25.6) +// CHECK:STDOUT: %.loc53_25.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc53_25.3: = bound_method %.loc53_23, %.loc53_25.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc53_25.4: = specific_function %.loc53_25.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %.loc53_25.4(%.loc53_23) [template = constants.%.25] +// CHECK:STDOUT: %.loc53_25.5: %i32 = value_of_initializer %int.convert_checked.loc53 [template = constants.%.25] +// CHECK:STDOUT: %.loc53_25.6: %i32 = converted %.loc53_23, %.loc53_25.5 [template = constants.%.25] +// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.loc53_25.6) [template = constants.%tuple] +// CHECK:STDOUT: %.loc53_25.7: %tuple.type.1 = converted %.loc53_25.1, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %C.call: init %.26 = call %C.ref(%.loc53_25.7) // CHECK:STDOUT: assign file.%c.var, %C.call // CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D] // CHECK:STDOUT: %D.call: init %empty_tuple.type = call %D.ref() @@ -1167,10 +1222,10 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//api, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//api, inst+28, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//api, inst+51, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//api, inst+54, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+57, loaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//api, inst+36, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//api, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//api, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+67, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } @@ -1197,10 +1252,10 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_api, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//extern_api, inst+28, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//extern_api, inst+51, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//extern_api, inst+54, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+57, loaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//extern_api, inst+36, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//extern_api, inst+61, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//extern_api, inst+64, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+67, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/declaration/param_same_name.carbon b/toolchain/check/testdata/function/declaration/param_same_name.carbon index f2865fd00ac6..ff5d51f816f7 100644 --- a/toolchain/check/testdata/function/declaration/param_same_name.carbon +++ b/toolchain/check/testdata/function/declaration/param_same_name.carbon @@ -15,8 +15,10 @@ fn G(a: i32); // CHECK:STDOUT: --- param_same_name.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -25,7 +27,7 @@ fn G(a: i32); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -39,28 +41,30 @@ fn G(a: i32); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %.loc11_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.3: type = converted %int.make_type_signed, %.loc11_9.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_9.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_9.2: type = converted %int.make_type_32, %.loc13_9.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %.loc13_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_9.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_9.3: type = converted %int.make_type_signed, %.loc13_9.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%a.param_patt: i32); +// CHECK:STDOUT: fn @F(%a.param_patt: %i32); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%a.param_patt: i32); +// CHECK:STDOUT: fn @G(%a.param_patt: %i32); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index 1e2758feee5c..d1d235de90bc 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -114,23 +114,25 @@ fn D() {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.1: type = struct_type {.c: i32} [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] +// CHECK:STDOUT: %.2: type = struct_type {.c: %i32} [template] // CHECK:STDOUT: %C.type: type = fn_type @C [template] // CHECK:STDOUT: %C: %C.type = struct_value () [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %D.type: type = fn_type @D [template] // CHECK:STDOUT: %D: %D.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -147,41 +149,45 @@ fn D() {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc5_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_9.1: type = value_of_initializer %int.make_type_32.loc5_9 [template = i32] -// CHECK:STDOUT: %.loc5_9.2: type = converted %int.make_type_32.loc5_9, %.loc5_9.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_17.1: type = value_of_initializer %int.make_type_32.loc5_17 [template = i32] -// CHECK:STDOUT: %.loc5_17.2: type = converted %int.make_type_32.loc5_17, %.loc5_17.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc5_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_9: init type = call constants.%Int(%.loc5_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_9.2: type = value_of_initializer %int.make_type_signed.loc5_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_9.3: type = converted %int.make_type_signed.loc5_9, %.loc5_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_17: init type = call constants.%Int(%.loc5_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_17.2: type = value_of_initializer %int.make_type_signed.loc5_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_17.3: type = converted %int.make_type_signed.loc5_17, %.loc5_17.2 [template = constants.%i32] +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] { // CHECK:STDOUT: %c.patt: %tuple.type.2 = binding_pattern c // CHECK:STDOUT: %c.param_patt: %tuple.type.2 = value_param_pattern %c.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.1 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.1 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc6_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_14.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc6_10) -// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_32.loc6_10 [template = i32] -// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_32.loc6_10, %.loc6_14.2 [template = i32] +// CHECK:STDOUT: %.loc6_10: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_10: init type = call constants.%Int(%.loc6_10) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc6_10) +// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_signed.loc6_10 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_signed.loc6_10, %.loc6_14.2 [template = constants.%i32] // CHECK:STDOUT: %.loc6_14.4: type = converted %.loc6_14.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %int.make_type_32.loc6_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_25.1: type = value_of_initializer %int.make_type_32.loc6_25 [template = i32] -// CHECK:STDOUT: %.loc6_25.2: type = converted %int.make_type_32.loc6_25, %.loc6_25.1 [template = i32] -// CHECK:STDOUT: %.loc6_28: type = struct_type {.c: i32} [template = constants.%.1] +// CHECK:STDOUT: %.loc6_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6_25: init type = call constants.%Int(%.loc6_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_25.2: type = value_of_initializer %int.make_type_signed.loc6_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_25.3: type = converted %int.make_type_signed.loc6_25, %.loc6_25.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_28: type = struct_type {.c: %i32} [template = constants.%.2] // CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0 // CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref %.1 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.1 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: } @@ -191,20 +197,20 @@ fn D() {} // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%b.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @B(%b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: return %b.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%c.param_patt: %tuple.type.2) -> %.1 { +// CHECK:STDOUT: fn @C(%c.param_patt: %tuple.type.2) -> %.2 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %tuple.type.2 = name_ref c, %c -// CHECK:STDOUT: %.loc6_47: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc6_46: i32 = tuple_access %c.ref, element0 -// CHECK:STDOUT: %.loc6_48: %.1 = struct_literal (%.loc6_46) -// CHECK:STDOUT: %struct: %.1 = struct_value (%.loc6_46) -// CHECK:STDOUT: %.loc6_49: %.1 = converted %.loc6_48, %struct +// CHECK:STDOUT: %.loc6_47: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc6_46: %i32 = tuple_access %c.ref, element0 +// CHECK:STDOUT: %.loc6_48: %.2 = struct_literal (%.loc6_46) +// CHECK:STDOUT: %struct: %.2 = struct_value (%.loc6_46) +// CHECK:STDOUT: %.loc6_49: %.2 = converted %.loc6_48, %struct // CHECK:STDOUT: return %.loc6_49 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -241,32 +247,35 @@ fn D() {} // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] -// CHECK:STDOUT: %.28: type = struct_type {.c: i32} [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.26: type = struct_type {.c: %i32} [template] // CHECK:STDOUT: %C.type: type = fn_type @C [template] // CHECK:STDOUT: %C: %C.type = struct_value () [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (i32) [template] +// CHECK:STDOUT: %tuple.type.1: type = tuple_type (%i32) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.27) [template] +// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.25) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//fns, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//fns, inst+29, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//fns, inst+54, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, inst+65, unloaded +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//fns, inst+37, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//fns, inst+64, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, inst+75, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.5 +// CHECK:STDOUT: .Int = %import_ref.5 // CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -290,24 +299,26 @@ fn D() {} // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] -// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_32.loc8, %.loc8_13.1 [template = i32] -// CHECK:STDOUT: %.loc8_16: type = struct_type {.c: i32} [template = constants.%.28] -// CHECK:STDOUT: %c.var: ref %.28 = var c -// CHECK:STDOUT: %c: ref %.28 = bind_name c, %c.var +// CHECK:STDOUT: %.loc7_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%.loc7_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.2: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.3: type = converted %int.make_type_signed.loc7, %.loc7_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc8_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_13.2: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_13.3: type = converted %int.make_type_signed.loc8, %.loc8_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_16: type = struct_type {.c: %i32} [template = constants.%.26] +// CHECK:STDOUT: %c.var: ref %.26 = var c +// CHECK:STDOUT: %c: ref %.26 = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%b.param_patt: i32) -> i32; +// CHECK:STDOUT: fn @B(%b.param_patt: %i32) -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%c.param_patt: %tuple.type.1) -> %.28; +// CHECK:STDOUT: fn @C(%c.param_patt: %tuple.type.1) -> %.26; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -315,25 +326,27 @@ fn D() {} // CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] -// CHECK:STDOUT: %.loc7_16.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc7_16.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_16.3: = bound_method %.loc7_16.1, %.loc7_16.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc7: init i32 = call %.loc7_16.3(%.loc7_16.1) [template = constants.%.27] -// CHECK:STDOUT: %.loc7_16.4: i32 = value_of_initializer %int.convert_checked.loc7 [template = constants.%.27] -// CHECK:STDOUT: %.loc7_16.5: i32 = converted %.loc7_16.1, %.loc7_16.4 [template = constants.%.27] -// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc7_16.5) +// CHECK:STDOUT: %.loc7_16.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc7_16.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_16.3: = bound_method %.loc7_16.1, %.loc7_16.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc7_16.4: = specific_function %.loc7_16.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc7: init %i32 = call %.loc7_16.4(%.loc7_16.1) [template = constants.%.25] +// CHECK:STDOUT: %.loc7_16.5: %i32 = value_of_initializer %int.convert_checked.loc7 [template = constants.%.25] +// CHECK:STDOUT: %.loc7_16.6: %i32 = converted %.loc7_16.1, %.loc7_16.5 [template = constants.%.25] +// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc7_16.6) // CHECK:STDOUT: assign file.%b.var, %B.call // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] -// CHECK:STDOUT: %.loc8_23: Core.IntLiteral = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc8_23: Core.IntLiteral = int_value 1 [template = constants.%.2] // CHECK:STDOUT: %.loc8_25.1: %tuple.type.2 = tuple_literal (%.loc8_23) -// CHECK:STDOUT: %.loc8_25.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc8_25.3: = bound_method %.loc8_23, %.loc8_25.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc8: init i32 = call %.loc8_25.3(%.loc8_23) [template = constants.%.27] -// CHECK:STDOUT: %.loc8_25.4: i32 = value_of_initializer %int.convert_checked.loc8 [template = constants.%.27] -// CHECK:STDOUT: %.loc8_25.5: i32 = converted %.loc8_23, %.loc8_25.4 [template = constants.%.27] -// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.loc8_25.5) [template = constants.%tuple] -// CHECK:STDOUT: %.loc8_25.6: %tuple.type.1 = converted %.loc8_25.1, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %C.call: init %.28 = call %C.ref(%.loc8_25.6) +// CHECK:STDOUT: %.loc8_25.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc8_25.3: = bound_method %.loc8_23, %.loc8_25.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc8_25.4: = specific_function %.loc8_25.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %.loc8_25.4(%.loc8_23) [template = constants.%.25] +// CHECK:STDOUT: %.loc8_25.5: %i32 = value_of_initializer %int.convert_checked.loc8 [template = constants.%.25] +// CHECK:STDOUT: %.loc8_25.6: %i32 = converted %.loc8_23, %.loc8_25.5 [template = constants.%.25] +// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.loc8_25.6) [template = constants.%tuple] +// CHECK:STDOUT: %.loc8_25.7: %tuple.type.1 = converted %.loc8_25.1, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %C.call: init %.26 = call %C.ref(%.loc8_25.7) // CHECK:STDOUT: assign file.%c.var, %C.call // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -343,17 +356,19 @@ fn D() {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, inst+54, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, inst+65, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, inst+64, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, inst+75, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.5 +// CHECK:STDOUT: .Int = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -371,16 +386,18 @@ fn D() {} // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} { -// CHECK:STDOUT: %int.make_type_32.loc23_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_9.1: type = value_of_initializer %int.make_type_32.loc23_9 [template = i32] -// CHECK:STDOUT: %.loc23_9.2: type = converted %int.make_type_32.loc23_9, %.loc23_9.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc23_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_17.1: type = value_of_initializer %int.make_type_32.loc23_17 [template = i32] -// CHECK:STDOUT: %.loc23_17.2: type = converted %int.make_type_32.loc23_17, %.loc23_17.1 [template = i32] -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %.loc23_14: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc23_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc23_9: init type = call constants.%Int(%.loc23_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_9.2: type = value_of_initializer %int.make_type_signed.loc23_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_9.3: type = converted %int.make_type_signed.loc23_9, %.loc23_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc23_17: init type = call constants.%Int(%.loc23_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_17.2: type = value_of_initializer %int.make_type_signed.loc23_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_17.3: type = converted %int.make_type_signed.loc23_17, %.loc23_17.2 [template = constants.%i32] +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %.loc23_14: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -389,7 +406,7 @@ fn D() {} // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%b.param_patt: i32) -> i32; +// CHECK:STDOUT: fn @B(%b.param_patt: %i32) -> %i32; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_redecl_then_def.carbon // CHECK:STDOUT: @@ -430,8 +447,8 @@ fn D() {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//fns, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//fns, inst+29, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, inst+54, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//fns, inst+37, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, inst+64, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/function/definition/params_one.carbon b/toolchain/check/testdata/function/definition/params_one.carbon index a8566e523a18..dfc32adbcde8 100644 --- a/toolchain/check/testdata/function/definition/params_one.carbon +++ b/toolchain/check/testdata/function/definition/params_one.carbon @@ -13,15 +13,17 @@ fn Foo(a: i32) {} // CHECK:STDOUT: --- params_one.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -34,18 +36,19 @@ fn Foo(a: i32) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a.param_patt: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/params_one_comma.carbon b/toolchain/check/testdata/function/definition/params_one_comma.carbon index 1f5aee839467..0f44b67931ea 100644 --- a/toolchain/check/testdata/function/definition/params_one_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_one_comma.carbon @@ -13,15 +13,17 @@ fn Foo(a: i32,) {} // CHECK:STDOUT: --- params_one_comma.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -34,18 +36,19 @@ fn Foo(a: i32,) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a.param_patt: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/params_two.carbon b/toolchain/check/testdata/function/definition/params_two.carbon index 2d7ad786ef28..a6683aceec3c 100644 --- a/toolchain/check/testdata/function/definition/params_two.carbon +++ b/toolchain/check/testdata/function/definition/params_two.carbon @@ -13,15 +13,17 @@ fn Foo(a: i32, b: i32) {} // CHECK:STDOUT: --- params_two.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -34,25 +36,27 @@ fn Foo(a: i32, b: i32) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed.loc11_11, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%.loc11_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.2: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.3: type = converted %int.make_type_signed.loc11_19, %.loc11_19.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a.param_patt: i32, %b.param_patt: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: %i32, %b.param_patt: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/params_two_comma.carbon b/toolchain/check/testdata/function/definition/params_two_comma.carbon index 88b351134652..3636204fb7a5 100644 --- a/toolchain/check/testdata/function/definition/params_two_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_two_comma.carbon @@ -13,15 +13,17 @@ fn Foo(a: i32, b: i32,) {} // CHECK:STDOUT: --- params_two_comma.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -34,25 +36,27 @@ fn Foo(a: i32, b: i32,) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed.loc11_11, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%.loc11_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.2: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.3: type = converted %int.make_type_signed.loc11_19, %.loc11_19.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a.param_patt: i32, %b.param_patt: i32) { +// CHECK:STDOUT: fn @Foo(%a.param_patt: %i32, %b.param_patt: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 9a649bd38066..c7814af59bc3 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -199,22 +199,24 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ExplicitGenericParam.type: type = fn_type @ExplicitGenericParam [template] // CHECK:STDOUT: %ExplicitGenericParam: %ExplicitGenericParam.type = struct_value () [template] // CHECK:STDOUT: %.2: = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%T) [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type i32 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.3 [template] +// CHECK:STDOUT: %.4: type = ptr_type %i32 [template] // CHECK:STDOUT: %CallExplicitGenericParam.type: type = fn_type @CallExplicitGenericParam [template] // CHECK:STDOUT: %CallExplicitGenericParam: %CallExplicitGenericParam.type = struct_value () [template] -// CHECK:STDOUT: %.4: = specific_function %ExplicitGenericParam, @ExplicitGenericParam(i32) [template] -// CHECK:STDOUT: %.5: type = struct_type {.a: %T} [symbolic] -// CHECK:STDOUT: %.6: type = ptr_type %.5 [symbolic] +// CHECK:STDOUT: %.5: = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%i32) [template] +// CHECK:STDOUT: %.6: type = struct_type {.a: %T} [symbolic] +// CHECK:STDOUT: %.7: type = ptr_type %.6 [symbolic] // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg.type: type = fn_type @CallExplicitGenericParamWithGenericArg [template] // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg: %CallExplicitGenericParamWithGenericArg.type = struct_value () [template] -// CHECK:STDOUT: %.7: = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%.5) [symbolic] +// CHECK:STDOUT: %.8: = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%.6) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -242,29 +244,30 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %return: ref @ExplicitGenericParam.%.loc4_39.2 (%.1) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallExplicitGenericParam.decl: %CallExplicitGenericParam.type = fn_decl @CallExplicitGenericParam [template = constants.%CallExplicitGenericParam] { -// CHECK:STDOUT: %return.patt: %.3 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.3 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.4 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.4 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_37.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_37.2: type = converted %int.make_type_32.loc6, %.loc6_37.1 [template = i32] -// CHECK:STDOUT: %.loc6_37.3: type = ptr_type i32 [template = constants.%.3] -// CHECK:STDOUT: %return.param: ref %.3 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref %.3 = return_slot %return.param +// CHECK:STDOUT: %.loc6_34: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_34) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_37.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_37.2: type = converted %int.make_type_signed.loc6, %.loc6_37.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_37.3: type = ptr_type %i32 [template = constants.%.4] +// CHECK:STDOUT: %return.param: ref %.4 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %.4 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg.decl: %CallExplicitGenericParamWithGenericArg.type = fn_decl @CallExplicitGenericParamWithGenericArg [template = constants.%CallExplicitGenericParamWithGenericArg] { // CHECK:STDOUT: %T.patt.loc10_43.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_43.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc10_43.1, runtime_param [symbolic = %T.patt.loc10_43.2 (constants.%T.patt)] -// CHECK:STDOUT: %return.patt: @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.6) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.6) = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.7) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.7) = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref.loc10: type = name_ref T, %T.loc10_43.1 [symbolic = %T.loc10_43.2 (constants.%T)] -// CHECK:STDOUT: %.loc10_62.1: type = struct_type {.a: %T} [symbolic = %.loc10_62.2 (constants.%.5)] -// CHECK:STDOUT: %.loc10_63.1: type = ptr_type %.5 [symbolic = %.loc10_63.2 (constants.%.6)] +// CHECK:STDOUT: %.loc10_62.1: type = struct_type {.a: %T} [symbolic = %.loc10_62.2 (constants.%.6)] +// CHECK:STDOUT: %.loc10_63.1: type = ptr_type %.6 [symbolic = %.loc10_63.2 (constants.%.7)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc10_43.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc10_43.2 (constants.%T)] -// CHECK:STDOUT: %return.param: ref @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.6) = out_param runtime_param0 -// CHECK:STDOUT: %return: ref @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.6) = return_slot %return.param +// CHECK:STDOUT: %return.param: ref @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.7) = out_param runtime_param0 +// CHECK:STDOUT: %return: ref @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.7) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -288,37 +291,38 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallExplicitGenericParam() -> %.3 { +// CHECK:STDOUT: fn @CallExplicitGenericParam() -> %.4 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [template = constants.%ExplicitGenericParam] -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_30.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_30.2: type = converted %int.make_type_32.loc7, %.loc7_30.1 [template = i32] -// CHECK:STDOUT: %.loc7_10: = specific_function %ExplicitGenericParam.ref, @ExplicitGenericParam(i32) [template = constants.%.4] -// CHECK:STDOUT: %ExplicitGenericParam.call: init %.3 = call %.loc7_10() -// CHECK:STDOUT: %.loc7_35.1: %.3 = value_of_initializer %ExplicitGenericParam.call -// CHECK:STDOUT: %.loc7_35.2: %.3 = converted %ExplicitGenericParam.call, %.loc7_35.1 +// CHECK:STDOUT: %.loc7_31: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%.loc7_31) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_30.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_30.2: type = converted %int.make_type_signed.loc7, %.loc7_30.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_10: = specific_function %ExplicitGenericParam.ref, @ExplicitGenericParam(constants.%i32) [template = constants.%.5] +// CHECK:STDOUT: %ExplicitGenericParam.call: init %.4 = call %.loc7_10() +// CHECK:STDOUT: %.loc7_35.1: %.4 = value_of_initializer %ExplicitGenericParam.call +// CHECK:STDOUT: %.loc7_35.2: %.4 = converted %ExplicitGenericParam.call, %.loc7_35.1 // CHECK:STDOUT: return %.loc7_35.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @CallExplicitGenericParamWithGenericArg(%T.loc10_43.1: type) { // CHECK:STDOUT: %T.loc10_43.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_43.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc10_43.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_43.2 (constants.%T.patt)] -// CHECK:STDOUT: %.loc10_62.2: type = struct_type {.a: @CallExplicitGenericParamWithGenericArg.%T.loc10_43.2 (%T)} [symbolic = %.loc10_62.2 (constants.%.5)] -// CHECK:STDOUT: %.loc10_63.2: type = ptr_type @CallExplicitGenericParamWithGenericArg.%.loc10_62.2 (%.5) [symbolic = %.loc10_63.2 (constants.%.6)] +// CHECK:STDOUT: %.loc10_62.2: type = struct_type {.a: @CallExplicitGenericParamWithGenericArg.%T.loc10_43.2 (%T)} [symbolic = %.loc10_62.2 (constants.%.6)] +// CHECK:STDOUT: %.loc10_63.2: type = ptr_type @CallExplicitGenericParamWithGenericArg.%.loc10_62.2 (%.6) [symbolic = %.loc10_63.2 (constants.%.7)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc11_10.2: = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%.loc10_62.2) [symbolic = %.loc11_10.2 (constants.%.7)] +// CHECK:STDOUT: %.loc11_10.2: = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%.loc10_62.2) [symbolic = %.loc11_10.2 (constants.%.8)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.param_patt: type) -> @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.6) { +// CHECK:STDOUT: fn(%T.param_patt: type) -> @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.7) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [template = constants.%ExplicitGenericParam] // CHECK:STDOUT: %T.ref.loc11: type = name_ref T, %T.loc10_43.1 [symbolic = %T.loc10_43.2 (constants.%T)] -// CHECK:STDOUT: %.loc11_37: type = struct_type {.a: %T} [symbolic = %.loc10_62.2 (constants.%.5)] -// CHECK:STDOUT: %.loc11_10.1: = specific_function %ExplicitGenericParam.ref, @ExplicitGenericParam(constants.%.5) [symbolic = %.loc11_10.2 (constants.%.7)] -// CHECK:STDOUT: %ExplicitGenericParam.call: init @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.6) = call %.loc11_10.1() -// CHECK:STDOUT: %.loc11_39.1: @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.6) = value_of_initializer %ExplicitGenericParam.call -// CHECK:STDOUT: %.loc11_39.2: @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.6) = converted %ExplicitGenericParam.call, %.loc11_39.1 +// CHECK:STDOUT: %.loc11_37: type = struct_type {.a: %T} [symbolic = %.loc10_62.2 (constants.%.6)] +// CHECK:STDOUT: %.loc11_10.1: = specific_function %ExplicitGenericParam.ref, @ExplicitGenericParam(constants.%.6) [symbolic = %.loc11_10.2 (constants.%.8)] +// CHECK:STDOUT: %ExplicitGenericParam.call: init @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.7) = call %.loc11_10.1() +// CHECK:STDOUT: %.loc11_39.1: @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.7) = value_of_initializer %ExplicitGenericParam.call +// CHECK:STDOUT: %.loc11_39.2: @CallExplicitGenericParamWithGenericArg.%.loc10_63.2 (%.7) = converted %ExplicitGenericParam.call, %.loc11_39.1 // CHECK:STDOUT: return %.loc11_39.2 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -338,35 +342,35 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %.loc4_39.2 => constants.%.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ExplicitGenericParam(i32) { -// CHECK:STDOUT: %T.loc4_25.2 => i32 -// CHECK:STDOUT: %T.patt.loc4_25.2 => i32 -// CHECK:STDOUT: %.loc4_39.2 => constants.%.3 +// CHECK:STDOUT: specific @ExplicitGenericParam(constants.%i32) { +// CHECK:STDOUT: %T.loc4_25.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%i32 +// CHECK:STDOUT: %.loc4_39.2 => constants.%.4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc4_50.2 => constants.%.4 +// CHECK:STDOUT: %.loc4_50.2 => constants.%.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CallExplicitGenericParamWithGenericArg(constants.%T) { // CHECK:STDOUT: %T.loc10_43.2 => constants.%T // CHECK:STDOUT: %T.patt.loc10_43.2 => constants.%T -// CHECK:STDOUT: %.loc10_62.2 => constants.%.5 -// CHECK:STDOUT: %.loc10_63.2 => constants.%.6 +// CHECK:STDOUT: %.loc10_62.2 => constants.%.6 +// CHECK:STDOUT: %.loc10_63.2 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ExplicitGenericParam(constants.%.5) { -// CHECK:STDOUT: %T.loc4_25.2 => constants.%.5 -// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%.5 -// CHECK:STDOUT: %.loc4_39.2 => constants.%.6 +// CHECK:STDOUT: specific @ExplicitGenericParam(constants.%.6) { +// CHECK:STDOUT: %T.loc4_25.2 => constants.%.6 +// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%.6 +// CHECK:STDOUT: %.loc4_39.2 => constants.%.7 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc4_50.2 => constants.%.7 +// CHECK:STDOUT: %.loc4_50.2 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ExplicitGenericParam(@CallExplicitGenericParamWithGenericArg.%.loc10_62.2) { -// CHECK:STDOUT: %T.loc4_25.2 => constants.%.5 -// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%.5 -// CHECK:STDOUT: %.loc4_39.2 => constants.%.6 +// CHECK:STDOUT: %T.loc4_25.2 => constants.%.6 +// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%.6 +// CHECK:STDOUT: %.loc4_39.2 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_deduce_explicit_non_constant.carbon @@ -641,17 +645,19 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ImplicitGenericParam.type: type = fn_type @ImplicitGenericParam [template] // CHECK:STDOUT: %ImplicitGenericParam: %ImplicitGenericParam.type = struct_value () [template] // CHECK:STDOUT: %.2: = specific_function %ImplicitGenericParam, @ImplicitGenericParam(%T) [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type i32 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.3 [template] +// CHECK:STDOUT: %.4: type = ptr_type %i32 [template] // CHECK:STDOUT: %CallImplicitGenericParam.type: type = fn_type @CallImplicitGenericParam [template] // CHECK:STDOUT: %CallImplicitGenericParam: %CallImplicitGenericParam.type = struct_value () [template] -// CHECK:STDOUT: %.4: = specific_function %ImplicitGenericParam, @ImplicitGenericParam(i32) [template] +// CHECK:STDOUT: %.5: = specific_function %ImplicitGenericParam, @ImplicitGenericParam(%i32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -683,22 +689,24 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %return: ref @ImplicitGenericParam.%.loc4_45.2 (%.1) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallImplicitGenericParam.decl: %CallImplicitGenericParam.type = fn_decl @CallImplicitGenericParam [template = constants.%CallImplicitGenericParam] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.3 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.3 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.4 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.4 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc6_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_32.1: type = value_of_initializer %int.make_type_32.loc6_32 [template = i32] -// CHECK:STDOUT: %.loc6_32.2: type = converted %int.make_type_32.loc6_32, %.loc6_32.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc6_40: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_43.1: type = value_of_initializer %int.make_type_32.loc6_40 [template = i32] -// CHECK:STDOUT: %.loc6_43.2: type = converted %int.make_type_32.loc6_40, %.loc6_43.1 [template = i32] -// CHECK:STDOUT: %.loc6_43.3: type = ptr_type i32 [template = constants.%.3] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %.3 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.3 = return_slot %return.param +// CHECK:STDOUT: %.loc6_32.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc6_32: init type = call constants.%Int(%.loc6_32.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_32.2: type = value_of_initializer %int.make_type_signed.loc6_32 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_32.3: type = converted %int.make_type_signed.loc6_32, %.loc6_32.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_40: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc6_40: init type = call constants.%Int(%.loc6_40) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_43.1: type = value_of_initializer %int.make_type_signed.loc6_40 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_43.2: type = converted %int.make_type_signed.loc6_40, %.loc6_43.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_43.3: type = ptr_type %i32 [template = constants.%.4] +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %.4 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.4 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -722,14 +730,14 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallImplicitGenericParam(%n.param_patt: i32) -> %.3 { +// CHECK:STDOUT: fn @CallImplicitGenericParam(%n.param_patt: %i32) -> %.4 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %ImplicitGenericParam.ref: %ImplicitGenericParam.type = name_ref ImplicitGenericParam, file.%ImplicitGenericParam.decl [template = constants.%ImplicitGenericParam] -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n -// CHECK:STDOUT: %.loc7_10: = specific_function %ImplicitGenericParam.ref, @ImplicitGenericParam(i32) [template = constants.%.4] -// CHECK:STDOUT: %ImplicitGenericParam.call: init %.3 = call %.loc7_10(%n.ref) -// CHECK:STDOUT: %.loc7_33.1: %.3 = value_of_initializer %ImplicitGenericParam.call -// CHECK:STDOUT: %.loc7_33.2: %.3 = converted %ImplicitGenericParam.call, %.loc7_33.1 +// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n +// CHECK:STDOUT: %.loc7_10: = specific_function %ImplicitGenericParam.ref, @ImplicitGenericParam(constants.%i32) [template = constants.%.5] +// CHECK:STDOUT: %ImplicitGenericParam.call: init %.4 = call %.loc7_10(%n.ref) +// CHECK:STDOUT: %.loc7_33.1: %.4 = value_of_initializer %ImplicitGenericParam.call +// CHECK:STDOUT: %.loc7_33.2: %.4 = converted %ImplicitGenericParam.call, %.loc7_33.1 // CHECK:STDOUT: return %.loc7_33.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -748,13 +756,13 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %.loc4_45.2 => constants.%.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitGenericParam(i32) { -// CHECK:STDOUT: %T.loc4_25.2 => i32 -// CHECK:STDOUT: %T.patt.loc4_25.2 => i32 -// CHECK:STDOUT: %.loc4_45.2 => constants.%.3 +// CHECK:STDOUT: specific @ImplicitGenericParam(constants.%i32) { +// CHECK:STDOUT: %T.loc4_25.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%i32 +// CHECK:STDOUT: %.loc4_45.2 => constants.%.4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc4_56.2 => constants.%.4 +// CHECK:STDOUT: %.loc4_56.2 => constants.%.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- deduce_nested_tuple.carbon @@ -762,32 +770,35 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%T, i32) [symbolic] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%T, %i32) [symbolic] // CHECK:STDOUT: %TupleParam.type: type = fn_type @TupleParam [template] // CHECK:STDOUT: %TupleParam: %TupleParam.type = struct_value () [template] // CHECK:STDOUT: %CallTupleParam.type: type = fn_type @CallTupleParam [template] // CHECK:STDOUT: %CallTupleParam: %CallTupleParam.type = struct_value () [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %tuple.type.4: type = tuple_type (Core.IntLiteral, i32) [template] -// CHECK:STDOUT: %.4: = specific_function %TupleParam, @TupleParam(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 2 [template] -// CHECK:STDOUT: %tuple: %tuple.type.4 = tuple_value (%.2, %.31) [template] +// CHECK:STDOUT: %tuple.type.4: type = tuple_type (Core.IntLiteral, %i32) [template] +// CHECK:STDOUT: %.5: = specific_function %TupleParam, @TupleParam(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] +// CHECK:STDOUT: %tuple: %tuple.type.4 = tuple_value (%.3, %.29) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -808,10 +819,11 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %x.param_patt: @TupleParam.%tuple.type (%tuple.type.2) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_15.1 [symbolic = %T.loc4_15.2 (constants.%T)] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_35.1: %tuple.type.1 = tuple_literal (%T.ref, %int.make_type_32) -// CHECK:STDOUT: %.loc4_35.2: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_35.3: type = converted %int.make_type_32, %.loc4_35.2 [template = i32] +// CHECK:STDOUT: %.loc4_32: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_35.1: %tuple.type.1 = tuple_literal (%T.ref, %int.make_type_signed) +// CHECK:STDOUT: %.loc4_35.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_35.3: type = converted %int.make_type_signed, %.loc4_35.2 [template = constants.%i32] // CHECK:STDOUT: %.loc4_35.4: type = converted %.loc4_35.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_15.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_15.2 (constants.%T)] @@ -824,7 +836,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: generic fn @TupleParam(%T.loc4_15.1: type) { // CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_15.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc4_15.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_15.2 (constants.%T.patt)] -// CHECK:STDOUT: %tuple.type: type = tuple_type (@TupleParam.%T.loc4_15.2 (%T), i32) [symbolic = %tuple.type (constants.%tuple.type.2)] +// CHECK:STDOUT: %tuple.type: type = tuple_type (@TupleParam.%T.loc4_15.2 (%T), %i32) [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -837,18 +849,19 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: fn @CallTupleParam() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TupleParam.ref: %TupleParam.type = name_ref TupleParam, file.%TupleParam.decl [template = constants.%TupleParam] -// CHECK:STDOUT: %.loc7_15: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc7_18: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc7_15: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc7_18: Core.IntLiteral = int_value 2 [template = constants.%.4] // CHECK:STDOUT: %.loc7_19.1: %tuple.type.3 = tuple_literal (%.loc7_15, %.loc7_18) -// CHECK:STDOUT: %.loc7_3: = specific_function %TupleParam.ref, @TupleParam(Core.IntLiteral) [template = constants.%.4] -// CHECK:STDOUT: %.loc7_19.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_19.3: = bound_method %.loc7_18, %.loc7_19.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc7_19.3(%.loc7_18) [template = constants.%.31] -// CHECK:STDOUT: %.loc7_19.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.31] -// CHECK:STDOUT: %.loc7_19.5: i32 = converted %.loc7_18, %.loc7_19.4 [template = constants.%.31] -// CHECK:STDOUT: %tuple: %tuple.type.4 = tuple_value (%.loc7_15, %.loc7_19.5) [template = constants.%tuple] -// CHECK:STDOUT: %.loc7_19.6: %tuple.type.4 = converted %.loc7_19.1, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %TupleParam.call: init %empty_tuple.type = call %.loc7_3(%.loc7_19.6) +// CHECK:STDOUT: %.loc7_3: = specific_function %TupleParam.ref, @TupleParam(Core.IntLiteral) [template = constants.%.5] +// CHECK:STDOUT: %.loc7_19.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_19.3: = bound_method %.loc7_18, %.loc7_19.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc7_19.4: = specific_function %.loc7_19.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc7_19.4(%.loc7_18) [template = constants.%.29] +// CHECK:STDOUT: %.loc7_19.5: %i32 = value_of_initializer %int.convert_checked [template = constants.%.29] +// CHECK:STDOUT: %.loc7_19.6: %i32 = converted %.loc7_18, %.loc7_19.5 [template = constants.%.29] +// CHECK:STDOUT: %tuple: %tuple.type.4 = tuple_value (%.loc7_15, %.loc7_19.6) [template = constants.%tuple] +// CHECK:STDOUT: %.loc7_19.7: %tuple.type.4 = converted %.loc7_19.1, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %TupleParam.call: init %empty_tuple.type = call %.loc7_3(%.loc7_19.7) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -871,31 +884,34 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: %T, .b: i32} [symbolic] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %T, .b: %i32} [symbolic] // CHECK:STDOUT: %StructParam.type: type = fn_type @StructParam [template] // CHECK:STDOUT: %StructParam: %StructParam.type = struct_value () [template] // CHECK:STDOUT: %CallStructParam.type: type = fn_type @CallStructParam [template] // CHECK:STDOUT: %CallStructParam: %CallStructParam.type = struct_value () [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.5: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %.6: type = struct_type {.a: Core.IntLiteral, .b: i32} [template] -// CHECK:STDOUT: %.7: = specific_function %StructParam, @StructParam(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.33: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 2 [template] -// CHECK:STDOUT: %struct: %.6 = struct_value (%.3, %.34) [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.6: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %.7: type = struct_type {.a: Core.IntLiteral, .b: %i32} [template] +// CHECK:STDOUT: %.8: = specific_function %StructParam, @StructParam(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.29: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 2 [template] +// CHECK:STDOUT: %struct: %.7 = struct_value (%.4, %.32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -912,18 +928,19 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %StructParam.decl: %StructParam.type = fn_decl @StructParam [template = constants.%StructParam] { // CHECK:STDOUT: %T.patt.loc4_16.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_16.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_16.1, runtime_param [symbolic = %T.patt.loc4_16.2 (constants.%T.patt)] -// CHECK:STDOUT: %x.patt: @StructParam.%.loc4_44.2 (%.1) = binding_pattern x -// CHECK:STDOUT: %x.param_patt: @StructParam.%.loc4_44.2 (%.1) = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %x.patt: @StructParam.%.loc4_44.2 (%.2) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @StructParam.%.loc4_44.2 (%.2) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.1 [symbolic = %T.loc4_16.2 (constants.%T)] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_41.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_41.2: type = converted %int.make_type_32, %.loc4_41.1 [template = i32] -// CHECK:STDOUT: %.loc4_44.1: type = struct_type {.a: %T, .b: i32} [symbolic = %.loc4_44.2 (constants.%.1)] +// CHECK:STDOUT: %.loc4_41.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_41.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_41.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_41.3: type = converted %int.make_type_signed, %.loc4_41.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_44.1: type = struct_type {.a: %T, .b: %i32} [symbolic = %.loc4_44.2 (constants.%.2)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_16.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @StructParam.%.loc4_44.2 (%.1) = value_param runtime_param0 -// CHECK:STDOUT: %x: @StructParam.%.loc4_44.2 (%.1) = bind_name x, %x.param +// CHECK:STDOUT: %x.param: @StructParam.%.loc4_44.2 (%.2) = value_param runtime_param0 +// CHECK:STDOUT: %x: @StructParam.%.loc4_44.2 (%.2) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallStructParam.decl: %CallStructParam.type = fn_decl @CallStructParam [template = constants.%CallStructParam] {} {} // CHECK:STDOUT: } @@ -931,11 +948,11 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: generic fn @StructParam(%T.loc4_16.1: type) { // CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc4_16.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_16.2 (constants.%T.patt)] -// CHECK:STDOUT: %.loc4_44.2: type = struct_type {.a: @StructParam.%T.loc4_16.2 (%T), .b: i32} [symbolic = %.loc4_44.2 (constants.%.1)] +// CHECK:STDOUT: %.loc4_44.2: type = struct_type {.a: @StructParam.%T.loc4_16.2 (%T), .b: %i32} [symbolic = %.loc4_44.2 (constants.%.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @StructParam.%.loc4_44.2 (%.1)) { +// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @StructParam.%.loc4_44.2 (%.2)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -944,31 +961,32 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: fn @CallStructParam() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %StructParam.ref: %StructParam.type = name_ref StructParam, file.%StructParam.decl [template = constants.%StructParam] -// CHECK:STDOUT: %.loc7_21: Core.IntLiteral = int_value 1 [template = constants.%.3] -// CHECK:STDOUT: %.loc7_29: Core.IntLiteral = int_value 2 [template = constants.%.4] -// CHECK:STDOUT: %.loc7_30.1: %.5 = struct_literal (%.loc7_21, %.loc7_29) -// CHECK:STDOUT: %.loc7_3: = specific_function %StructParam.ref, @StructParam(Core.IntLiteral) [template = constants.%.7] -// CHECK:STDOUT: %.loc7_30.2: %Convert.type.2 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_30.3: = bound_method %.loc7_29, %.loc7_30.2 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc7_30.3(%.loc7_29) [template = constants.%.34] -// CHECK:STDOUT: %.loc7_30.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.34] -// CHECK:STDOUT: %.loc7_30.5: i32 = converted %.loc7_29, %.loc7_30.4 [template = constants.%.34] -// CHECK:STDOUT: %struct: %.6 = struct_value (%.loc7_21, %.loc7_30.5) [template = constants.%struct] -// CHECK:STDOUT: %.loc7_30.6: %.6 = converted %.loc7_30.1, %struct [template = constants.%struct] -// CHECK:STDOUT: %StructParam.call: init %empty_tuple.type = call %.loc7_3(%.loc7_30.6) +// CHECK:STDOUT: %.loc7_21: Core.IntLiteral = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc7_29: Core.IntLiteral = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc7_30.1: %.6 = struct_literal (%.loc7_21, %.loc7_29) +// CHECK:STDOUT: %.loc7_3: = specific_function %StructParam.ref, @StructParam(Core.IntLiteral) [template = constants.%.8] +// CHECK:STDOUT: %.loc7_30.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_30.3: = bound_method %.loc7_29, %.loc7_30.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc7_30.4: = specific_function %.loc7_30.3, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc7_30.4(%.loc7_29) [template = constants.%.32] +// CHECK:STDOUT: %.loc7_30.5: %i32 = value_of_initializer %int.convert_checked [template = constants.%.32] +// CHECK:STDOUT: %.loc7_30.6: %i32 = converted %.loc7_29, %.loc7_30.5 [template = constants.%.32] +// CHECK:STDOUT: %struct: %.7 = struct_value (%.loc7_21, %.loc7_30.6) [template = constants.%struct] +// CHECK:STDOUT: %.loc7_30.7: %.7 = converted %.loc7_30.1, %struct [template = constants.%struct] +// CHECK:STDOUT: %StructParam.call: init %empty_tuple.type = call %.loc7_3(%.loc7_30.7) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @StructParam(constants.%T) { // CHECK:STDOUT: %T.loc4_16.2 => constants.%T // CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T -// CHECK:STDOUT: %.loc4_44.2 => constants.%.1 +// CHECK:STDOUT: %.loc4_44.2 => constants.%.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @StructParam(Core.IntLiteral) { // CHECK:STDOUT: %T.loc4_16.2 => Core.IntLiteral // CHECK:STDOUT: %T.patt.loc4_16.2 => Core.IntLiteral -// CHECK:STDOUT: %.loc4_44.2 => constants.%.6 +// CHECK:STDOUT: %.loc4_44.2 => constants.%.7 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -978,21 +996,23 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.c: %T, .d: i32, .e: i32} [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.c: %T, .d: %i32, .e: %i32} [symbolic] // CHECK:STDOUT: %BigStructParam.type: type = fn_type @BigStructParam [template] // CHECK:STDOUT: %BigStructParam: %BigStructParam.type = struct_value () [template] // CHECK:STDOUT: %CallBigStructParam.type: type = fn_type @CallBigStructParam [template] // CHECK:STDOUT: %CallBigStructParam: %CallBigStructParam.type = struct_value () [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %.5: type = struct_type {.c: Core.IntLiteral, .d: Core.IntLiteral} [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.6: type = struct_type {.c: Core.IntLiteral, .d: Core.IntLiteral} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1008,21 +1028,23 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %BigStructParam.decl: %BigStructParam.type = fn_decl @BigStructParam [template = constants.%BigStructParam] { // CHECK:STDOUT: %T.patt.loc4_19.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_19.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_19.1, runtime_param [symbolic = %T.patt.loc4_19.2 (constants.%T.patt)] -// CHECK:STDOUT: %x.patt: @BigStructParam.%.loc4_56.2 (%.1) = binding_pattern x -// CHECK:STDOUT: %x.param_patt: @BigStructParam.%.loc4_56.2 (%.1) = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %x.patt: @BigStructParam.%.loc4_56.2 (%.2) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @BigStructParam.%.loc4_56.2 (%.2) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_19.1 [symbolic = %T.loc4_19.2 (constants.%T)] -// CHECK:STDOUT: %int.make_type_32.loc4_44: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_44.1: type = value_of_initializer %int.make_type_32.loc4_44 [template = i32] -// CHECK:STDOUT: %.loc4_44.2: type = converted %int.make_type_32.loc4_44, %.loc4_44.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_53: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_53.1: type = value_of_initializer %int.make_type_32.loc4_53 [template = i32] -// CHECK:STDOUT: %.loc4_53.2: type = converted %int.make_type_32.loc4_53, %.loc4_53.1 [template = i32] -// CHECK:STDOUT: %.loc4_56.1: type = struct_type {.c: %T, .d: i32, .e: i32} [symbolic = %.loc4_56.2 (constants.%.1)] +// CHECK:STDOUT: %.loc4_44.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_44: init type = call constants.%Int(%.loc4_44.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_44.2: type = value_of_initializer %int.make_type_signed.loc4_44 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_44.3: type = converted %int.make_type_signed.loc4_44, %.loc4_44.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_53.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_53: init type = call constants.%Int(%.loc4_53.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_53.2: type = value_of_initializer %int.make_type_signed.loc4_53 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_53.3: type = converted %int.make_type_signed.loc4_53, %.loc4_53.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_56.1: type = struct_type {.c: %T, .d: %i32, .e: %i32} [symbolic = %.loc4_56.2 (constants.%.2)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_19.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_19.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @BigStructParam.%.loc4_56.2 (%.1) = value_param runtime_param0 -// CHECK:STDOUT: %x: @BigStructParam.%.loc4_56.2 (%.1) = bind_name x, %x.param +// CHECK:STDOUT: %x.param: @BigStructParam.%.loc4_56.2 (%.2) = value_param runtime_param0 +// CHECK:STDOUT: %x: @BigStructParam.%.loc4_56.2 (%.2) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallBigStructParam.decl: %CallBigStructParam.type = fn_decl @CallBigStructParam [template = constants.%CallBigStructParam] {} {} // CHECK:STDOUT: } @@ -1030,11 +1052,11 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: generic fn @BigStructParam(%T.loc4_19.1: type) { // CHECK:STDOUT: %T.loc4_19.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_19.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc4_19.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_19.2 (constants.%T.patt)] -// CHECK:STDOUT: %.loc4_56.2: type = struct_type {.c: @BigStructParam.%T.loc4_19.2 (%T), .d: i32, .e: i32} [symbolic = %.loc4_56.2 (constants.%.1)] +// CHECK:STDOUT: %.loc4_56.2: type = struct_type {.c: @BigStructParam.%T.loc4_19.2 (%T), .d: %i32, .e: %i32} [symbolic = %.loc4_56.2 (constants.%.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @BigStructParam.%.loc4_56.2 (%.1)) { +// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @BigStructParam.%.loc4_56.2 (%.2)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1043,16 +1065,16 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: fn @CallBigStructParam() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BigStructParam.ref: %BigStructParam.type = name_ref BigStructParam, file.%BigStructParam.decl [template = constants.%BigStructParam] -// CHECK:STDOUT: %.loc14_24: Core.IntLiteral = int_value 3 [template = constants.%.3] -// CHECK:STDOUT: %.loc14_32: Core.IntLiteral = int_value 4 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_33: %.5 = struct_literal (%.loc14_24, %.loc14_32) +// CHECK:STDOUT: %.loc14_24: Core.IntLiteral = int_value 3 [template = constants.%.4] +// CHECK:STDOUT: %.loc14_32: Core.IntLiteral = int_value 4 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_33: %.6 = struct_literal (%.loc14_24, %.loc14_32) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @BigStructParam(constants.%T) { // CHECK:STDOUT: %T.loc4_19.2 => constants.%T // CHECK:STDOUT: %T.patt.loc4_19.2 => constants.%T -// CHECK:STDOUT: %.loc4_56.2 => constants.%.1 +// CHECK:STDOUT: %.loc4_56.2 => constants.%.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_deduce_smaller_struct.carbon @@ -1060,22 +1082,24 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.f: %T, .g: i32} [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.f: %T, .g: %i32} [symbolic] // CHECK:STDOUT: %SmallStructParam.type: type = fn_type @SmallStructParam [template] // CHECK:STDOUT: %SmallStructParam: %SmallStructParam.type = struct_value () [template] // CHECK:STDOUT: %CallSmallStructParam.type: type = fn_type @CallSmallStructParam [template] // CHECK:STDOUT: %CallSmallStructParam: %CallSmallStructParam.type = struct_value () [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 6 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 7 [template] -// CHECK:STDOUT: %.6: type = struct_type {.f: Core.IntLiteral, .g: Core.IntLiteral, .h: Core.IntLiteral} [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 7 [template] +// CHECK:STDOUT: %.7: type = struct_type {.f: Core.IntLiteral, .g: Core.IntLiteral, .h: Core.IntLiteral} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1091,18 +1115,19 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %SmallStructParam.decl: %SmallStructParam.type = fn_decl @SmallStructParam [template = constants.%SmallStructParam] { // CHECK:STDOUT: %T.patt.loc4_21.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_21.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_21.1, runtime_param [symbolic = %T.patt.loc4_21.2 (constants.%T.patt)] -// CHECK:STDOUT: %x.patt: @SmallStructParam.%.loc4_49.2 (%.1) = binding_pattern x -// CHECK:STDOUT: %x.param_patt: @SmallStructParam.%.loc4_49.2 (%.1) = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %x.patt: @SmallStructParam.%.loc4_49.2 (%.2) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @SmallStructParam.%.loc4_49.2 (%.2) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_21.1 [symbolic = %T.loc4_21.2 (constants.%T)] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_46.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_46.2: type = converted %int.make_type_32, %.loc4_46.1 [template = i32] -// CHECK:STDOUT: %.loc4_49.1: type = struct_type {.f: %T, .g: i32} [symbolic = %.loc4_49.2 (constants.%.1)] +// CHECK:STDOUT: %.loc4_46.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_46.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_46.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_46.3: type = converted %int.make_type_signed, %.loc4_46.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_49.1: type = struct_type {.f: %T, .g: %i32} [symbolic = %.loc4_49.2 (constants.%.2)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_21.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_21.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @SmallStructParam.%.loc4_49.2 (%.1) = value_param runtime_param0 -// CHECK:STDOUT: %x: @SmallStructParam.%.loc4_49.2 (%.1) = bind_name x, %x.param +// CHECK:STDOUT: %x.param: @SmallStructParam.%.loc4_49.2 (%.2) = value_param runtime_param0 +// CHECK:STDOUT: %x: @SmallStructParam.%.loc4_49.2 (%.2) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallSmallStructParam.decl: %CallSmallStructParam.type = fn_decl @CallSmallStructParam [template = constants.%CallSmallStructParam] {} {} // CHECK:STDOUT: } @@ -1110,11 +1135,11 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: generic fn @SmallStructParam(%T.loc4_21.1: type) { // CHECK:STDOUT: %T.loc4_21.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_21.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc4_21.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_21.2 (constants.%T.patt)] -// CHECK:STDOUT: %.loc4_49.2: type = struct_type {.f: @SmallStructParam.%T.loc4_21.2 (%T), .g: i32} [symbolic = %.loc4_49.2 (constants.%.1)] +// CHECK:STDOUT: %.loc4_49.2: type = struct_type {.f: @SmallStructParam.%T.loc4_21.2 (%T), .g: %i32} [symbolic = %.loc4_49.2 (constants.%.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @SmallStructParam.%.loc4_49.2 (%.1)) { +// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @SmallStructParam.%.loc4_49.2 (%.2)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1123,17 +1148,17 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: fn @CallSmallStructParam() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %SmallStructParam.ref: %SmallStructParam.type = name_ref SmallStructParam, file.%SmallStructParam.decl [template = constants.%SmallStructParam] -// CHECK:STDOUT: %.loc14_26: Core.IntLiteral = int_value 5 [template = constants.%.3] -// CHECK:STDOUT: %.loc14_34: Core.IntLiteral = int_value 6 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_42: Core.IntLiteral = int_value 7 [template = constants.%.5] -// CHECK:STDOUT: %.loc14_43: %.6 = struct_literal (%.loc14_26, %.loc14_34, %.loc14_42) +// CHECK:STDOUT: %.loc14_26: Core.IntLiteral = int_value 5 [template = constants.%.4] +// CHECK:STDOUT: %.loc14_34: Core.IntLiteral = int_value 6 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_42: Core.IntLiteral = int_value 7 [template = constants.%.6] +// CHECK:STDOUT: %.loc14_43: %.7 = struct_literal (%.loc14_26, %.loc14_34, %.loc14_42) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @SmallStructParam(constants.%T) { // CHECK:STDOUT: %T.loc4_21.2 => constants.%T // CHECK:STDOUT: %T.patt.loc4_21.2 => constants.%T -// CHECK:STDOUT: %.loc4_49.2 => constants.%.1 +// CHECK:STDOUT: %.loc4_49.2 => constants.%.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_deduce_struct_wrong_name.carbon @@ -1141,21 +1166,23 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.i: %T, .different: i32} [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.i: %T, .different: %i32} [symbolic] // CHECK:STDOUT: %WrongNameStructParam.type: type = fn_type @WrongNameStructParam [template] // CHECK:STDOUT: %WrongNameStructParam: %WrongNameStructParam.type = struct_value () [template] // CHECK:STDOUT: %CallWrongNameStructParam.type: type = fn_type @CallWrongNameStructParam [template] // CHECK:STDOUT: %CallWrongNameStructParam: %CallWrongNameStructParam.type = struct_value () [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 8 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 9 [template] -// CHECK:STDOUT: %.5: type = struct_type {.i: Core.IntLiteral, .j: Core.IntLiteral} [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 8 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 9 [template] +// CHECK:STDOUT: %.6: type = struct_type {.i: Core.IntLiteral, .j: Core.IntLiteral} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1171,18 +1198,19 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %WrongNameStructParam.decl: %WrongNameStructParam.type = fn_decl @WrongNameStructParam [template = constants.%WrongNameStructParam] { // CHECK:STDOUT: %T.patt.loc4_25.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_25.1, runtime_param [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)] -// CHECK:STDOUT: %x.patt: @WrongNameStructParam.%.loc4_61.2 (%.1) = binding_pattern x -// CHECK:STDOUT: %x.param_patt: @WrongNameStructParam.%.loc4_61.2 (%.1) = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %x.patt: @WrongNameStructParam.%.loc4_61.2 (%.2) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @WrongNameStructParam.%.loc4_61.2 (%.2) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_58.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_58.2: type = converted %int.make_type_32, %.loc4_58.1 [template = i32] -// CHECK:STDOUT: %.loc4_61.1: type = struct_type {.i: %T, .different: i32} [symbolic = %.loc4_61.2 (constants.%.1)] +// CHECK:STDOUT: %.loc4_58.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_58.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_58.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_58.3: type = converted %int.make_type_signed, %.loc4_58.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_61.1: type = struct_type {.i: %T, .different: %i32} [symbolic = %.loc4_61.2 (constants.%.2)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_25.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @WrongNameStructParam.%.loc4_61.2 (%.1) = value_param runtime_param0 -// CHECK:STDOUT: %x: @WrongNameStructParam.%.loc4_61.2 (%.1) = bind_name x, %x.param +// CHECK:STDOUT: %x.param: @WrongNameStructParam.%.loc4_61.2 (%.2) = value_param runtime_param0 +// CHECK:STDOUT: %x: @WrongNameStructParam.%.loc4_61.2 (%.2) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallWrongNameStructParam.decl: %CallWrongNameStructParam.type = fn_decl @CallWrongNameStructParam [template = constants.%CallWrongNameStructParam] {} {} // CHECK:STDOUT: } @@ -1190,11 +1218,11 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: generic fn @WrongNameStructParam(%T.loc4_25.1: type) { // CHECK:STDOUT: %T.loc4_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc4_25.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)] -// CHECK:STDOUT: %.loc4_61.2: type = struct_type {.i: @WrongNameStructParam.%T.loc4_25.2 (%T), .different: i32} [symbolic = %.loc4_61.2 (constants.%.1)] +// CHECK:STDOUT: %.loc4_61.2: type = struct_type {.i: @WrongNameStructParam.%T.loc4_25.2 (%T), .different: %i32} [symbolic = %.loc4_61.2 (constants.%.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @WrongNameStructParam.%.loc4_61.2 (%.1)) { +// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @WrongNameStructParam.%.loc4_61.2 (%.2)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1203,16 +1231,16 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: fn @CallWrongNameStructParam() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %WrongNameStructParam.ref: %WrongNameStructParam.type = name_ref WrongNameStructParam, file.%WrongNameStructParam.decl [template = constants.%WrongNameStructParam] -// CHECK:STDOUT: %.loc14_30: Core.IntLiteral = int_value 8 [template = constants.%.3] -// CHECK:STDOUT: %.loc14_38: Core.IntLiteral = int_value 9 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_39: %.5 = struct_literal (%.loc14_30, %.loc14_38) +// CHECK:STDOUT: %.loc14_30: Core.IntLiteral = int_value 8 [template = constants.%.4] +// CHECK:STDOUT: %.loc14_38: Core.IntLiteral = int_value 9 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_39: %.6 = struct_literal (%.loc14_30, %.loc14_38) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @WrongNameStructParam(constants.%T) { // CHECK:STDOUT: %T.loc4_25.2 => constants.%T // CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%T -// CHECK:STDOUT: %.loc4_61.2 => constants.%.1 +// CHECK:STDOUT: %.loc4_61.2 => constants.%.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_deduce_struct_wrong_order.carbon @@ -1220,21 +1248,23 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.first: %T, .second: i32} [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.first: %T, .second: %i32} [symbolic] // CHECK:STDOUT: %WrongOrderStructParam.type: type = fn_type @WrongOrderStructParam [template] // CHECK:STDOUT: %WrongOrderStructParam: %WrongOrderStructParam.type = struct_value () [template] // CHECK:STDOUT: %CallWrongOrderStructParam.type: type = fn_type @CallWrongOrderStructParam [template] // CHECK:STDOUT: %CallWrongOrderStructParam: %CallWrongOrderStructParam.type = struct_value () [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 11 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 10 [template] -// CHECK:STDOUT: %.5: type = struct_type {.second: Core.IntLiteral, .first: Core.IntLiteral} [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 11 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 10 [template] +// CHECK:STDOUT: %.6: type = struct_type {.second: Core.IntLiteral, .first: Core.IntLiteral} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1250,18 +1280,19 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %WrongOrderStructParam.decl: %WrongOrderStructParam.type = fn_decl @WrongOrderStructParam [template = constants.%WrongOrderStructParam] { // CHECK:STDOUT: %T.patt.loc4_26.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_26.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_26.1, runtime_param [symbolic = %T.patt.loc4_26.2 (constants.%T.patt)] -// CHECK:STDOUT: %x.patt: @WrongOrderStructParam.%.loc4_63.2 (%.1) = binding_pattern x -// CHECK:STDOUT: %x.param_patt: @WrongOrderStructParam.%.loc4_63.2 (%.1) = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %x.patt: @WrongOrderStructParam.%.loc4_63.2 (%.2) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @WrongOrderStructParam.%.loc4_63.2 (%.2) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_26.1 [symbolic = %T.loc4_26.2 (constants.%T)] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_60.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_60.2: type = converted %int.make_type_32, %.loc4_60.1 [template = i32] -// CHECK:STDOUT: %.loc4_63.1: type = struct_type {.first: %T, .second: i32} [symbolic = %.loc4_63.2 (constants.%.1)] +// CHECK:STDOUT: %.loc4_60.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_60.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_60.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_60.3: type = converted %int.make_type_signed, %.loc4_60.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_63.1: type = struct_type {.first: %T, .second: %i32} [symbolic = %.loc4_63.2 (constants.%.2)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_26.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_26.2 (constants.%T)] -// CHECK:STDOUT: %x.param: @WrongOrderStructParam.%.loc4_63.2 (%.1) = value_param runtime_param0 -// CHECK:STDOUT: %x: @WrongOrderStructParam.%.loc4_63.2 (%.1) = bind_name x, %x.param +// CHECK:STDOUT: %x.param: @WrongOrderStructParam.%.loc4_63.2 (%.2) = value_param runtime_param0 +// CHECK:STDOUT: %x: @WrongOrderStructParam.%.loc4_63.2 (%.2) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallWrongOrderStructParam.decl: %CallWrongOrderStructParam.type = fn_decl @CallWrongOrderStructParam [template = constants.%CallWrongOrderStructParam] {} {} // CHECK:STDOUT: } @@ -1269,11 +1300,11 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: generic fn @WrongOrderStructParam(%T.loc4_26.1: type) { // CHECK:STDOUT: %T.loc4_26.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_26.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc4_26.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_26.2 (constants.%T.patt)] -// CHECK:STDOUT: %.loc4_63.2: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_26.2 (%T), .second: i32} [symbolic = %.loc4_63.2 (constants.%.1)] +// CHECK:STDOUT: %.loc4_63.2: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_26.2 (%T), .second: %i32} [symbolic = %.loc4_63.2 (constants.%.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @WrongOrderStructParam.%.loc4_63.2 (%.1)) { +// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @WrongOrderStructParam.%.loc4_63.2 (%.2)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1282,16 +1313,16 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: fn @CallWrongOrderStructParam() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %WrongOrderStructParam.ref: %WrongOrderStructParam.type = name_ref WrongOrderStructParam, file.%WrongOrderStructParam.decl [template = constants.%WrongOrderStructParam] -// CHECK:STDOUT: %.loc14_36: Core.IntLiteral = int_value 11 [template = constants.%.3] -// CHECK:STDOUT: %.loc14_49: Core.IntLiteral = int_value 10 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_51: %.5 = struct_literal (%.loc14_36, %.loc14_49) +// CHECK:STDOUT: %.loc14_36: Core.IntLiteral = int_value 11 [template = constants.%.4] +// CHECK:STDOUT: %.loc14_49: Core.IntLiteral = int_value 10 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_51: %.6 = struct_literal (%.loc14_36, %.loc14_49) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @WrongOrderStructParam(constants.%T) { // CHECK:STDOUT: %T.loc4_26.2 => constants.%T // CHECK:STDOUT: %T.patt.loc4_26.2 => constants.%T -// CHECK:STDOUT: %.loc4_63.2 => constants.%.1 +// CHECK:STDOUT: %.loc4_63.2 => constants.%.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_deduce_incomplete.carbon diff --git a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon index fca7c495dbea..ed6fc023d30d 100644 --- a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon +++ b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon @@ -16,23 +16,26 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: --- fail_todo_param_in_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt.1: i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.24: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.25: = bound_method %N.1, %Convert.15 [symbolic] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.25(%N.1) [symbolic] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.4, @impl.3(%.1) [template] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] +// CHECK:STDOUT: %.19: = interface_witness (%Convert.13) [template] +// CHECK:STDOUT: %.20: = bound_method %N.1, %Convert.13 [symbolic] +// CHECK:STDOUT: %.21: = specific_function %.20, @Convert.4(%.1) [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.21(%N.1) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -46,45 +49,50 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt.loc14_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc14_6.1, runtime_param [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc14_6.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc14_6.1, runtime_param [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.1)] // CHECK:STDOUT: %a.patt: = binding_pattern a // CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc14_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32.loc14_10 [template = i32] -// CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_32.loc14_10, %.loc14_10.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %N.ref: i32 = name_ref N, %N.loc14_6.1 [symbolic = %N.loc14_6.2 (constants.%N.1)] -// CHECK:STDOUT: %.loc14_19.1: type = value_of_initializer %int.make_type_32.loc14_19 [template = i32] -// CHECK:STDOUT: %.loc14_19.2: type = converted %int.make_type_32.loc14_19, %.loc14_19.1 [template = i32] -// CHECK:STDOUT: %.loc14_24.1: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_24.2: = bound_method %N.ref, %.loc14_24.1 [symbolic = %.loc14_24.5 (constants.%.25)] -// CHECK:STDOUT: %int.convert_checked.loc14_24.1: init Core.IntLiteral = call %.loc14_24.2(%N.ref) [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc14_24.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_24.1 [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc14_24.4: Core.IntLiteral = converted %N.ref, %.loc14_24.3 [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc14_25: type = array_type %.loc14_24.4, i32 [template = ] +// CHECK:STDOUT: %.loc14_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_10: init type = call constants.%Int(%.loc14_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_10.2: type = value_of_initializer %int.make_type_signed.loc14_10 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_10.3: type = converted %int.make_type_signed.loc14_10, %.loc14_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_19: init type = call constants.%Int(%.loc14_19.1) [template = constants.%i32] +// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc14_6.1 [symbolic = %N.loc14_6.2 (constants.%N.1)] +// CHECK:STDOUT: %.loc14_19.2: type = value_of_initializer %int.make_type_signed.loc14_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_19.3: type = converted %int.make_type_signed.loc14_19, %.loc14_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.1: %Convert.type.2 = interface_witness_access constants.%.19, element0 [template = constants.%Convert.13] +// CHECK:STDOUT: %.loc14_24.2: = bound_method %N.ref, %.loc14_24.1 [symbolic = %.loc14_24.6 (constants.%.20)] +// CHECK:STDOUT: %.loc14_24.3: = specific_function %.loc14_24.2, @Convert.4(constants.%.1) [symbolic = %.loc14_24.7 (constants.%.21)] +// CHECK:STDOUT: %int.convert_checked.loc14_24.1: init Core.IntLiteral = call %.loc14_24.3(%N.ref) [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc14_24.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_24.1 [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc14_24.5: Core.IntLiteral = converted %N.ref, %.loc14_24.4 [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc14_25: type = array_type %.loc14_24.5, %i32 [template = ] // CHECK:STDOUT: %.loc14_26: type = ptr_type [template = ] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc14_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc14_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_6.2 (constants.%N.1)] // CHECK:STDOUT: %a.param: = value_param runtime_param0 // CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%N.loc14_6.1: i32) { -// CHECK:STDOUT: %N.loc14_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc14_6.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc14_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %.loc14_24.5: = bound_method %N.loc14_6.2, constants.%Convert.15 [symbolic = %.loc14_24.5 (constants.%.25)] -// CHECK:STDOUT: %int.convert_checked.loc14_24.2: init Core.IntLiteral = call %.loc14_24.5(%N.loc14_6.2) [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: generic fn @F(%N.loc14_6.1: %i32) { +// CHECK:STDOUT: %N.loc14_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc14_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc14_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %.loc14_24.6: = bound_method %N.loc14_6.2, constants.%Convert.13 [symbolic = %.loc14_24.6 (constants.%.20)] +// CHECK:STDOUT: %.loc14_24.7: = specific_function %.loc14_24.6, @Convert.4(constants.%.1) [symbolic = %.loc14_24.7 (constants.%.21)] +// CHECK:STDOUT: %int.convert_checked.loc14_24.2: init Core.IntLiteral = call %.loc14_24.7(%N.loc14_6.2) [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%N.param_patt: i32, %a.param_patt: ); +// CHECK:STDOUT: fn(%N.param_patt: %i32, %a.param_patt: ); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N.1) { // CHECK:STDOUT: %N.loc14_6.2 => constants.%N.1 // CHECK:STDOUT: %N.patt.loc14_6.2 => constants.%N.1 -// CHECK:STDOUT: %.loc14_24.5 => constants.%.25 +// CHECK:STDOUT: %.loc14_24.6 => constants.%.20 +// CHECK:STDOUT: %.loc14_24.7 => constants.%.21 // CHECK:STDOUT: %int.convert_checked.loc14_24.2 => constants.%int.convert_checked // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index 391ad8477a91..7dcb60f4c651 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -39,11 +39,11 @@ fn CallNegative() { // CHECK:STDOUT: %ErrorIfNIsZero: %ErrorIfNIsZero.type = struct_value () [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %CallNegative.type: type = fn_type @CallNegative [template] // CHECK:STDOUT: %CallNegative: %CallNegative.type = struct_value () [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.3: = specific_function %ErrorIfNIsZero, @ErrorIfNIsZero(%.2) [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.2: = specific_function %ErrorIfNIsZero, @ErrorIfNIsZero(%.1) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -54,7 +54,7 @@ fn CallNegative() { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types, inst+7, loaded [template = constants.%IntLiteral] -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types, inst+30, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types, inst+23, loaded [template = constants.%Int] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -84,18 +84,18 @@ fn CallNegative() { // CHECK:STDOUT: %N.patt.loc4_19.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc12_18: type = int_type signed, %N.loc4_19.2 [symbolic = %.loc12_18 (constants.%.1)] +// CHECK:STDOUT: %iN: type = int_type signed, %N.loc4_19.2 [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Core.ref.loc12: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc4_19.1 [symbolic = %N.loc4_19.2 (constants.%N)] -// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%N.ref) [symbolic = %.loc12_18 (constants.%.1)] -// CHECK:STDOUT: %.loc12_20.1: type = value_of_initializer %int.make_type_signed [symbolic = %.loc12_18 (constants.%.1)] -// CHECK:STDOUT: %.loc12_20.2: type = converted %int.make_type_signed, %.loc12_20.1 [symbolic = %.loc12_18 (constants.%.1)] -// CHECK:STDOUT: %v.var: ref @ErrorIfNIsZero.%.loc12_18 (%.1) = var v -// CHECK:STDOUT: %v: ref @ErrorIfNIsZero.%.loc12_18 (%.1) = bind_name v, %v.var +// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%N.ref) [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %.loc12_20.1: type = value_of_initializer %int.make_type_signed [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %.loc12_20.2: type = converted %int.make_type_signed, %.loc12_20.1 [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %v.var: ref @ErrorIfNIsZero.%iN (%iN) = var v +// CHECK:STDOUT: %v: ref @ErrorIfNIsZero.%iN (%iN) = bind_name v, %v.var // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -103,8 +103,8 @@ fn CallNegative() { // CHECK:STDOUT: fn @CallNegative() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %ErrorIfNIsZero.ref: %ErrorIfNIsZero.type = name_ref ErrorIfNIsZero, file.%ErrorIfNIsZero.decl [template = constants.%ErrorIfNIsZero] -// CHECK:STDOUT: %.loc16_18: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc16_3: = specific_function %ErrorIfNIsZero.ref, @ErrorIfNIsZero(constants.%.2) [template = constants.%.3] +// CHECK:STDOUT: %.loc16_18: Core.IntLiteral = int_value 0 [template = constants.%.1] +// CHECK:STDOUT: %.loc16_3: = specific_function %ErrorIfNIsZero.ref, @ErrorIfNIsZero(constants.%.1) [template = constants.%.2] // CHECK:STDOUT: %ErrorIfNIsZero.call: init %empty_tuple.type = call %.loc16_3() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -114,11 +114,11 @@ fn CallNegative() { // CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ErrorIfNIsZero(constants.%.2) { -// CHECK:STDOUT: %N.loc4_19.2 => constants.%.2 -// CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%.2 +// CHECK:STDOUT: specific @ErrorIfNIsZero(constants.%.1) { +// CHECK:STDOUT: %N.loc4_19.2 => constants.%.1 +// CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc12_18 => +// CHECK:STDOUT: %iN => // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/return_slot.carbon b/toolchain/check/testdata/function/generic/return_slot.carbon index 702dfccdd0f1..2992066bf2e0 100644 --- a/toolchain/check/testdata/function/generic/return_slot.carbon +++ b/toolchain/check/testdata/function/generic/return_slot.carbon @@ -35,32 +35,34 @@ fn G() { // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %.3: = specific_function %Make.1, @Make(%T) [symbolic] // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 100 [template] -// CHECK:STDOUT: %.5: type = array_type %.4, i32 [template] -// CHECK:STDOUT: %.7: type = unbound_element_type %C, %.5 [template] -// CHECK:STDOUT: %.8: type = struct_type {.arr: %.5} [template] -// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.4 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 100 [template] +// CHECK:STDOUT: %.6: type = array_type %.5, %i32 [template] +// CHECK:STDOUT: %.8: type = unbound_element_type %C, %.6 [template] +// CHECK:STDOUT: %.9: type = struct_type {.arr: %.6} [template] +// CHECK:STDOUT: %.10: = complete_type_witness %.9 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %Wrap.3: type = class_type @Wrap, @Wrap(i32) [template] -// CHECK:STDOUT: %Make.type.2: type = fn_type @Make, @Wrap(i32) [template] +// CHECK:STDOUT: %Wrap.3: type = class_type @Wrap, @Wrap(%i32) [template] +// CHECK:STDOUT: %Make.type.2: type = fn_type @Make, @Wrap(%i32) [template] // CHECK:STDOUT: %Make.2: %Make.type.2 = struct_value () [template] -// CHECK:STDOUT: %.11: = specific_function %Make.2, @Make(i32) [template] +// CHECK:STDOUT: %.12: = specific_function %Make.2, @Make(%i32) [template] // CHECK:STDOUT: %Wrap.4: type = class_type @Wrap, @Wrap(%empty_tuple.type) [template] // CHECK:STDOUT: %Make.type.3: type = fn_type @Make, @Wrap(%empty_tuple.type) [template] // CHECK:STDOUT: %Make.3: %Make.type.3 = struct_value () [template] -// CHECK:STDOUT: %.12: = specific_function %Make.3, @Make(%empty_tuple.type) [template] +// CHECK:STDOUT: %.13: = specific_function %Make.3, @Make(%empty_tuple.type) [template] // CHECK:STDOUT: %Wrap.5: type = class_type @Wrap, @Wrap(%C) [template] // CHECK:STDOUT: %Make.type.4: type = fn_type @Make, @Wrap(%C) [template] // CHECK:STDOUT: %Make.4: %Make.type.4 = struct_value () [template] -// CHECK:STDOUT: %.15: = specific_function %Make.4, @Make(%C) [template] +// CHECK:STDOUT: %.16: = specific_function %Make.4, @Make(%C) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -111,13 +113,14 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_26: Core.IntLiteral = int_value 100 [template = constants.%.4] -// CHECK:STDOUT: %.loc15_21.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_21.2: type = converted %int.make_type_32, %.loc15_21.1 [template = i32] -// CHECK:STDOUT: %.loc15_29: type = array_type %.loc15_26, i32 [template = constants.%.5] -// CHECK:STDOUT: %.loc15_18: %.7 = field_decl arr, element0 [template] -// CHECK:STDOUT: %.loc15_32: = complete_type_witness %.8 [template = constants.%.9] +// CHECK:STDOUT: %.loc15_21.1: Core.IntLiteral = int_value 32 [template = constants.%.4] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_26: Core.IntLiteral = int_value 100 [template = constants.%.5] +// CHECK:STDOUT: %.loc15_21.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_21.3: type = converted %int.make_type_signed, %.loc15_21.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_29: type = array_type %.loc15_26, %i32 [template = constants.%.6] +// CHECK:STDOUT: %.loc15_18: %.8 = field_decl arr, element0 [template] +// CHECK:STDOUT: %.loc15_32: = complete_type_witness %.9 [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -146,20 +149,22 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc18_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_10.1: type = value_of_initializer %int.make_type_32.loc18_10 [template = i32] -// CHECK:STDOUT: %.loc18_10.2: type = converted %int.make_type_32.loc18_10, %.loc18_10.1 [template = i32] -// CHECK:STDOUT: %a.var: ref i32 = var a -// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var +// CHECK:STDOUT: %.loc18_10.1: Core.IntLiteral = int_value 32 [template = constants.%.4] +// CHECK:STDOUT: %int.make_type_signed.loc18_10: init type = call constants.%Int(%.loc18_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_10.2: type = value_of_initializer %int.make_type_signed.loc18_10 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_10.3: type = converted %int.make_type_signed.loc18_10, %.loc18_10.2 [template = constants.%i32] +// CHECK:STDOUT: %a.var: ref %i32 = var a +// CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %Wrap.ref.loc18: %Wrap.type = name_ref Wrap, file.%Wrap.decl [template = constants.%Wrap.1] -// CHECK:STDOUT: %int.make_type_32.loc18_21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_20.1: type = value_of_initializer %int.make_type_32.loc18_21 [template = i32] -// CHECK:STDOUT: %.loc18_20.2: type = converted %int.make_type_32.loc18_21, %.loc18_20.1 [template = i32] -// CHECK:STDOUT: %Wrap.loc18: type = class_type @Wrap, @Wrap(i32) [template = constants.%Wrap.3] -// CHECK:STDOUT: %.loc18_25.1: %Make.type.2 = specific_constant @Wrap.%Make.decl, @Wrap(i32) [template = constants.%Make.2] +// CHECK:STDOUT: %.loc18_21: Core.IntLiteral = int_value 32 [template = constants.%.4] +// CHECK:STDOUT: %int.make_type_signed.loc18_21: init type = call constants.%Int(%.loc18_21) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_20.1: type = value_of_initializer %int.make_type_signed.loc18_21 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_20.2: type = converted %int.make_type_signed.loc18_21, %.loc18_20.1 [template = constants.%i32] +// CHECK:STDOUT: %Wrap.loc18: type = class_type @Wrap, @Wrap(constants.%i32) [template = constants.%Wrap.3] +// CHECK:STDOUT: %.loc18_25.1: %Make.type.2 = specific_constant @Wrap.%Make.decl, @Wrap(constants.%i32) [template = constants.%Make.2] // CHECK:STDOUT: %Make.ref.loc18: %Make.type.2 = name_ref Make, %.loc18_25.1 [template = constants.%Make.2] -// CHECK:STDOUT: %.loc18_25.2: = specific_function %Make.ref.loc18, @Make(i32) [template = constants.%.11] -// CHECK:STDOUT: %Make.call.loc18: init i32 = call %.loc18_25.2() +// CHECK:STDOUT: %.loc18_25.2: = specific_function %Make.ref.loc18, @Make(constants.%i32) [template = constants.%.12] +// CHECK:STDOUT: %Make.call.loc18: init %i32 = call %.loc18_25.2() // CHECK:STDOUT: assign %a.var, %Make.call.loc18 // CHECK:STDOUT: %.loc19_11.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc19_11.2: type = converted %.loc19_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] @@ -171,7 +176,7 @@ fn G() { // CHECK:STDOUT: %Wrap.loc19: type = class_type @Wrap, @Wrap(constants.%empty_tuple.type) [template = constants.%Wrap.4] // CHECK:STDOUT: %.loc19_23.1: %Make.type.3 = specific_constant @Wrap.%Make.decl, @Wrap(constants.%empty_tuple.type) [template = constants.%Make.3] // CHECK:STDOUT: %Make.ref.loc19: %Make.type.3 = name_ref Make, %.loc19_23.1 [template = constants.%Make.3] -// CHECK:STDOUT: %.loc19_23.2: = specific_function %Make.ref.loc19, @Make(constants.%empty_tuple.type) [template = constants.%.12] +// CHECK:STDOUT: %.loc19_23.2: = specific_function %Make.ref.loc19, @Make(constants.%empty_tuple.type) [template = constants.%.13] // CHECK:STDOUT: %Make.call.loc19: init %empty_tuple.type = call %.loc19_23.2() // CHECK:STDOUT: assign %b.var, %Make.call.loc19 // CHECK:STDOUT: %C.ref.loc20_10: type = name_ref C, file.%C.decl [template = constants.%C] @@ -182,7 +187,7 @@ fn G() { // CHECK:STDOUT: %Wrap.loc20: type = class_type @Wrap, @Wrap(constants.%C) [template = constants.%Wrap.5] // CHECK:STDOUT: %.loc20_21.1: %Make.type.4 = specific_constant @Wrap.%Make.decl, @Wrap(constants.%C) [template = constants.%Make.4] // CHECK:STDOUT: %Make.ref.loc20: %Make.type.4 = name_ref Make, %.loc20_21.1 [template = constants.%Make.4] -// CHECK:STDOUT: %.loc20_21.2: = specific_function %Make.ref.loc20, @Make(constants.%C) [template = constants.%.15] +// CHECK:STDOUT: %.loc20_21.2: = specific_function %Make.ref.loc20, @Make(constants.%C) [template = constants.%.16] // CHECK:STDOUT: %.loc20_7: ref %C = splice_block %c.var {} // CHECK:STDOUT: %Make.call.loc20: init %C = call %.loc20_21.2() to %.loc20_7 // CHECK:STDOUT: assign %c.var, %Make.call.loc20 @@ -221,22 +226,22 @@ fn G() { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Wrap(i32) { -// CHECK:STDOUT: %T.loc11_12.2 => i32 -// CHECK:STDOUT: %T.patt.loc11_12.2 => i32 +// CHECK:STDOUT: specific @Wrap(constants.%i32) { +// CHECK:STDOUT: %T.loc11_12.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc11_12.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type => constants.%Make.type.2 // CHECK:STDOUT: %Make => constants.%Make.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Make(i32) { -// CHECK:STDOUT: %T => i32 +// CHECK:STDOUT: specific @Make(constants.%i32) { +// CHECK:STDOUT: %T => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type => constants.%Make.type.2 // CHECK:STDOUT: %Make => constants.%Make.2 -// CHECK:STDOUT: %.loc12_27.3 => constants.%.11 +// CHECK:STDOUT: %.loc12_27.3 => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(constants.%empty_tuple.type) { @@ -254,7 +259,7 @@ fn G() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type => constants.%Make.type.3 // CHECK:STDOUT: %Make => constants.%Make.3 -// CHECK:STDOUT: %.loc12_27.3 => constants.%.12 +// CHECK:STDOUT: %.loc12_27.3 => constants.%.13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(constants.%C) { @@ -272,6 +277,6 @@ fn G() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type => constants.%Make.type.4 // CHECK:STDOUT: %Make => constants.%Make.4 -// CHECK:STDOUT: %.loc12_27.3 => constants.%.15 +// CHECK:STDOUT: %.loc12_27.3 => constants.%.16 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/undefined.carbon b/toolchain/check/testdata/function/generic/undefined.carbon index 8e793ed73c2b..015bbdbda354 100644 --- a/toolchain/check/testdata/function/generic/undefined.carbon +++ b/toolchain/check/testdata/function/generic/undefined.carbon @@ -57,23 +57,26 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Defined.type: type = fn_type @Defined [template] // CHECK:STDOUT: %Defined: %Defined.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %CallDefined.type: type = fn_type @CallDefined [template] // CHECK:STDOUT: %CallDefined: %CallDefined.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] -// CHECK:STDOUT: %.28: = specific_function %Defined, @Defined(i32) [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.7, @impl.5(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.7(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.26: = specific_function %Defined, @Defined(%i32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .As = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -105,14 +108,15 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %return: ref @Defined.%T.loc4_12.2 (%T) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallDefined.decl: %CallDefined.type = fn_decl @CallDefined [template = constants.%CallDefined] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_21.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] -// CHECK:STDOUT: %.loc8_21.2: type = converted %int.make_type_32.loc8, %.loc8_21.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc8_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_21.2: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_21.3: type = converted %int.make_type_signed.loc8, %.loc8_21.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -129,22 +133,24 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallDefined() -> i32 { +// CHECK:STDOUT: fn @CallDefined() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Defined.ref: %Defined.type = name_ref Defined, file.%Defined.decl [template = constants.%Defined] -// CHECK:STDOUT: %.loc9_18: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_23.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] -// CHECK:STDOUT: %.loc9_23.2: type = converted %int.make_type_32.loc9, %.loc9_23.1 [template = i32] -// CHECK:STDOUT: %.loc9_20.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_20.2: = bound_method %.loc9_18, %.loc9_20.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc9_20.2(%.loc9_18) [template = constants.%.27] -// CHECK:STDOUT: %.loc9_20.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc9_20.4: i32 = converted %.loc9_18, %.loc9_20.3 [template = constants.%.27] -// CHECK:STDOUT: %.loc9_10: = specific_function %Defined.ref, @Defined(i32) [template = constants.%.28] -// CHECK:STDOUT: %Defined.call: init i32 = call %.loc9_10(%.loc9_20.4) -// CHECK:STDOUT: %.loc9_27.1: i32 = value_of_initializer %Defined.call -// CHECK:STDOUT: %.loc9_27.2: i32 = converted %Defined.call, %.loc9_27.1 +// CHECK:STDOUT: %.loc9_18: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc9_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%.loc9_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_23.2: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_23.3: type = converted %int.make_type_signed.loc9, %.loc9_23.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_20.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_20.2: = bound_method %.loc9_18, %.loc9_20.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc9_20.3: = specific_function %.loc9_20.2, @Convert.7(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc9_20.3(%.loc9_18) [template = constants.%.25] +// CHECK:STDOUT: %.loc9_20.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc9_20.5: %i32 = converted %.loc9_18, %.loc9_20.4 [template = constants.%.25] +// CHECK:STDOUT: %.loc9_10: = specific_function %Defined.ref, @Defined(constants.%i32) [template = constants.%.26] +// CHECK:STDOUT: %Defined.call: init %i32 = call %.loc9_10(%.loc9_20.5) +// CHECK:STDOUT: %.loc9_27.1: %i32 = value_of_initializer %Defined.call +// CHECK:STDOUT: %.loc9_27.2: %i32 = converted %Defined.call, %.loc9_27.1 // CHECK:STDOUT: return %.loc9_27.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -153,9 +159,9 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %T.patt.loc4_12.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Defined(i32) { -// CHECK:STDOUT: %T.loc4_12.2 => i32 -// CHECK:STDOUT: %T.patt.loc4_12.2 => i32 +// CHECK:STDOUT: specific @Defined(constants.%i32) { +// CHECK:STDOUT: %T.loc4_12.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc4_12.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -167,23 +173,26 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Defined.type: type = fn_type @Defined [template] // CHECK:STDOUT: %Defined: %Defined.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %CallDefined.type: type = fn_type @CallDefined [template] // CHECK:STDOUT: %CallDefined: %CallDefined.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] -// CHECK:STDOUT: %.28: = specific_function %Defined, @Defined(i32) [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.7, @impl.5(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.7(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.26: = specific_function %Defined, @Defined(%i32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .As = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -215,14 +224,15 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %.loc4: ref @Defined.%T.loc4_12.2 (%T) = return_slot %return.param.loc4 // CHECK:STDOUT: } // CHECK:STDOUT: %CallDefined.decl: %CallDefined.type = fn_decl @CallDefined [template = constants.%CallDefined] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_21.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_21.2: type = converted %int.make_type_32.loc6, %.loc6_21.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc6_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_21.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_21.3: type = converted %int.make_type_signed.loc6, %.loc6_21.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Defined.decl.loc10: %Defined.type = fn_decl @Defined [template = constants.%Defined] { // CHECK:STDOUT: %T.patt.loc10: type = symbolic_binding_pattern T, 0 [symbolic = constants.%T.patt] @@ -256,22 +266,24 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallDefined() -> i32 { +// CHECK:STDOUT: fn @CallDefined() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Defined.ref: %Defined.type = name_ref Defined, file.%Defined.decl.loc4 [template = constants.%Defined] -// CHECK:STDOUT: %.loc7_18: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_23.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_23.2: type = converted %int.make_type_32.loc7, %.loc7_23.1 [template = i32] -// CHECK:STDOUT: %.loc7_20.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_20.2: = bound_method %.loc7_18, %.loc7_20.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc7_20.2(%.loc7_18) [template = constants.%.27] -// CHECK:STDOUT: %.loc7_20.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc7_20.4: i32 = converted %.loc7_18, %.loc7_20.3 [template = constants.%.27] -// CHECK:STDOUT: %.loc7_10: = specific_function %Defined.ref, @Defined(i32) [template = constants.%.28] -// CHECK:STDOUT: %Defined.call: init i32 = call %.loc7_10(%.loc7_20.4) -// CHECK:STDOUT: %.loc7_27.1: i32 = value_of_initializer %Defined.call -// CHECK:STDOUT: %.loc7_27.2: i32 = converted %Defined.call, %.loc7_27.1 +// CHECK:STDOUT: %.loc7_18: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc7_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%.loc7_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_23.2: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_23.3: type = converted %int.make_type_signed.loc7, %.loc7_23.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_20.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_20.2: = bound_method %.loc7_18, %.loc7_20.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc7_20.3: = specific_function %.loc7_20.2, @Convert.7(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc7_20.3(%.loc7_18) [template = constants.%.25] +// CHECK:STDOUT: %.loc7_20.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc7_20.5: %i32 = converted %.loc7_18, %.loc7_20.4 [template = constants.%.25] +// CHECK:STDOUT: %.loc7_10: = specific_function %Defined.ref, @Defined(constants.%i32) [template = constants.%.26] +// CHECK:STDOUT: %Defined.call: init %i32 = call %.loc7_10(%.loc7_20.5) +// CHECK:STDOUT: %.loc7_27.1: %i32 = value_of_initializer %Defined.call +// CHECK:STDOUT: %.loc7_27.2: %i32 = converted %Defined.call, %.loc7_27.1 // CHECK:STDOUT: return %.loc7_27.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -280,9 +292,9 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %T.patt.loc4 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Defined(i32) { -// CHECK:STDOUT: %T.loc4_12.2 => i32 -// CHECK:STDOUT: %T.patt.loc4 => i32 +// CHECK:STDOUT: specific @Defined(constants.%i32) { +// CHECK:STDOUT: %T.loc4_12.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc4 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -294,23 +306,26 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Undefined.type: type = fn_type @Undefined [template] // CHECK:STDOUT: %Undefined: %Undefined.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %CallUndefined.type: type = fn_type @CallUndefined [template] // CHECK:STDOUT: %CallUndefined: %CallUndefined.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] -// CHECK:STDOUT: %.28: = specific_function %Undefined, @Undefined(i32) [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.7, @impl.5(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.7(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.26: = specific_function %Undefined, @Undefined(%i32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .As = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -342,14 +357,15 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %return: ref @Undefined.%T.loc4_14.2 (%T) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallUndefined.decl: %CallUndefined.type = fn_decl @CallUndefined [template = constants.%CallUndefined] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_23.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_23.2: type = converted %int.make_type_32.loc6, %.loc6_23.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc6_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_23.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_23.3: type = converted %int.make_type_signed.loc6, %.loc6_23.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -360,22 +376,24 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @Undefined.%T.loc4_14.2 (%T)) -> @Undefined.%T.loc4_14.2 (%T); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallUndefined() -> i32 { +// CHECK:STDOUT: fn @CallUndefined() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Undefined.ref: %Undefined.type = name_ref Undefined, file.%Undefined.decl [template = constants.%Undefined] -// CHECK:STDOUT: %.loc13_20: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_25.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_25.2: type = converted %int.make_type_32.loc13, %.loc13_25.1 [template = i32] -// CHECK:STDOUT: %.loc13_22.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_22.2: = bound_method %.loc13_20, %.loc13_22.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc13_22.2(%.loc13_20) [template = constants.%.27] -// CHECK:STDOUT: %.loc13_22.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc13_22.4: i32 = converted %.loc13_20, %.loc13_22.3 [template = constants.%.27] -// CHECK:STDOUT: %.loc13_10: = specific_function %Undefined.ref, @Undefined(i32) [template = constants.%.28] -// CHECK:STDOUT: %Undefined.call: init i32 = call %.loc13_10(%.loc13_22.4) -// CHECK:STDOUT: %.loc13_29.1: i32 = value_of_initializer %Undefined.call -// CHECK:STDOUT: %.loc13_29.2: i32 = converted %Undefined.call, %.loc13_29.1 +// CHECK:STDOUT: %.loc13_20: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc13_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_25.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_25.3: type = converted %int.make_type_signed.loc13, %.loc13_25.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_22.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_22.2: = bound_method %.loc13_20, %.loc13_22.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc13_22.3: = specific_function %.loc13_22.2, @Convert.7(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc13_22.3(%.loc13_20) [template = constants.%.25] +// CHECK:STDOUT: %.loc13_22.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc13_22.5: %i32 = converted %.loc13_20, %.loc13_22.4 [template = constants.%.25] +// CHECK:STDOUT: %.loc13_10: = specific_function %Undefined.ref, @Undefined(constants.%i32) [template = constants.%.26] +// CHECK:STDOUT: %Undefined.call: init %i32 = call %.loc13_10(%.loc13_22.5) +// CHECK:STDOUT: %.loc13_29.1: %i32 = value_of_initializer %Undefined.call +// CHECK:STDOUT: %.loc13_29.2: %i32 = converted %Undefined.call, %.loc13_29.1 // CHECK:STDOUT: return %.loc13_29.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -384,8 +402,8 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %T.patt.loc4_14.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Undefined(i32) { -// CHECK:STDOUT: %T.loc4_14.2 => i32 -// CHECK:STDOUT: %T.patt.loc4_14.2 => i32 +// CHECK:STDOUT: specific @Undefined(constants.%i32) { +// CHECK:STDOUT: %T.loc4_14.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc4_14.2 => constants.%i32 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/global/decl.carbon b/toolchain/check/testdata/global/decl.carbon index f1dbf7dcb57b..925db58cb0d3 100644 --- a/toolchain/check/testdata/global/decl.carbon +++ b/toolchain/check/testdata/global/decl.carbon @@ -12,13 +12,15 @@ var a: i32; // CHECK:STDOUT: --- decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -30,10 +32,11 @@ var a: i32; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_32, %.loc10_8.1 [template = i32] -// CHECK:STDOUT: %a.var: ref i32 = var a -// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var +// CHECK:STDOUT: %.loc10_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc10_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8.3: type = converted %int.make_type_signed, %.loc10_8.2 [template = constants.%i32] +// CHECK:STDOUT: %a.var: ref %i32 = var a +// CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/global/simple_init.carbon b/toolchain/check/testdata/global/simple_init.carbon index 01ceb4ec1004..cbc552fa7ada 100644 --- a/toolchain/check/testdata/global/simple_init.carbon +++ b/toolchain/check/testdata/global/simple_init.carbon @@ -12,20 +12,23 @@ var a: i32 = 0; // CHECK:STDOUT: --- simple_init.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -38,21 +41,23 @@ var a: i32 = 0; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_32, %.loc10_8.1 [template = i32] -// CHECK:STDOUT: %a.var: ref i32 = var a -// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var +// CHECK:STDOUT: %.loc10_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc10_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8.3: type = converted %int.make_type_signed, %.loc10_8.2 [template = constants.%i32] +// CHECK:STDOUT: %a.var: ref %i32 = var a +// CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc10_14: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc10_15.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_15.2: = bound_method %.loc10_14, %.loc10_15.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc10_15.2(%.loc10_14) [template = constants.%.27] -// CHECK:STDOUT: %.loc10_15.3: init i32 = converted %.loc10_14, %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: assign file.%a.var, %.loc10_15.3 +// CHECK:STDOUT: %.loc10_14: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc10_15.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_15.2: = bound_method %.loc10_14, %.loc10_15.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc10_15.3: = specific_function %.loc10_15.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc10_15.3(%.loc10_14) [template = constants.%.25] +// CHECK:STDOUT: %.loc10_15.4: init %i32 = converted %.loc10_14, %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: assign file.%a.var, %.loc10_15.4 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/global/simple_with_fun.carbon b/toolchain/check/testdata/global/simple_with_fun.carbon index 507072c54ec7..12f67c828674 100644 --- a/toolchain/check/testdata/global/simple_with_fun.carbon +++ b/toolchain/check/testdata/global/simple_with_fun.carbon @@ -17,22 +17,25 @@ var a: i32 = test_a(); // CHECK:STDOUT: --- simple_with_fun.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %test_a.type: type = fn_type @test_a [template] // CHECK:STDOUT: %test_a: %test_a.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -47,37 +50,40 @@ var a: i32 = test_a(); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %test_a.decl: %test_a.type = fn_decl @test_a [template = constants.%test_a] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_16.2: type = converted %int.make_type_32, %.loc11_16.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_16.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_16.3: type = converted %int.make_type_signed, %.loc11_16.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32, %.loc15_8.1 [template = i32] -// CHECK:STDOUT: %a.var: ref i32 = var a -// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed, %.loc15_8.2 [template = constants.%i32] +// CHECK:STDOUT: %a.var: ref %i32 = var a +// CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @test_a() -> i32 { +// CHECK:STDOUT: fn @test_a() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_10: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_11.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_11.2: = bound_method %.loc12_10, %.loc12_11.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_11.2(%.loc12_10) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_11.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc12_11.4: i32 = converted %.loc12_10, %.loc12_11.3 [template = constants.%.27] -// CHECK:STDOUT: return %.loc12_11.4 +// CHECK:STDOUT: %.loc12_10: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_11.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_11.2: = bound_method %.loc12_10, %.loc12_11.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_11.3: = specific_function %.loc12_11.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc12_11.3(%.loc12_10) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_11.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc12_11.5: %i32 = converted %.loc12_10, %.loc12_11.4 [template = constants.%.25] +// CHECK:STDOUT: return %.loc12_11.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %test_a.ref: %test_a.type = name_ref test_a, file.%test_a.decl [template = constants.%test_a] -// CHECK:STDOUT: %test_a.call: init i32 = call %test_a.ref() +// CHECK:STDOUT: %test_a.call: init %i32 = call %test_a.ref() // CHECK:STDOUT: assign file.%a.var, %test_a.call // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon index ef66a5355d05..5f4e49119206 100644 --- a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon @@ -44,22 +44,26 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %If1.type: type = fn_type @If1 [template] // CHECK:STDOUT: %If1: %If1.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] // CHECK:STDOUT: %If2.type: type = fn_type @If2 [template] // CHECK:STDOUT: %If2: %If2.type = struct_value () [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.27: = bound_method %.26, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] // CHECK:STDOUT: %If3.type: type = fn_type @If3 [template] // CHECK:STDOUT: %If3: %If3.type = struct_value () [template] // CHECK:STDOUT: } @@ -67,7 +71,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.1 -// CHECK:STDOUT: .Int32 = %import_ref.2 +// CHECK:STDOUT: .Int = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -85,69 +89,73 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: %If1.decl: %If1.type = fn_decl @If1 [template = constants.%If1] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_11.2: type = converted %bool.make_type, %.loc11_11.1 [template = bool] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_20.2: type = converted %int.make_type_32, %.loc11_20.1 [template = i32] +// CHECK:STDOUT: %.loc11_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_20.3: type = converted %int.make_type_signed, %.loc11_20.2 [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %If2.decl: %If2.type = fn_decl @If2 [template = constants.%If2] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc22_11.2: type = converted %bool.make_type, %.loc22_11.1 [template = bool] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc22_20.2: type = converted %int.make_type_32, %.loc22_20.1 [template = i32] +// CHECK:STDOUT: %.loc22_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc22_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc22_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc22_20.3: type = converted %int.make_type_signed, %.loc22_20.2 [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %If3.decl: %If3.type = fn_decl @If3 [template = constants.%If3] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc33_11.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc33_11.2: type = converted %bool.make_type, %.loc33_11.1 [template = bool] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc33_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc33_20.2: type = converted %int.make_type_32, %.loc33_20.1 [template = i32] +// CHECK:STDOUT: %.loc33_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc33_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc33_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc33_20.3: type = converted %int.make_type_signed, %.loc33_20.2 [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @If1(%b.param_patt: bool) -> i32 { +// CHECK:STDOUT: fn @If1(%b.param_patt: bool) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %.loc13_12: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc13_13.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_13.2: = bound_method %.loc13_12, %.loc13_13.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc13_13.2(%.loc13_12) [template = constants.%.27] -// CHECK:STDOUT: %.loc13_13.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc13_13.4: i32 = converted %.loc13_12, %.loc13_13.3 [template = constants.%.27] -// CHECK:STDOUT: return %.loc13_13.4 +// CHECK:STDOUT: %.loc13_12: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc13_13.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_13.2: = bound_method %.loc13_12, %.loc13_13.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc13_13.3: = specific_function %.loc13_13.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc13_13.3(%.loc13_12) [template = constants.%.25] +// CHECK:STDOUT: %.loc13_13.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc13_13.5: %i32 = converted %.loc13_12, %.loc13_13.4 [template = constants.%.25] +// CHECK:STDOUT: return %.loc13_13.5 // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: br !if.done @@ -155,7 +163,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: !if.done: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @If2(%b.param_patt: bool) -> i32 { +// CHECK:STDOUT: fn @If2(%b.param_patt: bool) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else @@ -164,30 +172,32 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: br !if.done // CHECK:STDOUT: // CHECK:STDOUT: !if.else: -// CHECK:STDOUT: %.loc25_12: Core.IntLiteral = int_value 2 [template = constants.%.28] -// CHECK:STDOUT: %.loc25_13.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc25_13.2: = bound_method %.loc25_12, %.loc25_13.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc25_13.2(%.loc25_12) [template = constants.%.30] -// CHECK:STDOUT: %.loc25_13.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.30] -// CHECK:STDOUT: %.loc25_13.4: i32 = converted %.loc25_12, %.loc25_13.3 [template = constants.%.30] -// CHECK:STDOUT: return %.loc25_13.4 +// CHECK:STDOUT: %.loc25_12: Core.IntLiteral = int_value 2 [template = constants.%.26] +// CHECK:STDOUT: %.loc25_13.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc25_13.2: = bound_method %.loc25_12, %.loc25_13.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc25_13.3: = specific_function %.loc25_13.2, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc25_13.3(%.loc25_12) [template = constants.%.29] +// CHECK:STDOUT: %.loc25_13.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.29] +// CHECK:STDOUT: %.loc25_13.5: %i32 = converted %.loc25_12, %.loc25_13.4 [template = constants.%.29] +// CHECK:STDOUT: return %.loc25_13.5 // CHECK:STDOUT: // CHECK:STDOUT: !if.done: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @If3(%b.param_patt: bool) -> i32 { +// CHECK:STDOUT: fn @If3(%b.param_patt: bool) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %.loc35_12: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc35_13.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc35_13.2: = bound_method %.loc35_12, %.loc35_13.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc35_13.2(%.loc35_12) [template = constants.%.27] -// CHECK:STDOUT: %.loc35_13.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc35_13.4: i32 = converted %.loc35_12, %.loc35_13.3 [template = constants.%.27] -// CHECK:STDOUT: return %.loc35_13.4 +// CHECK:STDOUT: %.loc35_12: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc35_13.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc35_13.2: = bound_method %.loc35_12, %.loc35_13.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc35_13.3: = specific_function %.loc35_13.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc35_13.3(%.loc35_12) [template = constants.%.25] +// CHECK:STDOUT: %.loc35_13.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc35_13.5: %i32 = converted %.loc35_12, %.loc35_13.4 [template = constants.%.25] +// CHECK:STDOUT: return %.loc35_13.5 // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if/fail_scope.carbon b/toolchain/check/testdata/if/fail_scope.carbon index bd501d34a627..169b15f79c15 100644 --- a/toolchain/check/testdata/if/fail_scope.carbon +++ b/toolchain/check/testdata/if/fail_scope.carbon @@ -24,23 +24,26 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %VarScope.type: type = fn_type @VarScope [template] // CHECK:STDOUT: %VarScope: %VarScope.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 2 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.1 -// CHECK:STDOUT: .Int32 = %import_ref.2 +// CHECK:STDOUT: .Int = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -56,41 +59,44 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: %VarScope.decl: %VarScope.type = fn_decl @VarScope [template = constants.%VarScope] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_16.2: type = converted %bool.make_type, %.loc11_16.1 [template = bool] -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_32.loc11, %.loc11_25.1 [template = i32] +// CHECK:STDOUT: %.loc11_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.3: type = converted %int.make_type_signed.loc11, %.loc11_25.2 [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @VarScope(%b.param_patt: bool) -> i32 { +// CHECK:STDOUT: fn @VarScope(%b.param_patt: bool) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_12.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_12.2: type = converted %int.make_type_32.loc13, %.loc13_12.1 [template = i32] -// CHECK:STDOUT: %n.var: ref i32 = var n -// CHECK:STDOUT: %n: ref i32 = bind_name n, %n.var -// CHECK:STDOUT: %.loc13_18: Core.IntLiteral = int_value 2 [template = constants.%.1] -// CHECK:STDOUT: %.loc13_19.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_19.2: = bound_method %.loc13_18, %.loc13_19.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc13_19.2(%.loc13_18) [template = constants.%.27] -// CHECK:STDOUT: %.loc13_19.3: init i32 = converted %.loc13_18, %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: assign %n.var, %.loc13_19.3 -// CHECK:STDOUT: %n.ref.loc14: ref i32 = name_ref n, %n -// CHECK:STDOUT: %.loc14: i32 = bind_value %n.ref.loc14 +// CHECK:STDOUT: %.loc13_12.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_12.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_12.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_12.3: type = converted %int.make_type_signed.loc13, %.loc13_12.2 [template = constants.%i32] +// CHECK:STDOUT: %n.var: ref %i32 = var n +// CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var +// CHECK:STDOUT: %.loc13_18: Core.IntLiteral = int_value 2 [template = constants.%.2] +// CHECK:STDOUT: %.loc13_19.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_19.2: = bound_method %.loc13_18, %.loc13_19.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc13_19.3: = specific_function %.loc13_19.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc13_19.3(%.loc13_18) [template = constants.%.25] +// CHECK:STDOUT: %.loc13_19.4: init %i32 = converted %.loc13_18, %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: assign %n.var, %.loc13_19.4 +// CHECK:STDOUT: %n.ref.loc14: ref %i32 = name_ref n, %n +// CHECK:STDOUT: %.loc14: %i32 = bind_value %n.ref.loc14 // CHECK:STDOUT: return %.loc14 // CHECK:STDOUT: // CHECK:STDOUT: !if.else: diff --git a/toolchain/check/testdata/if/unreachable_fallthrough.carbon b/toolchain/check/testdata/if/unreachable_fallthrough.carbon index a0449ff2b530..fe6ef2ee3587 100644 --- a/toolchain/check/testdata/if/unreachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/unreachable_fallthrough.carbon @@ -22,26 +22,30 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %If.type: type = fn_type @If [template] // CHECK:STDOUT: %If: %If.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.27: = bound_method %.26, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.1 -// CHECK:STDOUT: .Int32 = %import_ref.2 +// CHECK:STDOUT: .Int = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -57,43 +61,46 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: %If.decl: %If.type = fn_decl @If [template = constants.%If] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_10.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_10.2: type = converted %bool.make_type, %.loc11_10.1 [template = bool] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32, %.loc11_19.1 [template = i32] +// CHECK:STDOUT: %.loc11_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.3: type = converted %int.make_type_signed, %.loc11_19.2 [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @If(%b.param_patt: bool) -> i32 { +// CHECK:STDOUT: fn @If(%b.param_patt: bool) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %.loc13_12: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc13_13.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_13.2: = bound_method %.loc13_12, %.loc13_13.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc13: init i32 = call %.loc13_13.2(%.loc13_12) [template = constants.%.27] -// CHECK:STDOUT: %.loc13_13.3: i32 = value_of_initializer %int.convert_checked.loc13 [template = constants.%.27] -// CHECK:STDOUT: %.loc13_13.4: i32 = converted %.loc13_12, %.loc13_13.3 [template = constants.%.27] -// CHECK:STDOUT: return %.loc13_13.4 +// CHECK:STDOUT: %.loc13_12: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc13_13.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_13.2: = bound_method %.loc13_12, %.loc13_13.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc13_13.3: = specific_function %.loc13_13.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %.loc13_13.3(%.loc13_12) [template = constants.%.25] +// CHECK:STDOUT: %.loc13_13.4: %i32 = value_of_initializer %int.convert_checked.loc13 [template = constants.%.25] +// CHECK:STDOUT: %.loc13_13.5: %i32 = converted %.loc13_12, %.loc13_13.4 [template = constants.%.25] +// CHECK:STDOUT: return %.loc13_13.5 // CHECK:STDOUT: // CHECK:STDOUT: !if.else: -// CHECK:STDOUT: %.loc15_12: Core.IntLiteral = int_value 2 [template = constants.%.28] -// CHECK:STDOUT: %.loc15_13.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_13.2: = bound_method %.loc15_12, %.loc15_13.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc15: init i32 = call %.loc15_13.2(%.loc15_12) [template = constants.%.30] -// CHECK:STDOUT: %.loc15_13.3: i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%.30] -// CHECK:STDOUT: %.loc15_13.4: i32 = converted %.loc15_12, %.loc15_13.3 [template = constants.%.30] -// CHECK:STDOUT: return %.loc15_13.4 +// CHECK:STDOUT: %.loc15_12: Core.IntLiteral = int_value 2 [template = constants.%.26] +// CHECK:STDOUT: %.loc15_13.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_13.2: = bound_method %.loc15_12, %.loc15_13.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc15_13.3: = specific_function %.loc15_13.2, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %.loc15_13.3(%.loc15_12) [template = constants.%.29] +// CHECK:STDOUT: %.loc15_13.4: %i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%.29] +// CHECK:STDOUT: %.loc15_13.5: %i32 = converted %.loc15_12, %.loc15_13.4 [template = constants.%.29] +// CHECK:STDOUT: return %.loc15_13.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index 1344df7efd73..8bceb4b1fbe5 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -18,27 +18,30 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %.5: i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.5) [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.26: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.27: = specific_function %.26, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.28: %i32 = int_value 0 [template] +// CHECK:STDOUT: %array: %.3 = tuple_value (%.28) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.1 -// CHECK:STDOUT: .Int32 = %import_ref.2 +// CHECK:STDOUT: .Int = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -54,76 +57,81 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param0 -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param1 -// CHECK:STDOUT: %m.patt: i32 = binding_pattern m -// CHECK:STDOUT: %m.param_patt: i32 = value_param_pattern %m.patt, runtime_param2 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param3 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param1 +// CHECK:STDOUT: %m.patt: %i32 = binding_pattern m +// CHECK:STDOUT: %m.param_patt: %i32 = value_param_pattern %m.patt, runtime_param2 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_9.2: type = converted %bool.make_type, %.loc11_9.1 [template = bool] -// CHECK:STDOUT: %int.make_type_32.loc11_18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %int.make_type_32.loc11_18 [template = i32] -// CHECK:STDOUT: %.loc11_18.2: type = converted %int.make_type_32.loc11_18, %.loc11_18.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_26: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_26.1: type = value_of_initializer %int.make_type_32.loc11_26 [template = i32] -// CHECK:STDOUT: %.loc11_26.2: type = converted %int.make_type_32.loc11_26, %.loc11_26.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_34.1: type = value_of_initializer %int.make_type_32.loc11_34 [template = i32] -// CHECK:STDOUT: %.loc11_34.2: type = converted %int.make_type_32.loc11_34, %.loc11_34.1 [template = i32] +// CHECK:STDOUT: %.loc11_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_18: init type = call constants.%Int(%.loc11_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_18.2: type = value_of_initializer %int.make_type_signed.loc11_18 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_18.3: type = converted %int.make_type_signed.loc11_18, %.loc11_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_26.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_26: init type = call constants.%Int(%.loc11_26.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_26.2: type = value_of_initializer %int.make_type_signed.loc11_26 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_26.3: type = converted %int.make_type_signed.loc11_26, %.loc11_26.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_34.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_34: init type = call constants.%Int(%.loc11_34.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_34.2: type = value_of_initializer %int.make_type_signed.loc11_34 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_34.3: type = converted %int.make_type_signed.loc11_34, %.loc11_34.2 [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param -// CHECK:STDOUT: %m.param: i32 = value_param runtime_param2 -// CHECK:STDOUT: %m: i32 = bind_name m, %m.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param3 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param +// CHECK:STDOUT: %m.param: %i32 = value_param runtime_param2 +// CHECK:STDOUT: %m: %i32 = bind_name m, %m.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%b.param_patt: bool, %n.param_patt: i32, %m.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @F(%b.param_patt: bool, %n.param_patt: %i32, %m.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_32.loc12, %.loc12_11.1 [template = i32] -// CHECK:STDOUT: %.loc12_17: type = array_type %.loc12_16, i32 [template = constants.%.2] -// CHECK:STDOUT: %x.var: ref %.2 = var x -// CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var -// CHECK:STDOUT: %.loc12_22: Core.IntLiteral = int_value 0 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_11.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_11.3: type = converted %int.make_type_signed.loc12, %.loc12_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_17: type = array_type %.loc12_16, %i32 [template = constants.%.3] +// CHECK:STDOUT: %x.var: ref %.3 = var x +// CHECK:STDOUT: %x: ref %.3 = bind_name x, %x.var +// CHECK:STDOUT: %.loc12_22: Core.IntLiteral = int_value 0 [template = constants.%.5] // CHECK:STDOUT: %.loc12_24.1: %tuple.type = tuple_literal (%.loc12_22) -// CHECK:STDOUT: %.loc12_24.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_24.3: = bound_method %.loc12_22, %.loc12_24.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_24.3(%.loc12_22) [template = constants.%.5] -// CHECK:STDOUT: %.loc12_24.4: init i32 = converted %.loc12_22, %int.convert_checked [template = constants.%.5] -// CHECK:STDOUT: %.loc12_24.5: i32 = int_value 0 [template = constants.%.5] -// CHECK:STDOUT: %.loc12_24.6: ref i32 = array_index %x.var, %.loc12_24.5 -// CHECK:STDOUT: %.loc12_24.7: init i32 = initialize_from %.loc12_24.4 to %.loc12_24.6 [template = constants.%.5] -// CHECK:STDOUT: %.loc12_24.8: init %.2 = array_init (%.loc12_24.7) to %x.var [template = constants.%array] -// CHECK:STDOUT: %.loc12_25: init %.2 = converted %.loc12_24.1, %.loc12_24.8 [template = constants.%array] +// CHECK:STDOUT: %.loc12_24.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_24.3: = bound_method %.loc12_22, %.loc12_24.2 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_24.4: = specific_function %.loc12_24.3, @Convert.2(constants.%.1) [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc12_24.4(%.loc12_22) [template = constants.%.28] +// CHECK:STDOUT: %.loc12_24.5: init %i32 = converted %.loc12_22, %int.convert_checked [template = constants.%.28] +// CHECK:STDOUT: %.loc12_24.6: Core.IntLiteral = int_value 0 [template = constants.%.5] +// CHECK:STDOUT: %.loc12_24.7: ref %i32 = array_index %x.var, %.loc12_24.6 +// CHECK:STDOUT: %.loc12_24.8: init %i32 = initialize_from %.loc12_24.5 to %.loc12_24.7 [template = constants.%.28] +// CHECK:STDOUT: %.loc12_24.9: init %.3 = array_init (%.loc12_24.8) to %x.var [template = constants.%array] +// CHECK:STDOUT: %.loc12_25: init %.3 = converted %.loc12_24.1, %.loc12_24.9 [template = constants.%array] // CHECK:STDOUT: assign %x.var, %.loc12_25 // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: -// CHECK:STDOUT: %x.ref.loc13_20: ref %.2 = name_ref x, %x -// CHECK:STDOUT: %m.ref: i32 = name_ref m, %m -// CHECK:STDOUT: %.loc13_23.1: ref i32 = array_index %x.ref.loc13_20, %m.ref -// CHECK:STDOUT: %.loc13_23.2: i32 = bind_value %.loc13_23.1 +// CHECK:STDOUT: %x.ref.loc13_20: ref %.3 = name_ref x, %x +// CHECK:STDOUT: %m.ref: %i32 = name_ref m, %m +// CHECK:STDOUT: %.loc13_23.1: ref %i32 = array_index %x.ref.loc13_20, %m.ref +// CHECK:STDOUT: %.loc13_23.2: %i32 = bind_value %.loc13_23.1 // CHECK:STDOUT: br !if.expr.result(%.loc13_23.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %x.ref.loc13_30: ref %.2 = name_ref x, %x -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n -// CHECK:STDOUT: %.loc13_33.1: ref i32 = array_index %x.ref.loc13_30, %n.ref -// CHECK:STDOUT: %.loc13_33.2: i32 = bind_value %.loc13_33.1 +// CHECK:STDOUT: %x.ref.loc13_30: ref %.3 = name_ref x, %x +// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n +// CHECK:STDOUT: %.loc13_33.1: ref %i32 = array_index %x.ref.loc13_30, %n.ref +// CHECK:STDOUT: %.loc13_33.2: %i32 = bind_value %.loc13_33.1 // CHECK:STDOUT: br !if.expr.result(%.loc13_33.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result: -// CHECK:STDOUT: %.loc13_10: i32 = block_arg !if.expr.result +// CHECK:STDOUT: %.loc13_10: %i32 = block_arg !if.expr.result // CHECK:STDOUT: return %.loc13_10 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/constant_condition.carbon b/toolchain/check/testdata/if_expr/constant_condition.carbon index 33cb3ca83b3e..9e28c1b501e7 100644 --- a/toolchain/check/testdata/if_expr/constant_condition.carbon +++ b/toolchain/check/testdata/if_expr/constant_condition.carbon @@ -34,38 +34,42 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: --- constant_condition.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.27: = bound_method %.26, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.31: bool = bool_literal true [template] +// CHECK:STDOUT: %.30: bool = bool_literal true [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.32: bool = bool_literal false [template] +// CHECK:STDOUT: %.31: bool = bool_literal false [template] // CHECK:STDOUT: %Constant.type: type = fn_type @Constant [template] // CHECK:STDOUT: %Constant: %Constant.type = struct_value () [template] -// CHECK:STDOUT: %.33: type = ptr_type i32 [template] +// CHECK:STDOUT: %.32: type = ptr_type %i32 [template] // CHECK:STDOUT: %PartiallyConstant.type: type = fn_type @PartiallyConstant [template] // CHECK:STDOUT: %PartiallyConstant: %PartiallyConstant.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -84,225 +88,240 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_32, %.loc12_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc12_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_11.3: type = converted %int.make_type_signed, %.loc12_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_32, %.loc14_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc14_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_11.3: type = converted %int.make_type_signed, %.loc14_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc18_11.2: type = converted %int.make_type_32, %.loc18_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc18_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc18_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc18_11.3: type = converted %int.make_type_signed, %.loc18_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Constant.decl: %Constant.type = fn_decl @Constant [template = constants.%Constant] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_18.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] -// CHECK:STDOUT: %.loc22_18.2: type = converted %int.make_type_32.loc22, %.loc22_18.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc22_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%.loc22_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc22_18.2: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] +// CHECK:STDOUT: %.loc22_18.3: type = converted %int.make_type_signed.loc22, %.loc22_18.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %PartiallyConstant.decl: %PartiallyConstant.type = fn_decl @PartiallyConstant [template = constants.%PartiallyConstant] { // CHECK:STDOUT: %t.patt: type = binding_pattern t // CHECK:STDOUT: %t.param_patt: type = value_param_pattern %t.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc28: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc28_34.1: type = value_of_initializer %int.make_type_32.loc28 [template = i32] -// CHECK:STDOUT: %.loc28_34.2: type = converted %int.make_type_32.loc28, %.loc28_34.1 [template = i32] +// CHECK:STDOUT: %.loc28_34.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc28: init type = call constants.%Int(%.loc28_34.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc28_34.2: type = value_of_initializer %int.make_type_signed.loc28 [template = constants.%i32] +// CHECK:STDOUT: %.loc28_34.3: type = converted %int.make_type_signed.loc28, %.loc28_34.2 [template = constants.%i32] // CHECK:STDOUT: %t.param: type = value_param runtime_param0 // CHECK:STDOUT: %t: type = bind_name t, %t.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @A() -> i32 { +// CHECK:STDOUT: fn @A() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_24: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_25.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_25.2: = bound_method %.loc11_24, %.loc11_25.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc11_25.2(%.loc11_24) [template = constants.%.27] -// CHECK:STDOUT: %.loc11_25.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc11_25.4: i32 = converted %.loc11_24, %.loc11_25.3 [template = constants.%.27] -// CHECK:STDOUT: return %.loc11_25.4 +// CHECK:STDOUT: %.loc11_24: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_25.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_25.2: = bound_method %.loc11_24, %.loc11_25.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc11_25.3: = specific_function %.loc11_25.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc11_25.3(%.loc11_24) [template = constants.%.25] +// CHECK:STDOUT: %.loc11_25.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc11_25.5: %i32 = converted %.loc11_24, %.loc11_25.4 [template = constants.%.25] +// CHECK:STDOUT: return %.loc11_25.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @B() -> i32 { +// CHECK:STDOUT: fn @B() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_24: Core.IntLiteral = int_value 2 [template = constants.%.28] -// CHECK:STDOUT: %.loc12_25.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_25.2: = bound_method %.loc12_24, %.loc12_25.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_25.2(%.loc12_24) [template = constants.%.30] -// CHECK:STDOUT: %.loc12_25.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.30] -// CHECK:STDOUT: %.loc12_25.4: i32 = converted %.loc12_24, %.loc12_25.3 [template = constants.%.30] -// CHECK:STDOUT: return %.loc12_25.4 +// CHECK:STDOUT: %.loc12_24: Core.IntLiteral = int_value 2 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_25.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_25.2: = bound_method %.loc12_24, %.loc12_25.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_25.3: = specific_function %.loc12_25.2, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc12_25.3(%.loc12_24) [template = constants.%.29] +// CHECK:STDOUT: %.loc12_25.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.29] +// CHECK:STDOUT: %.loc12_25.5: %i32 = converted %.loc12_24, %.loc12_25.4 [template = constants.%.29] +// CHECK:STDOUT: return %.loc12_25.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32 { +// CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15_13: bool = bool_literal true [template = constants.%.31] +// CHECK:STDOUT: %.loc15_13: bool = bool_literal true [template = constants.%.30] // CHECK:STDOUT: if %.loc15_13 br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %A.call: init i32 = call %A.ref() -// CHECK:STDOUT: %.loc15_24.1: i32 = value_of_initializer %A.call -// CHECK:STDOUT: %.loc15_24.2: i32 = converted %A.call, %.loc15_24.1 +// CHECK:STDOUT: %A.call: init %i32 = call %A.ref() +// CHECK:STDOUT: %.loc15_24.1: %i32 = value_of_initializer %A.call +// CHECK:STDOUT: %.loc15_24.2: %i32 = converted %A.call, %.loc15_24.1 // CHECK:STDOUT: br !if.expr.result(%.loc15_24.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: // CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %B.call: init i32 = call %B.ref() -// CHECK:STDOUT: %.loc15_27.1: i32 = value_of_initializer %B.call -// CHECK:STDOUT: %.loc15_27.2: i32 = converted %B.call, %.loc15_27.1 +// CHECK:STDOUT: %B.call: init %i32 = call %B.ref() +// CHECK:STDOUT: %.loc15_27.1: %i32 = value_of_initializer %B.call +// CHECK:STDOUT: %.loc15_27.2: %i32 = converted %B.call, %.loc15_27.1 // CHECK:STDOUT: br !if.expr.result(%.loc15_27.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result: -// CHECK:STDOUT: %.loc15_10: i32 = block_arg !if.expr.result +// CHECK:STDOUT: %.loc15_10: %i32 = block_arg !if.expr.result // CHECK:STDOUT: return %.loc15_10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> i32 { +// CHECK:STDOUT: fn @G() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc19_13: bool = bool_literal false [template = constants.%.32] +// CHECK:STDOUT: %.loc19_13: bool = bool_literal false [template = constants.%.31] // CHECK:STDOUT: if %.loc19_13 br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %A.call: init i32 = call %A.ref() -// CHECK:STDOUT: %.loc19_25.1: i32 = value_of_initializer %A.call -// CHECK:STDOUT: %.loc19_25.2: i32 = converted %A.call, %.loc19_25.1 +// CHECK:STDOUT: %A.call: init %i32 = call %A.ref() +// CHECK:STDOUT: %.loc19_25.1: %i32 = value_of_initializer %A.call +// CHECK:STDOUT: %.loc19_25.2: %i32 = converted %A.call, %.loc19_25.1 // CHECK:STDOUT: br !if.expr.result(%.loc19_25.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: // CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %B.call: init i32 = call %B.ref() -// CHECK:STDOUT: %.loc19_28.1: i32 = value_of_initializer %B.call -// CHECK:STDOUT: %.loc19_28.2: i32 = converted %B.call, %.loc19_28.1 +// CHECK:STDOUT: %B.call: init %i32 = call %B.ref() +// CHECK:STDOUT: %.loc19_28.1: %i32 = value_of_initializer %B.call +// CHECK:STDOUT: %.loc19_28.2: %i32 = converted %B.call, %.loc19_28.1 // CHECK:STDOUT: br !if.expr.result(%.loc19_28.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result: -// CHECK:STDOUT: %.loc19_10: i32 = block_arg !if.expr.result +// CHECK:STDOUT: %.loc19_10: %i32 = block_arg !if.expr.result // CHECK:STDOUT: return %.loc19_10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Constant() -> i32 { +// CHECK:STDOUT: fn @Constant() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc23_13: bool = bool_literal true [template = constants.%.31] +// CHECK:STDOUT: %.loc23_13: bool = bool_literal true [template = constants.%.30] // CHECK:STDOUT: if %.loc23_13 br !if.expr.then.loc23 else br !if.expr.else.loc23 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc23: -// CHECK:STDOUT: %int.make_type_32.loc23_23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_23.1: type = value_of_initializer %int.make_type_32.loc23_23 [template = i32] -// CHECK:STDOUT: %.loc23_23.2: type = converted %int.make_type_32.loc23_23, %.loc23_23.1 [template = i32] -// CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_23.2) +// CHECK:STDOUT: %.loc23_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc23_23: init type = call constants.%Int(%.loc23_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_23.2: type = value_of_initializer %int.make_type_signed.loc23_23 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_23.3: type = converted %int.make_type_signed.loc23_23, %.loc23_23.2 [template = constants.%i32] +// CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_23.3) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc23: -// CHECK:STDOUT: %int.make_type_32.loc23_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_35.1: type = value_of_initializer %int.make_type_32.loc23_32 [template = i32] -// CHECK:STDOUT: %.loc23_35.2: type = converted %int.make_type_32.loc23_32, %.loc23_35.1 [template = i32] -// CHECK:STDOUT: %.loc23_35.3: type = ptr_type i32 [template = constants.%.33] +// CHECK:STDOUT: %.loc23_32: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc23_32: init type = call constants.%Int(%.loc23_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_35.1: type = value_of_initializer %int.make_type_signed.loc23_32 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_35.2: type = converted %int.make_type_signed.loc23_32, %.loc23_35.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_35.3: type = ptr_type %i32 [template = constants.%.32] // CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_35.3) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc23: -// CHECK:STDOUT: %.loc23_10: type = block_arg !if.expr.result.loc23 [template = i32] -// CHECK:STDOUT: %v.var: ref i32 = var v -// CHECK:STDOUT: %v: ref i32 = bind_name v, %v.var -// CHECK:STDOUT: %.loc23_39: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc23_40.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc23_40.2: = bound_method %.loc23_39, %.loc23_40.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc23_40.2(%.loc23_39) [template = constants.%.27] -// CHECK:STDOUT: %.loc23_40.3: init i32 = converted %.loc23_39, %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: assign %v.var, %.loc23_40.3 -// CHECK:STDOUT: %.loc24_13: bool = bool_literal false [template = constants.%.32] +// CHECK:STDOUT: %.loc23_10: type = block_arg !if.expr.result.loc23 [template = constants.%i32] +// CHECK:STDOUT: %v.var: ref %i32 = var v +// CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var +// CHECK:STDOUT: %.loc23_39: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc23_40.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc23_40.2: = bound_method %.loc23_39, %.loc23_40.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc23_40.3: = specific_function %.loc23_40.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc23_40.3(%.loc23_39) [template = constants.%.25] +// CHECK:STDOUT: %.loc23_40.4: init %i32 = converted %.loc23_39, %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: assign %v.var, %.loc23_40.4 +// CHECK:STDOUT: %.loc24_13: bool = bool_literal false [template = constants.%.31] // CHECK:STDOUT: if %.loc24_13 br !if.expr.then.loc24 else br !if.expr.else.loc24 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc24: -// CHECK:STDOUT: %int.make_type_32.loc24_24: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc24_24.1: type = value_of_initializer %int.make_type_32.loc24_24 [template = i32] -// CHECK:STDOUT: %.loc24_24.2: type = converted %int.make_type_32.loc24_24, %.loc24_24.1 [template = i32] -// CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_24.2) +// CHECK:STDOUT: %.loc24_24.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc24_24: init type = call constants.%Int(%.loc24_24.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc24_24.2: type = value_of_initializer %int.make_type_signed.loc24_24 [template = constants.%i32] +// CHECK:STDOUT: %.loc24_24.3: type = converted %int.make_type_signed.loc24_24, %.loc24_24.2 [template = constants.%i32] +// CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_24.3) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc24: -// CHECK:STDOUT: %int.make_type_32.loc24_33: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc24_36.1: type = value_of_initializer %int.make_type_32.loc24_33 [template = i32] -// CHECK:STDOUT: %.loc24_36.2: type = converted %int.make_type_32.loc24_33, %.loc24_36.1 [template = i32] -// CHECK:STDOUT: %.loc24_36.3: type = ptr_type i32 [template = constants.%.33] +// CHECK:STDOUT: %.loc24_33: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc24_33: init type = call constants.%Int(%.loc24_33) [template = constants.%i32] +// CHECK:STDOUT: %.loc24_36.1: type = value_of_initializer %int.make_type_signed.loc24_33 [template = constants.%i32] +// CHECK:STDOUT: %.loc24_36.2: type = converted %int.make_type_signed.loc24_33, %.loc24_36.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc24_36.3: type = ptr_type %i32 [template = constants.%.32] // CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_36.3) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc24: -// CHECK:STDOUT: %.loc24_10: type = block_arg !if.expr.result.loc24 [template = constants.%.33] -// CHECK:STDOUT: %w.var: ref %.33 = var w -// CHECK:STDOUT: %w: ref %.33 = bind_name w, %w.var -// CHECK:STDOUT: %v.ref: ref i32 = name_ref v, %v -// CHECK:STDOUT: %.loc24_40: %.33 = addr_of %v.ref +// CHECK:STDOUT: %.loc24_10: type = block_arg !if.expr.result.loc24 [template = constants.%.32] +// CHECK:STDOUT: %w.var: ref %.32 = var w +// CHECK:STDOUT: %w: ref %.32 = bind_name w, %w.var +// CHECK:STDOUT: %v.ref: ref %i32 = name_ref v, %v +// CHECK:STDOUT: %.loc24_40: %.32 = addr_of %v.ref // CHECK:STDOUT: assign %w.var, %.loc24_40 -// CHECK:STDOUT: %w.ref: ref %.33 = name_ref w, %w -// CHECK:STDOUT: %.loc25_11: %.33 = bind_value %w.ref -// CHECK:STDOUT: %.loc25_10.1: ref i32 = deref %.loc25_11 -// CHECK:STDOUT: %.loc25_10.2: i32 = bind_value %.loc25_10.1 +// CHECK:STDOUT: %w.ref: ref %.32 = name_ref w, %w +// CHECK:STDOUT: %.loc25_11: %.32 = bind_value %w.ref +// CHECK:STDOUT: %.loc25_10.1: ref %i32 = deref %.loc25_11 +// CHECK:STDOUT: %.loc25_10.2: %i32 = bind_value %.loc25_10.1 // CHECK:STDOUT: return %.loc25_10.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @PartiallyConstant(%t.param_patt: type) -> i32 { +// CHECK:STDOUT: fn @PartiallyConstant(%t.param_patt: type) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc29_13: bool = bool_literal true [template = constants.%.31] +// CHECK:STDOUT: %.loc29_13: bool = bool_literal true [template = constants.%.30] // CHECK:STDOUT: if %.loc29_13 br !if.expr.then.loc29 else br !if.expr.else.loc29 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc29: -// CHECK:STDOUT: %int.make_type_32.loc29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc29_23.1: type = value_of_initializer %int.make_type_32.loc29 [template = i32] -// CHECK:STDOUT: %.loc29_23.2: type = converted %int.make_type_32.loc29, %.loc29_23.1 [template = i32] -// CHECK:STDOUT: br !if.expr.result.loc29(%.loc29_23.2) +// CHECK:STDOUT: %.loc29_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc29: init type = call constants.%Int(%.loc29_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc29_23.2: type = value_of_initializer %int.make_type_signed.loc29 [template = constants.%i32] +// CHECK:STDOUT: %.loc29_23.3: type = converted %int.make_type_signed.loc29, %.loc29_23.2 [template = constants.%i32] +// CHECK:STDOUT: br !if.expr.result.loc29(%.loc29_23.3) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc29: // CHECK:STDOUT: %t.ref.loc29: type = name_ref t, %t // CHECK:STDOUT: br !if.expr.result.loc29(%t.ref.loc29) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc29: -// CHECK:STDOUT: %.loc29_10: type = block_arg !if.expr.result.loc29 [template = i32] -// CHECK:STDOUT: %v.var: ref i32 = var v -// CHECK:STDOUT: %v: ref i32 = bind_name v, %v.var -// CHECK:STDOUT: %.loc29_36: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc29_37.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc29_37.2: = bound_method %.loc29_36, %.loc29_37.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc29_37.2(%.loc29_36) [template = constants.%.27] -// CHECK:STDOUT: %.loc29_37.3: init i32 = converted %.loc29_36, %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: assign %v.var, %.loc29_37.3 -// CHECK:STDOUT: %.loc30_13: bool = bool_literal false [template = constants.%.32] +// CHECK:STDOUT: %.loc29_10: type = block_arg !if.expr.result.loc29 [template = constants.%i32] +// CHECK:STDOUT: %v.var: ref %i32 = var v +// CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var +// CHECK:STDOUT: %.loc29_36: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc29_37.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc29_37.2: = bound_method %.loc29_36, %.loc29_37.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc29_37.3: = specific_function %.loc29_37.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc29_37.3(%.loc29_36) [template = constants.%.25] +// CHECK:STDOUT: %.loc29_37.4: init %i32 = converted %.loc29_36, %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: assign %v.var, %.loc29_37.4 +// CHECK:STDOUT: %.loc30_13: bool = bool_literal false [template = constants.%.31] // CHECK:STDOUT: if %.loc30_13 br !if.expr.then.loc30 else br !if.expr.else.loc30 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc30: @@ -310,23 +329,24 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: br !if.expr.result.loc30(%t.ref.loc30) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc30: -// CHECK:STDOUT: %int.make_type_32.loc30: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc30_34.1: type = value_of_initializer %int.make_type_32.loc30 [template = i32] -// CHECK:STDOUT: %.loc30_34.2: type = converted %int.make_type_32.loc30, %.loc30_34.1 [template = i32] -// CHECK:STDOUT: %.loc30_34.3: type = ptr_type i32 [template = constants.%.33] +// CHECK:STDOUT: %.loc30_31: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc30: init type = call constants.%Int(%.loc30_31) [template = constants.%i32] +// CHECK:STDOUT: %.loc30_34.1: type = value_of_initializer %int.make_type_signed.loc30 [template = constants.%i32] +// CHECK:STDOUT: %.loc30_34.2: type = converted %int.make_type_signed.loc30, %.loc30_34.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc30_34.3: type = ptr_type %i32 [template = constants.%.32] // CHECK:STDOUT: br !if.expr.result.loc30(%.loc30_34.3) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc30: -// CHECK:STDOUT: %.loc30_10: type = block_arg !if.expr.result.loc30 [template = constants.%.33] -// CHECK:STDOUT: %w.var: ref %.33 = var w -// CHECK:STDOUT: %w: ref %.33 = bind_name w, %w.var -// CHECK:STDOUT: %v.ref: ref i32 = name_ref v, %v -// CHECK:STDOUT: %.loc30_38: %.33 = addr_of %v.ref +// CHECK:STDOUT: %.loc30_10: type = block_arg !if.expr.result.loc30 [template = constants.%.32] +// CHECK:STDOUT: %w.var: ref %.32 = var w +// CHECK:STDOUT: %w: ref %.32 = bind_name w, %w.var +// CHECK:STDOUT: %v.ref: ref %i32 = name_ref v, %v +// CHECK:STDOUT: %.loc30_38: %.32 = addr_of %v.ref // CHECK:STDOUT: assign %w.var, %.loc30_38 -// CHECK:STDOUT: %w.ref: ref %.33 = name_ref w, %w -// CHECK:STDOUT: %.loc31_11: %.33 = bind_value %w.ref -// CHECK:STDOUT: %.loc31_10.1: ref i32 = deref %.loc31_11 -// CHECK:STDOUT: %.loc31_10.2: i32 = bind_value %.loc31_10.1 +// CHECK:STDOUT: %w.ref: ref %.32 = name_ref w, %w +// CHECK:STDOUT: %.loc31_11: %.32 = bind_value %w.ref +// CHECK:STDOUT: %.loc31_10.1: ref %i32 = deref %.loc31_11 +// CHECK:STDOUT: %.loc31_10.2: %i32 = bind_value %.loc31_10.1 // CHECK:STDOUT: return %.loc31_10.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/control_flow.carbon b/toolchain/check/testdata/if_expr/control_flow.carbon index 2ef2dc478552..1e8dd3b1f77b 100644 --- a/toolchain/check/testdata/if_expr/control_flow.carbon +++ b/toolchain/check/testdata/if_expr/control_flow.carbon @@ -18,22 +18,26 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: --- control_flow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.27: = bound_method %.26, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -42,9 +46,9 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Bool = %import_ref.51 +// CHECK:STDOUT: .Bool = %import_ref.38 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -59,87 +63,92 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_32, %.loc12_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc12_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_11.3: type = converted %int.make_type_signed, %.loc12_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc14_9.2: type = converted %bool.make_type, %.loc14_9.1 [template = bool] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_18.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_18.2: type = converted %int.make_type_32, %.loc14_18.1 [template = i32] +// CHECK:STDOUT: %.loc14_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_18.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_18.3: type = converted %int.make_type_signed, %.loc14_18.2 [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @A() -> i32 { +// CHECK:STDOUT: fn @A() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_24: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_25.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_25.2: = bound_method %.loc11_24, %.loc11_25.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc11_25.2(%.loc11_24) [template = constants.%.27] -// CHECK:STDOUT: %.loc11_25.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc11_25.4: i32 = converted %.loc11_24, %.loc11_25.3 [template = constants.%.27] -// CHECK:STDOUT: return %.loc11_25.4 +// CHECK:STDOUT: %.loc11_24: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_25.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_25.2: = bound_method %.loc11_24, %.loc11_25.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc11_25.3: = specific_function %.loc11_25.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc11_25.3(%.loc11_24) [template = constants.%.25] +// CHECK:STDOUT: %.loc11_25.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc11_25.5: %i32 = converted %.loc11_24, %.loc11_25.4 [template = constants.%.25] +// CHECK:STDOUT: return %.loc11_25.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @B() -> i32 { +// CHECK:STDOUT: fn @B() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_24: Core.IntLiteral = int_value 2 [template = constants.%.28] -// CHECK:STDOUT: %.loc12_25.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_25.2: = bound_method %.loc12_24, %.loc12_25.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_25.2(%.loc12_24) [template = constants.%.30] -// CHECK:STDOUT: %.loc12_25.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.30] -// CHECK:STDOUT: %.loc12_25.4: i32 = converted %.loc12_24, %.loc12_25.3 [template = constants.%.30] -// CHECK:STDOUT: return %.loc12_25.4 +// CHECK:STDOUT: %.loc12_24: Core.IntLiteral = int_value 2 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_25.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_25.2: = bound_method %.loc12_24, %.loc12_25.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_25.3: = specific_function %.loc12_25.2, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc12_25.3(%.loc12_24) [template = constants.%.29] +// CHECK:STDOUT: %.loc12_25.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.29] +// CHECK:STDOUT: %.loc12_25.5: %i32 = converted %.loc12_24, %.loc12_25.4 [template = constants.%.29] +// CHECK:STDOUT: return %.loc12_25.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%b.param_patt: bool) -> i32 { +// CHECK:STDOUT: fn @F(%b.param_patt: bool) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %A.call: init i32 = call %A.ref() -// CHECK:STDOUT: %.loc15_21.1: i32 = value_of_initializer %A.call -// CHECK:STDOUT: %.loc15_21.2: i32 = converted %A.call, %.loc15_21.1 +// CHECK:STDOUT: %A.call: init %i32 = call %A.ref() +// CHECK:STDOUT: %.loc15_21.1: %i32 = value_of_initializer %A.call +// CHECK:STDOUT: %.loc15_21.2: %i32 = converted %A.call, %.loc15_21.1 // CHECK:STDOUT: br !if.expr.result(%.loc15_21.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: // CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %B.call: init i32 = call %B.ref() -// CHECK:STDOUT: %.loc15_24.1: i32 = value_of_initializer %B.call -// CHECK:STDOUT: %.loc15_24.2: i32 = converted %B.call, %.loc15_24.1 +// CHECK:STDOUT: %B.call: init %i32 = call %B.ref() +// CHECK:STDOUT: %.loc15_24.1: %i32 = value_of_initializer %B.call +// CHECK:STDOUT: %.loc15_24.2: %i32 = converted %B.call, %.loc15_24.1 // CHECK:STDOUT: br !if.expr.result(%.loc15_24.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result: -// CHECK:STDOUT: %.loc15_10: i32 = block_arg !if.expr.result +// CHECK:STDOUT: %.loc15_10: %i32 = block_arg !if.expr.result // CHECK:STDOUT: return %.loc15_10 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon index 3d4942899f69..3d0b9ba16453 100644 --- a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon @@ -40,17 +40,19 @@ class C { // CHECK:STDOUT: --- fail_not_in_function.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: bool = bool_literal true [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: bool = bool_literal true [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Float = %import_ref.51 +// CHECK:STDOUT: .Float = %import_ref.38 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -59,28 +61,29 @@ class C { // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .x = .inst+14.loc23_5 +// CHECK:STDOUT: .x = .inst+21.loc23_5 // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_8.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc23_8.2: type = converted %int.make_type_32, %.loc23_8.1 [template = i32] +// CHECK:STDOUT: %.loc23_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc23_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc23_8.3: type = converted %int.make_type_signed, %.loc23_8.2 [template = constants.%i32] // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc37: bool = bool_literal true [template = constants.%.1] +// CHECK:STDOUT: %.loc37: bool = bool_literal true [template = constants.%.2] // CHECK:STDOUT: if %.loc37 br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .n = .inst+425.loc37_8 +// CHECK:STDOUT: .n = .inst+407.loc37_8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc23: bool = bool_literal true [template = constants.%.1] +// CHECK:STDOUT: %.loc23: bool = bool_literal true [template = constants.%.2] // CHECK:STDOUT: if %.loc23 br !if.expr.then else br !if.expr.else // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon index 4c068c3190ef..d6dfcbfd21d6 100644 --- a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon +++ b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon @@ -46,15 +46,17 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %ConditionIsNonConstant.type: type = fn_type @ConditionIsNonConstant [template] // CHECK:STDOUT: %ConditionIsNonConstant: %ConditionIsNonConstant.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.1 -// CHECK:STDOUT: .Int32 = %import_ref.2 +// CHECK:STDOUT: .Int = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -84,22 +86,24 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: -// CHECK:STDOUT: %int.make_type_32.loc12_20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_20.1: type = value_of_initializer %int.make_type_32.loc12_20 [template = i32] -// CHECK:STDOUT: %.loc12_20.2: type = converted %int.make_type_32.loc12_20, %.loc12_20.1 [template = i32] -// CHECK:STDOUT: br !if.expr.result(%.loc12_20.2) +// CHECK:STDOUT: %.loc12_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_20: init type = call constants.%Int(%.loc12_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_20.2: type = value_of_initializer %int.make_type_signed.loc12_20 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_20.3: type = converted %int.make_type_signed.loc12_20, %.loc12_20.2 [template = constants.%i32] +// CHECK:STDOUT: br !if.expr.result(%.loc12_20.3) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %int.make_type_32.loc12_29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_24.1: type = value_of_initializer %int.make_type_32.loc12_29 [template = i32] -// CHECK:STDOUT: %.loc12_24.2: type = converted %int.make_type_32.loc12_29, %.loc12_24.1 [template = i32] +// CHECK:STDOUT: %.loc12_29: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_29: init type = call constants.%Int(%.loc12_29) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_24.1: type = value_of_initializer %int.make_type_signed.loc12_29 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_24.2: type = converted %int.make_type_signed.loc12_29, %.loc12_24.1 [template = constants.%i32] // CHECK:STDOUT: br !if.expr.result(%.loc12_24.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result: // CHECK:STDOUT: %.loc12_10: type = block_arg !if.expr.result // CHECK:STDOUT: %v.var: ref = var v // CHECK:STDOUT: %v: ref = bind_name v, %v.var -// CHECK:STDOUT: %.loc12_35: Core.IntLiteral = int_value 1 [template = constants.%.1] +// CHECK:STDOUT: %.loc12_35: Core.IntLiteral = int_value 1 [template = constants.%.2] // CHECK:STDOUT: assign %v.var, // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -110,15 +114,17 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: %ChosenBranchIsNonConstant.type: type = fn_type @ChosenBranchIsNonConstant [template] // CHECK:STDOUT: %ChosenBranchIsNonConstant: %ChosenBranchIsNonConstant.type = struct_value () [template] // CHECK:STDOUT: %.1: bool = bool_literal true [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.3: bool = bool_literal false [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.2 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.4: bool = bool_literal false [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -149,25 +155,27 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: br !if.expr.result.loc9(%t.ref.loc9) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc9: -// CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_25.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] -// CHECK:STDOUT: %.loc9_25.2: type = converted %int.make_type_32.loc9, %.loc9_25.1 [template = i32] +// CHECK:STDOUT: %.loc9_30: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%.loc9_30) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_25.1: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_25.2: type = converted %int.make_type_signed.loc9, %.loc9_25.1 [template = constants.%i32] // CHECK:STDOUT: br !if.expr.result.loc9(%.loc9_25.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc9: // CHECK:STDOUT: %.loc9_10: type = block_arg !if.expr.result.loc9 // CHECK:STDOUT: %v.var: ref = var v // CHECK:STDOUT: %v: ref = bind_name v, %v.var -// CHECK:STDOUT: %.loc9_36: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc9_36: Core.IntLiteral = int_value 1 [template = constants.%.3] // CHECK:STDOUT: assign %v.var, -// CHECK:STDOUT: %.loc13_13: bool = bool_literal false [template = constants.%.3] +// CHECK:STDOUT: %.loc13_13: bool = bool_literal false [template = constants.%.4] // CHECK:STDOUT: if %.loc13_13 br !if.expr.then.loc13 else br !if.expr.else.loc13 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc13: -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_24.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_24.2: type = converted %int.make_type_32.loc13, %.loc13_24.1 [template = i32] -// CHECK:STDOUT: br !if.expr.result.loc13(%.loc13_24.2) +// CHECK:STDOUT: %.loc13_24.1: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_24.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_24.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_24.3: type = converted %int.make_type_signed.loc13, %.loc13_24.2 [template = constants.%i32] +// CHECK:STDOUT: br !if.expr.result.loc13(%.loc13_24.3) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc13: // CHECK:STDOUT: %t.ref.loc13: type = name_ref t, %t @@ -177,7 +185,7 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: %.loc13_10: type = block_arg !if.expr.result.loc13 // CHECK:STDOUT: %w.var: ref = var w // CHECK:STDOUT: %w: ref = bind_name w, %w.var -// CHECK:STDOUT: %.loc13_37: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc13_37: Core.IntLiteral = int_value 1 [template = constants.%.3] // CHECK:STDOUT: assign %w.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if_expr/nested.carbon b/toolchain/check/testdata/if_expr/nested.carbon index 77a7428686e8..ea00d5bf77f0 100644 --- a/toolchain/check/testdata/if_expr/nested.carbon +++ b/toolchain/check/testdata/if_expr/nested.carbon @@ -17,32 +17,38 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] -// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.32: = bound_method %.31, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 3 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.27: = bound_method %.26, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.31: = bound_method %.30, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 3 [template] // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %.35: = bound_method %.34, %Convert.15 [template] -// CHECK:STDOUT: %.36: i32 = int_value 4 [template] +// CHECK:STDOUT: %.35: = bound_method %.34, %Convert.14 [template] +// CHECK:STDOUT: %.36: = specific_function %.35, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.37: %i32 = int_value 4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.1 -// CHECK:STDOUT: .Int32 = %import_ref.2 +// CHECK:STDOUT: .Int = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -62,8 +68,8 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: %c.patt: bool = binding_pattern c // CHECK:STDOUT: %c.param_patt: bool = value_param_pattern %c.patt, runtime_param2 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param3 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type.loc11_9: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type.loc11_9 [template = bool] @@ -74,21 +80,22 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %bool.make_type.loc11_27: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %bool.make_type.loc11_27 [template = bool] // CHECK:STDOUT: %.loc11_27.2: type = converted %bool.make_type.loc11_27, %.loc11_27.1 [template = bool] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_36.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_36.2: type = converted %int.make_type_32, %.loc11_36.1 [template = i32] +// CHECK:STDOUT: %.loc11_36.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_36.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_36.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_36.3: type = converted %int.make_type_signed, %.loc11_36.2 [template = constants.%i32] // CHECK:STDOUT: %a.param: bool = value_param runtime_param0 // CHECK:STDOUT: %a: bool = bind_name a, %a.param // CHECK:STDOUT: %b.param: bool = value_param runtime_param1 // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %c.param: bool = value_param runtime_param2 // CHECK:STDOUT: %c: bool = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param3 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%a.param_patt: bool, %b.param_patt: bool, %c.param_patt: bool) -> i32 { +// CHECK:STDOUT: fn @F(%a.param_patt: bool, %b.param_patt: bool, %c.param_patt: bool) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: bool = name_ref a, %a // CHECK:STDOUT: if %a.ref br !if.expr.then.loc12_10 else br !if.expr.else.loc12_10 @@ -98,25 +105,27 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: if %b.ref br !if.expr.then.loc12_20 else br !if.expr.else.loc12_20 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc12_20: -// CHECK:STDOUT: %.loc12_30: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_25.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_25.2: = bound_method %.loc12_30, %.loc12_25.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc12_25: init i32 = call %.loc12_25.2(%.loc12_30) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_25.3: i32 = value_of_initializer %int.convert_checked.loc12_25 [template = constants.%.27] -// CHECK:STDOUT: %.loc12_25.4: i32 = converted %.loc12_30, %.loc12_25.3 [template = constants.%.27] -// CHECK:STDOUT: br !if.expr.result.loc12_20(%.loc12_25.4) +// CHECK:STDOUT: %.loc12_30: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_25.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_25.2: = bound_method %.loc12_30, %.loc12_25.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_25.3: = specific_function %.loc12_25.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc12_25: init %i32 = call %.loc12_25.3(%.loc12_30) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_25.4: %i32 = value_of_initializer %int.convert_checked.loc12_25 [template = constants.%.25] +// CHECK:STDOUT: %.loc12_25.5: %i32 = converted %.loc12_30, %.loc12_25.4 [template = constants.%.25] +// CHECK:STDOUT: br !if.expr.result.loc12_20(%.loc12_25.5) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc12_20: -// CHECK:STDOUT: %.loc12_37: Core.IntLiteral = int_value 2 [template = constants.%.28] -// CHECK:STDOUT: %.loc12_32.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_32.2: = bound_method %.loc12_37, %.loc12_32.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc12_32: init i32 = call %.loc12_32.2(%.loc12_37) [template = constants.%.30] -// CHECK:STDOUT: %.loc12_32.3: i32 = value_of_initializer %int.convert_checked.loc12_32 [template = constants.%.30] -// CHECK:STDOUT: %.loc12_32.4: i32 = converted %.loc12_37, %.loc12_32.3 [template = constants.%.30] -// CHECK:STDOUT: br !if.expr.result.loc12_20(%.loc12_32.4) +// CHECK:STDOUT: %.loc12_37: Core.IntLiteral = int_value 2 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_32.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_32.2: = bound_method %.loc12_37, %.loc12_32.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_32.3: = specific_function %.loc12_32.2, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc12_32: init %i32 = call %.loc12_32.3(%.loc12_37) [template = constants.%.29] +// CHECK:STDOUT: %.loc12_32.4: %i32 = value_of_initializer %int.convert_checked.loc12_32 [template = constants.%.29] +// CHECK:STDOUT: %.loc12_32.5: %i32 = converted %.loc12_37, %.loc12_32.4 [template = constants.%.29] +// CHECK:STDOUT: br !if.expr.result.loc12_20(%.loc12_32.5) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc12_20: -// CHECK:STDOUT: %.loc12_20: i32 = block_arg !if.expr.result.loc12_20 +// CHECK:STDOUT: %.loc12_20: %i32 = block_arg !if.expr.result.loc12_20 // CHECK:STDOUT: br !if.expr.result.loc12_10(%.loc12_20) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc12_10: @@ -124,29 +133,31 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: if %c.ref br !if.expr.then.loc12_44 else br !if.expr.else.loc12_44 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc12_44: -// CHECK:STDOUT: %.loc12_54: Core.IntLiteral = int_value 3 [template = constants.%.31] -// CHECK:STDOUT: %.loc12_49.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_49.2: = bound_method %.loc12_54, %.loc12_49.1 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc12_49: init i32 = call %.loc12_49.2(%.loc12_54) [template = constants.%.33] -// CHECK:STDOUT: %.loc12_49.3: i32 = value_of_initializer %int.convert_checked.loc12_49 [template = constants.%.33] -// CHECK:STDOUT: %.loc12_49.4: i32 = converted %.loc12_54, %.loc12_49.3 [template = constants.%.33] -// CHECK:STDOUT: br !if.expr.result.loc12_44(%.loc12_49.4) +// CHECK:STDOUT: %.loc12_54: Core.IntLiteral = int_value 3 [template = constants.%.30] +// CHECK:STDOUT: %.loc12_49.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_49.2: = bound_method %.loc12_54, %.loc12_49.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc12_49.3: = specific_function %.loc12_49.2, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc12_49: init %i32 = call %.loc12_49.3(%.loc12_54) [template = constants.%.33] +// CHECK:STDOUT: %.loc12_49.4: %i32 = value_of_initializer %int.convert_checked.loc12_49 [template = constants.%.33] +// CHECK:STDOUT: %.loc12_49.5: %i32 = converted %.loc12_54, %.loc12_49.4 [template = constants.%.33] +// CHECK:STDOUT: br !if.expr.result.loc12_44(%.loc12_49.5) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc12_44: // CHECK:STDOUT: %.loc12_61: Core.IntLiteral = int_value 4 [template = constants.%.34] -// CHECK:STDOUT: %.loc12_56.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc12_56.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] // CHECK:STDOUT: %.loc12_56.2: = bound_method %.loc12_61, %.loc12_56.1 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc12_56: init i32 = call %.loc12_56.2(%.loc12_61) [template = constants.%.36] -// CHECK:STDOUT: %.loc12_56.3: i32 = value_of_initializer %int.convert_checked.loc12_56 [template = constants.%.36] -// CHECK:STDOUT: %.loc12_56.4: i32 = converted %.loc12_61, %.loc12_56.3 [template = constants.%.36] -// CHECK:STDOUT: br !if.expr.result.loc12_44(%.loc12_56.4) +// CHECK:STDOUT: %.loc12_56.3: = specific_function %.loc12_56.2, @Convert.2(constants.%.1) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc12_56: init %i32 = call %.loc12_56.3(%.loc12_61) [template = constants.%.37] +// CHECK:STDOUT: %.loc12_56.4: %i32 = value_of_initializer %int.convert_checked.loc12_56 [template = constants.%.37] +// CHECK:STDOUT: %.loc12_56.5: %i32 = converted %.loc12_61, %.loc12_56.4 [template = constants.%.37] +// CHECK:STDOUT: br !if.expr.result.loc12_44(%.loc12_56.5) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc12_44: -// CHECK:STDOUT: %.loc12_44: i32 = block_arg !if.expr.result.loc12_44 +// CHECK:STDOUT: %.loc12_44: %i32 = block_arg !if.expr.result.loc12_44 // CHECK:STDOUT: br !if.expr.result.loc12_10(%.loc12_44) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc12_10: -// CHECK:STDOUT: %.loc12_10: i32 = block_arg !if.expr.result.loc12_10 +// CHECK:STDOUT: %.loc12_10: %i32 = block_arg !if.expr.result.loc12_10 // CHECK:STDOUT: return %.loc12_10 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index 5f50fdde08b2..7ae25d97568a 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -18,33 +18,37 @@ fn F(cond: bool) { // CHECK:STDOUT: --- struct.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: i32, .b: i32} [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %i32, .b: %i32} [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.5: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 2 [template] -// CHECK:STDOUT: %struct: %.1 = struct_value (%.31, %.33) [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.6: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 2 [template] +// CHECK:STDOUT: %struct: %.2 = struct_value (%.29, %.32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude @@ -60,18 +64,20 @@ fn F(cond: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %s.patt: %.1 = binding_pattern s -// CHECK:STDOUT: %s.param_patt: %.1 = value_param_pattern %s.patt, runtime_param0 +// CHECK:STDOUT: %s.patt: %.2 = binding_pattern s +// CHECK:STDOUT: %s.param_patt: %.2 = value_param_pattern %s.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32.loc11_14, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_23.1: type = value_of_initializer %int.make_type_32.loc11_23 [template = i32] -// CHECK:STDOUT: %.loc11_23.2: type = converted %int.make_type_32.loc11_23, %.loc11_23.1 [template = i32] -// CHECK:STDOUT: %.loc11_26: type = struct_type {.a: i32, .b: i32} [template = constants.%.1] -// CHECK:STDOUT: %s.param: %.1 = value_param runtime_param0 -// CHECK:STDOUT: %s: %.1 = bind_name s, %s.param +// CHECK:STDOUT: %.loc11_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%.loc11_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.2: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.3: type = converted %int.make_type_signed.loc11_14, %.loc11_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_23: init type = call constants.%Int(%.loc11_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_23.2: type = value_of_initializer %int.make_type_signed.loc11_23 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_23.3: type = converted %int.make_type_signed.loc11_23, %.loc11_23.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_26: type = struct_type {.a: %i32, .b: %i32} [template = constants.%.2] +// CHECK:STDOUT: %s.param: %.2 = value_param runtime_param0 +// CHECK:STDOUT: %s: %.2 = bind_name s, %s.param // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %cond.patt: bool = binding_pattern cond @@ -85,63 +91,67 @@ fn F(cond: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%s.param_patt: %.1); +// CHECK:STDOUT: fn @G(%s.param_patt: %.2); // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%cond.param_patt: bool) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc14_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_15.1: type = value_of_initializer %int.make_type_32.loc14_15 [template = i32] -// CHECK:STDOUT: %.loc14_15.2: type = converted %int.make_type_32.loc14_15, %.loc14_15.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_24: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_24.1: type = value_of_initializer %int.make_type_32.loc14_24 [template = i32] -// CHECK:STDOUT: %.loc14_24.2: type = converted %int.make_type_32.loc14_24, %.loc14_24.1 [template = i32] -// CHECK:STDOUT: %.loc14_27: type = struct_type {.a: i32, .b: i32} [template = constants.%.1] -// CHECK:STDOUT: %a.var: ref %.1 = var a -// CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var -// CHECK:STDOUT: %.loc14_37: Core.IntLiteral = int_value 1 [template = constants.%.3] -// CHECK:STDOUT: %.loc14_45: Core.IntLiteral = int_value 2 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_46.1: %.5 = struct_literal (%.loc14_37, %.loc14_45) -// CHECK:STDOUT: %.loc14_46.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_46.3: = bound_method %.loc14_37, %.loc14_46.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc14_46.1: init i32 = call %.loc14_46.3(%.loc14_37) [template = constants.%.31] -// CHECK:STDOUT: %.loc14_46.4: init i32 = converted %.loc14_37, %int.convert_checked.loc14_46.1 [template = constants.%.31] -// CHECK:STDOUT: %.loc14_46.5: ref i32 = struct_access %a.var, element0 -// CHECK:STDOUT: %.loc14_46.6: init i32 = initialize_from %.loc14_46.4 to %.loc14_46.5 [template = constants.%.31] -// CHECK:STDOUT: %.loc14_46.7: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_46.8: = bound_method %.loc14_45, %.loc14_46.7 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc14_46.2: init i32 = call %.loc14_46.8(%.loc14_45) [template = constants.%.33] -// CHECK:STDOUT: %.loc14_46.9: init i32 = converted %.loc14_45, %int.convert_checked.loc14_46.2 [template = constants.%.33] -// CHECK:STDOUT: %.loc14_46.10: ref i32 = struct_access %a.var, element1 -// CHECK:STDOUT: %.loc14_46.11: init i32 = initialize_from %.loc14_46.9 to %.loc14_46.10 [template = constants.%.33] -// CHECK:STDOUT: %.loc14_46.12: init %.1 = struct_init (%.loc14_46.6, %.loc14_46.11) to %a.var [template = constants.%struct] -// CHECK:STDOUT: %.loc14_47: init %.1 = converted %.loc14_46.1, %.loc14_46.12 [template = constants.%struct] +// CHECK:STDOUT: %.loc14_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_15: init type = call constants.%Int(%.loc14_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_15.2: type = value_of_initializer %int.make_type_signed.loc14_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_15.3: type = converted %int.make_type_signed.loc14_15, %.loc14_15.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_24: init type = call constants.%Int(%.loc14_24.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.2: type = value_of_initializer %int.make_type_signed.loc14_24 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.3: type = converted %int.make_type_signed.loc14_24, %.loc14_24.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_27: type = struct_type {.a: %i32, .b: %i32} [template = constants.%.2] +// CHECK:STDOUT: %a.var: ref %.2 = var a +// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var +// CHECK:STDOUT: %.loc14_37: Core.IntLiteral = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc14_45: Core.IntLiteral = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_46.1: %.6 = struct_literal (%.loc14_37, %.loc14_45) +// CHECK:STDOUT: %.loc14_46.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_46.3: = bound_method %.loc14_37, %.loc14_46.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc14_46.4: = specific_function %.loc14_46.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc14_46.1: init %i32 = call %.loc14_46.4(%.loc14_37) [template = constants.%.29] +// CHECK:STDOUT: %.loc14_46.5: init %i32 = converted %.loc14_37, %int.convert_checked.loc14_46.1 [template = constants.%.29] +// CHECK:STDOUT: %.loc14_46.6: ref %i32 = struct_access %a.var, element0 +// CHECK:STDOUT: %.loc14_46.7: init %i32 = initialize_from %.loc14_46.5 to %.loc14_46.6 [template = constants.%.29] +// CHECK:STDOUT: %.loc14_46.8: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_46.9: = bound_method %.loc14_45, %.loc14_46.8 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_46.10: = specific_function %.loc14_46.9, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc14_46.2: init %i32 = call %.loc14_46.10(%.loc14_45) [template = constants.%.32] +// CHECK:STDOUT: %.loc14_46.11: init %i32 = converted %.loc14_45, %int.convert_checked.loc14_46.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc14_46.12: ref %i32 = struct_access %a.var, element1 +// CHECK:STDOUT: %.loc14_46.13: init %i32 = initialize_from %.loc14_46.11 to %.loc14_46.12 [template = constants.%.32] +// CHECK:STDOUT: %.loc14_46.14: init %.2 = struct_init (%.loc14_46.7, %.loc14_46.13) to %a.var [template = constants.%struct] +// CHECK:STDOUT: %.loc14_47: init %.2 = converted %.loc14_46.1, %.loc14_46.14 [template = constants.%struct] // CHECK:STDOUT: assign %a.var, %.loc14_47 // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [template = constants.%G] // CHECK:STDOUT: %cond.ref: bool = name_ref cond, %cond // CHECK:STDOUT: if %cond.ref br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: -// CHECK:STDOUT: %a.ref.loc15_18: ref %.1 = name_ref a, %a -// CHECK:STDOUT: %.loc15_18.1: ref i32 = struct_access %a.ref.loc15_18, element0 -// CHECK:STDOUT: %.loc15_18.2: i32 = bind_value %.loc15_18.1 -// CHECK:STDOUT: %.loc15_18.3: ref i32 = struct_access %a.ref.loc15_18, element1 -// CHECK:STDOUT: %.loc15_18.4: i32 = bind_value %.loc15_18.3 -// CHECK:STDOUT: %struct.loc15_18: %.1 = struct_value (%.loc15_18.2, %.loc15_18.4) -// CHECK:STDOUT: %.loc15_18.5: %.1 = converted %a.ref.loc15_18, %struct.loc15_18 +// CHECK:STDOUT: %a.ref.loc15_18: ref %.2 = name_ref a, %a +// CHECK:STDOUT: %.loc15_18.1: ref %i32 = struct_access %a.ref.loc15_18, element0 +// CHECK:STDOUT: %.loc15_18.2: %i32 = bind_value %.loc15_18.1 +// CHECK:STDOUT: %.loc15_18.3: ref %i32 = struct_access %a.ref.loc15_18, element1 +// CHECK:STDOUT: %.loc15_18.4: %i32 = bind_value %.loc15_18.3 +// CHECK:STDOUT: %struct.loc15_18: %.2 = struct_value (%.loc15_18.2, %.loc15_18.4) +// CHECK:STDOUT: %.loc15_18.5: %.2 = converted %a.ref.loc15_18, %struct.loc15_18 // CHECK:STDOUT: br !if.expr.result(%.loc15_18.5) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %a.ref.loc15_25: ref %.1 = name_ref a, %a -// CHECK:STDOUT: %.loc15_25.1: ref i32 = struct_access %a.ref.loc15_25, element0 -// CHECK:STDOUT: %.loc15_25.2: i32 = bind_value %.loc15_25.1 -// CHECK:STDOUT: %.loc15_25.3: ref i32 = struct_access %a.ref.loc15_25, element1 -// CHECK:STDOUT: %.loc15_25.4: i32 = bind_value %.loc15_25.3 -// CHECK:STDOUT: %struct.loc15_25: %.1 = struct_value (%.loc15_25.2, %.loc15_25.4) -// CHECK:STDOUT: %.loc15_20: %.1 = converted %a.ref.loc15_25, %struct.loc15_25 +// CHECK:STDOUT: %a.ref.loc15_25: ref %.2 = name_ref a, %a +// CHECK:STDOUT: %.loc15_25.1: ref %i32 = struct_access %a.ref.loc15_25, element0 +// CHECK:STDOUT: %.loc15_25.2: %i32 = bind_value %.loc15_25.1 +// CHECK:STDOUT: %.loc15_25.3: ref %i32 = struct_access %a.ref.loc15_25, element1 +// CHECK:STDOUT: %.loc15_25.4: %i32 = bind_value %.loc15_25.3 +// CHECK:STDOUT: %struct.loc15_25: %.2 = struct_value (%.loc15_25.2, %.loc15_25.4) +// CHECK:STDOUT: %.loc15_20: %.2 = converted %a.ref.loc15_25, %struct.loc15_25 // CHECK:STDOUT: br !if.expr.result(%.loc15_20) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result: -// CHECK:STDOUT: %.loc15_5: %.1 = block_arg !if.expr.result +// CHECK:STDOUT: %.loc15_5: %.2 = block_arg !if.expr.result // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.ref(%.loc15_5) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/compound.carbon b/toolchain/check/testdata/impl/compound.carbon index 7893cd138107..b22c4d993265 100644 --- a/toolchain/check/testdata/impl/compound.carbon +++ b/toolchain/check/testdata/impl/compound.carbon @@ -48,18 +48,20 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %G.1: %G.type.1 = struct_value () [template] // CHECK:STDOUT: %.3: type = assoc_entity_type %Simple.type, %G.type.1 [template] // CHECK:STDOUT: %.4: %.3 = assoc_entity element1, @Simple.%G.decl [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.5 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %G.type.2: type = fn_type @G.2 [template] // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [template] -// CHECK:STDOUT: %.5: = interface_witness (%F.2, %G.2) [template] +// CHECK:STDOUT: %.6: = interface_witness (%F.2, %G.2) [template] // CHECK:STDOUT: %NonInstanceCall.type: type = fn_type @NonInstanceCall [template] // CHECK:STDOUT: %NonInstanceCall: %NonInstanceCall.type = struct_value () [template] // CHECK:STDOUT: %InstanceCall.type: type = fn_type @InstanceCall [template] // CHECK:STDOUT: %InstanceCall: %InstanceCall.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = ptr_type i32 [template] +// CHECK:STDOUT: %.7: type = ptr_type %i32 [template] // CHECK:STDOUT: %NonInstanceCallIndirect.type: type = fn_type @NonInstanceCallIndirect [template] // CHECK:STDOUT: %NonInstanceCallIndirect: %NonInstanceCallIndirect.type = struct_value () [template] // CHECK:STDOUT: %InstanceCallIndirect.type: type = fn_type @InstanceCallIndirect [template] @@ -68,7 +70,7 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -86,52 +88,57 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%Simple.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] {} { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_6.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_6.2: type = converted %int.make_type_32, %.loc16_6.1 [template = i32] +// CHECK:STDOUT: %.loc16_6.1: Core.IntLiteral = int_value 32 [template = constants.%.5] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc16_6.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_6.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc16_6.3: type = converted %int.make_type_signed, %.loc16_6.2 [template = constants.%i32] // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %NonInstanceCall.decl: %NonInstanceCall.type = fn_decl @NonInstanceCall [template = constants.%NonInstanceCall] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_23.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc21_23.2: type = converted %int.make_type_32, %.loc21_23.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %.loc21_23.1: Core.IntLiteral = int_value 32 [template = constants.%.5] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc21_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_23.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc21_23.3: type = converted %int.make_type_signed, %.loc21_23.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: %InstanceCall.decl: %InstanceCall.type = fn_decl @InstanceCall [template = constants.%InstanceCall] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc25_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc25_20.2: type = converted %int.make_type_32, %.loc25_20.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %.loc25_20.1: Core.IntLiteral = int_value 32 [template = constants.%.5] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc25_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc25_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc25_20.3: type = converted %int.make_type_signed, %.loc25_20.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: %NonInstanceCallIndirect.decl: %NonInstanceCallIndirect.type = fn_decl @NonInstanceCallIndirect [template = constants.%NonInstanceCallIndirect] { -// CHECK:STDOUT: %p.patt: %.6 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.6 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %p.patt: %.7 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.7 = value_param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc29_34.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc29_34.2: type = converted %int.make_type_32, %.loc29_34.1 [template = i32] -// CHECK:STDOUT: %.loc29_34.3: type = ptr_type i32 [template = constants.%.6] -// CHECK:STDOUT: %p.param: %.6 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.6 = bind_name p, %p.param +// CHECK:STDOUT: %.loc29_31: Core.IntLiteral = int_value 32 [template = constants.%.5] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc29_31) [template = constants.%i32] +// CHECK:STDOUT: %.loc29_34.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc29_34.2: type = converted %int.make_type_signed, %.loc29_34.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc29_34.3: type = ptr_type %i32 [template = constants.%.7] +// CHECK:STDOUT: %p.param: %.7 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.7 = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: %InstanceCallIndirect.decl: %InstanceCallIndirect.type = fn_decl @InstanceCallIndirect [template = constants.%InstanceCallIndirect] { -// CHECK:STDOUT: %p.patt: %.6 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.6 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %p.patt: %.7 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.7 = value_param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc33_31.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc33_31.2: type = converted %int.make_type_32, %.loc33_31.1 [template = i32] -// CHECK:STDOUT: %.loc33_31.3: type = ptr_type i32 [template = constants.%.6] -// CHECK:STDOUT: %p.param: %.6 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.6 = bind_name p, %p.param +// CHECK:STDOUT: %.loc33_28: Core.IntLiteral = int_value 32 [template = constants.%.5] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc33_28) [template = constants.%i32] +// CHECK:STDOUT: %.loc33_31.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc33_31.2: type = converted %int.make_type_signed, %.loc33_31.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc33_31.3: type = ptr_type %i32 [template = constants.%.7] +// CHECK:STDOUT: %p.param: %.7 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.7 = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -158,19 +165,20 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: witness = (%F.decl, %G.decl) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc16_6.2 as %Simple.ref { +// CHECK:STDOUT: impl @impl: %.loc16_6.3 as %Simple.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} // CHECK:STDOUT: %G.decl: %G.type.2 = fn_decl @G.2 [template = constants.%G.2] { -// CHECK:STDOUT: %self.patt: i32 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: i32 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %self.patt: %i32 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %i32 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_14.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc18_14.2: type = converted %int.make_type_32, %.loc18_14.1 [template = i32] -// CHECK:STDOUT: %self.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %self: i32 = bind_name self, %self.param +// CHECK:STDOUT: %.loc18_14.1: Core.IntLiteral = int_value 32 [template = constants.%.5] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc18_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_14.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc18_14.3: type = converted %int.make_type_signed, %.loc18_14.2 [template = constants.%i32] +// CHECK:STDOUT: %self.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %self: %i32 = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc16_20: = interface_witness (%F.decl, %G.decl) [template = constants.%.5] +// CHECK:STDOUT: %.loc16_20: = interface_witness (%F.decl, %G.decl) [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl @@ -191,49 +199,49 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G.2[%self.param_patt: i32](); +// CHECK:STDOUT: fn @G.2[%self.param_patt: %i32](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @NonInstanceCall(%n.param_patt: i32) { +// CHECK:STDOUT: fn @NonInstanceCall(%n.param_patt: %i32) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n +// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: %F.ref: %.1 = name_ref F, @Simple.%.loc12 [template = constants.%.2] -// CHECK:STDOUT: %.loc22: %F.type.1 = interface_witness_access constants.%.5, element0 [template = constants.%F.2] +// CHECK:STDOUT: %.loc22: %F.type.1 = interface_witness_access constants.%.6, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %.loc22() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @InstanceCall(%n.param_patt: i32) { +// CHECK:STDOUT: fn @InstanceCall(%n.param_patt: %i32) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n +// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: %G.ref: %.3 = name_ref G, @Simple.%.loc13 [template = constants.%.4] -// CHECK:STDOUT: %.loc26_4.1: %G.type.1 = interface_witness_access constants.%.5, element1 [template = constants.%G.2] +// CHECK:STDOUT: %.loc26_4.1: %G.type.1 = interface_witness_access constants.%.6, element1 [template = constants.%G.2] // CHECK:STDOUT: %.loc26_4.2: = bound_method %n.ref, %.loc26_4.1 // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %.loc26_4.2(%n.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @NonInstanceCallIndirect(%p.param_patt: %.6) { +// CHECK:STDOUT: fn @NonInstanceCallIndirect(%p.param_patt: %.7) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.6 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.7 = name_ref p, %p // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: %F.ref: %.1 = name_ref F, @Simple.%.loc12 [template = constants.%.2] -// CHECK:STDOUT: %.loc30_4.1: ref i32 = deref %p.ref -// CHECK:STDOUT: %.loc30_4.2: %F.type.1 = interface_witness_access constants.%.5, element0 [template = constants.%F.2] +// CHECK:STDOUT: %.loc30_4.1: ref %i32 = deref %p.ref +// CHECK:STDOUT: %.loc30_4.2: %F.type.1 = interface_witness_access constants.%.6, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %.loc30_4.2() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @InstanceCallIndirect(%p.param_patt: %.6) { +// CHECK:STDOUT: fn @InstanceCallIndirect(%p.param_patt: %.7) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.6 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.7 = name_ref p, %p // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: %G.ref: %.3 = name_ref G, @Simple.%.loc13 [template = constants.%.4] -// CHECK:STDOUT: %.loc34_4.1: ref i32 = deref %p.ref -// CHECK:STDOUT: %.loc34_4.2: %G.type.1 = interface_witness_access constants.%.5, element1 [template = constants.%G.2] +// CHECK:STDOUT: %.loc34_4.1: ref %i32 = deref %p.ref +// CHECK:STDOUT: %.loc34_4.2: %G.type.1 = interface_witness_access constants.%.6, element1 [template = constants.%G.2] // CHECK:STDOUT: %.loc34_4.3: = bound_method %.loc34_4.1, %.loc34_4.2 -// CHECK:STDOUT: %.loc34_4.4: i32 = bind_value %.loc34_4.1 +// CHECK:STDOUT: %.loc34_4.4: %i32 = bind_value %.loc34_4.1 // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %.loc34_4.3(%.loc34_4.4) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -244,9 +252,9 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.1(i32) {} +// CHECK:STDOUT: specific @F.1(constants.%i32) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @G.1(i32) { -// CHECK:STDOUT: %Self => i32 +// CHECK:STDOUT: specific @G.1(constants.%i32) { +// CHECK:STDOUT: %Self => constants.%i32 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/declaration.carbon b/toolchain/check/testdata/impl/declaration.carbon index dbba70cb1e57..9f145ed6517a 100644 --- a/toolchain/check/testdata/impl/declaration.carbon +++ b/toolchain/check/testdata/impl/declaration.carbon @@ -17,13 +17,15 @@ impl i32 as I; // CHECK:STDOUT: constants { // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -37,9 +39,10 @@ impl i32 as I; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] {} { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_6.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_6.2: type = converted %int.make_type_32, %.loc13_6.1 [template = i32] +// CHECK:STDOUT: %.loc13_6.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_6.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_6.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_6.3: type = converted %int.make_type_signed, %.loc13_6.2 [template = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -52,5 +55,5 @@ impl i32 as I; // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc13_6.2 as %I.ref; +// CHECK:STDOUT: impl @impl: %.loc13_6.3 as %I.ref; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/empty.carbon b/toolchain/check/testdata/impl/empty.carbon index 9195135284db..9a073a44a6cc 100644 --- a/toolchain/check/testdata/impl/empty.carbon +++ b/toolchain/check/testdata/impl/empty.carbon @@ -19,14 +19,16 @@ impl i32 as Empty { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Empty.type: type = facet_type <@Empty> [template] // CHECK:STDOUT: %Self: %Empty.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: = interface_witness () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -40,9 +42,10 @@ impl i32 as Empty { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%Empty.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] {} { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_6.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_6.2: type = converted %int.make_type_32, %.loc14_6.1 [template = i32] +// CHECK:STDOUT: %.loc14_6.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_6.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_6.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_6.3: type = converted %int.make_type_signed, %.loc14_6.2 [template = constants.%i32] // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [template = constants.%Empty.type] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -55,8 +58,8 @@ impl i32 as Empty { // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc14_6.2 as %Empty.ref { -// CHECK:STDOUT: %.loc14_19: = interface_witness () [template = constants.%.1] +// CHECK:STDOUT: impl @impl: %.loc14_6.3 as %Empty.ref { +// CHECK:STDOUT: %.loc14_19: = interface_witness () [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = %.loc14_19 diff --git a/toolchain/check/testdata/impl/extend_impl_generic.carbon b/toolchain/check/testdata/impl/extend_impl_generic.carbon index 4a191258cab4..1681cb9be916 100644 --- a/toolchain/check/testdata/impl/extend_impl_generic.carbon +++ b/toolchain/check/testdata/impl/extend_impl_generic.carbon @@ -61,38 +61,41 @@ class X(U:! type) { // CHECK:STDOUT: %.1: type = assoc_entity_type %HasF.type.2, %F.type.1 [symbolic] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, @HasF.%F.decl [symbolic] // CHECK:STDOUT: %Param: type = class_type @Param [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = unbound_element_type %Param, i32 [template] -// CHECK:STDOUT: %.4: type = struct_type {.x: i32} [template] -// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.3 [template] +// CHECK:STDOUT: %.4: type = unbound_element_type %Param, %i32 [template] +// CHECK:STDOUT: %.5: type = struct_type {.x: %i32} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %HasF.type.3: type = facet_type <@HasF, @HasF(%Param)> [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.1, @HasF(%Param) [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.6: type = assoc_entity_type %HasF.type.3, %F.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, @HasF.%F.decl [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %HasF.type.3, %F.type.2 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, @HasF.%F.decl [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %.8: = interface_witness (%F.3) [template] -// CHECK:STDOUT: %.9: type = struct_type {} [template] -// CHECK:STDOUT: %.10: = complete_type_witness %.9 [template] -// CHECK:STDOUT: %.12: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.13: type = struct_type {.x: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.37: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.38: = bound_method %.12, %Convert.15 [template] -// CHECK:STDOUT: %.39: i32 = int_value 2 [template] -// CHECK:STDOUT: %struct: %Param = struct_value (%.39) [template] +// CHECK:STDOUT: %.9: = interface_witness (%F.3) [template] +// CHECK:STDOUT: %.10: type = struct_type {} [template] +// CHECK:STDOUT: %.11: = complete_type_witness %.10 [template] +// CHECK:STDOUT: %.13: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.14: type = struct_type {.x: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.2(%.3) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.34: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.35: = bound_method %.13, %Convert.14 [template] +// CHECK:STDOUT: %.36: = specific_function %.35, @Convert.2(%.3) [template] +// CHECK:STDOUT: %.37: %i32 = int_value 2 [template] +// CHECK:STDOUT: %struct: %Param = struct_value (%.37) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -167,7 +170,7 @@ class X(U:! type) { // CHECK:STDOUT: %return.param: ref %Param = out_param runtime_param0 // CHECK:STDOUT: %return: ref %Param = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13: = interface_witness (%F.decl) [template = constants.%.8] +// CHECK:STDOUT: %.loc13: = interface_witness (%F.decl) [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl @@ -175,11 +178,12 @@ class X(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Param { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc9_10.2: type = converted %int.make_type_32, %.loc9_10.1 [template = i32] -// CHECK:STDOUT: %.loc9_8: %.3 = field_decl x, element0 [template] -// CHECK:STDOUT: %.loc10: = complete_type_witness %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_10.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc9_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc9_10.3: type = converted %int.make_type_signed, %.loc9_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_8: %.4 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc10: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Param @@ -193,7 +197,7 @@ class X(U:! type) { // CHECK:STDOUT: %Param.ref: type = name_ref Param, file.%Param.decl [template = constants.%Param] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(constants.%Param)> [template = constants.%HasF.type.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc18: = complete_type_witness %.9 [template = constants.%.10] +// CHECK:STDOUT: %.loc18: = complete_type_witness %.10 [template = constants.%.11] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -208,50 +212,53 @@ class X(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2() -> %return: %Param { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15_20: Core.IntLiteral = int_value 2 [template = constants.%.12] -// CHECK:STDOUT: %.loc15_21.1: %.13 = struct_literal (%.loc15_20) -// CHECK:STDOUT: %.loc15_21.2: %Convert.type.2 = interface_witness_access constants.%.37, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_21.3: = bound_method %.loc15_20, %.loc15_21.2 [template = constants.%.38] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc15_21.3(%.loc15_20) [template = constants.%.39] -// CHECK:STDOUT: %.loc15_21.4: init i32 = converted %.loc15_20, %int.convert_checked [template = constants.%.39] -// CHECK:STDOUT: %.loc15_21.5: ref i32 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc15_21.6: init i32 = initialize_from %.loc15_21.4 to %.loc15_21.5 [template = constants.%.39] -// CHECK:STDOUT: %.loc15_21.7: init %Param = class_init (%.loc15_21.6), %return [template = constants.%struct] -// CHECK:STDOUT: %.loc15_22: init %Param = converted %.loc15_21.1, %.loc15_21.7 [template = constants.%struct] +// CHECK:STDOUT: %.loc15_20: Core.IntLiteral = int_value 2 [template = constants.%.13] +// CHECK:STDOUT: %.loc15_21.1: %.14 = struct_literal (%.loc15_20) +// CHECK:STDOUT: %.loc15_21.2: %Convert.type.2 = interface_witness_access constants.%.34, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_21.3: = bound_method %.loc15_20, %.loc15_21.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc15_21.4: = specific_function %.loc15_21.3, @Convert.2(constants.%.3) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc15_21.4(%.loc15_20) [template = constants.%.37] +// CHECK:STDOUT: %.loc15_21.5: init %i32 = converted %.loc15_20, %int.convert_checked [template = constants.%.37] +// CHECK:STDOUT: %.loc15_21.6: ref %i32 = class_element_access %return, element0 +// CHECK:STDOUT: %.loc15_21.7: init %i32 = initialize_from %.loc15_21.5 to %.loc15_21.6 [template = constants.%.37] +// CHECK:STDOUT: %.loc15_21.8: init %Param = class_init (%.loc15_21.7), %return [template = constants.%struct] +// CHECK:STDOUT: %.loc15_22: init %Param = converted %.loc15_21.1, %.loc15_21.8 [template = constants.%struct] // CHECK:STDOUT: return %.loc15_22 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%c.param_patt: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_10.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] -// CHECK:STDOUT: %.loc21_10.2: type = converted %int.make_type_32.loc21, %.loc21_10.1 [template = i32] +// CHECK:STDOUT: %.loc21_10.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%.loc21_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_10.2: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_10.3: type = converted %int.make_type_signed.loc21, %.loc21_10.2 [template = constants.%i32] // CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc21_17.1: %.6 = specific_constant @HasF.%.loc5_14.1, @HasF(constants.%Param) [template = constants.%.7] -// CHECK:STDOUT: %F.ref.loc21: %.6 = name_ref F, %.loc21_17.1 [template = constants.%.7] -// CHECK:STDOUT: %.loc21_17.2: %F.type.2 = interface_witness_access constants.%.8, element0 [template = constants.%F.3] +// CHECK:STDOUT: %.loc21_17.1: %.7 = specific_constant @HasF.%.loc5_14.1, @HasF(constants.%Param) [template = constants.%.8] +// CHECK:STDOUT: %F.ref.loc21: %.7 = name_ref F, %.loc21_17.1 [template = constants.%.8] +// CHECK:STDOUT: %.loc21_17.2: %F.type.2 = interface_witness_access constants.%.9, element0 [template = constants.%F.3] // CHECK:STDOUT: %.loc21_19.1: ref %Param = temporary_storage // CHECK:STDOUT: %F.call.loc21: init %Param = call %.loc21_17.2() to %.loc21_19.1 // CHECK:STDOUT: %.loc21_19.2: ref %Param = temporary %.loc21_19.1, %F.call.loc21 -// CHECK:STDOUT: %x.ref.loc21: %.3 = name_ref x, @Param.%.loc9_8 [template = @Param.%.loc9_8] -// CHECK:STDOUT: %.loc21_21.1: ref i32 = class_element_access %.loc21_19.2, element0 -// CHECK:STDOUT: %.loc21_21.2: i32 = bind_value %.loc21_21.1 -// CHECK:STDOUT: %a: i32 = bind_name a, %.loc21_21.2 -// CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_10.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] -// CHECK:STDOUT: %.loc22_10.2: type = converted %int.make_type_32.loc22, %.loc22_10.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %x.ref.loc21: %.4 = name_ref x, @Param.%.loc9_8 [template = @Param.%.loc9_8] +// CHECK:STDOUT: %.loc21_21.1: ref %i32 = class_element_access %.loc21_19.2, element0 +// CHECK:STDOUT: %.loc21_21.2: %i32 = bind_value %.loc21_21.1 +// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc21_21.2 +// CHECK:STDOUT: %.loc22_10.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%.loc22_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc22_10.2: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] +// CHECK:STDOUT: %.loc22_10.3: type = converted %int.make_type_signed.loc22, %.loc22_10.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %c.ref: %C = name_ref c, %c -// CHECK:STDOUT: %.loc22_17.1: %.6 = specific_constant @HasF.%.loc5_14.1, @HasF(constants.%Param) [template = constants.%.7] -// CHECK:STDOUT: %F.ref.loc22: %.6 = name_ref F, %.loc22_17.1 [template = constants.%.7] -// CHECK:STDOUT: %.loc22_17.2: %F.type.2 = interface_witness_access constants.%.8, element0 [template = constants.%F.3] +// CHECK:STDOUT: %.loc22_17.1: %.7 = specific_constant @HasF.%.loc5_14.1, @HasF(constants.%Param) [template = constants.%.8] +// CHECK:STDOUT: %F.ref.loc22: %.7 = name_ref F, %.loc22_17.1 [template = constants.%.8] +// CHECK:STDOUT: %.loc22_17.2: %F.type.2 = interface_witness_access constants.%.9, element0 [template = constants.%F.3] // CHECK:STDOUT: %.loc22_19.1: ref %Param = temporary_storage // CHECK:STDOUT: %F.call.loc22: init %Param = call %.loc22_17.2() to %.loc22_19.1 // CHECK:STDOUT: %.loc22_19.2: ref %Param = temporary %.loc22_19.1, %F.call.loc22 -// CHECK:STDOUT: %x.ref.loc22: %.3 = name_ref x, @Param.%.loc9_8 [template = @Param.%.loc9_8] -// CHECK:STDOUT: %.loc22_21.1: ref i32 = class_element_access %.loc22_19.2, element0 -// CHECK:STDOUT: %.loc22_21.2: i32 = bind_value %.loc22_21.1 +// CHECK:STDOUT: %x.ref.loc22: %.4 = name_ref x, @Param.%.loc9_8 [template = @Param.%.loc9_8] +// CHECK:STDOUT: %.loc22_21.1: ref %i32 = class_element_access %.loc22_19.2, element0 +// CHECK:STDOUT: %.loc22_21.2: %i32 = bind_value %.loc22_21.1 // CHECK:STDOUT: assign %b.var, %.loc22_21.2 // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -279,8 +286,8 @@ class X(U:! type) { // CHECK:STDOUT: %Self.2 => constants.%Self.1 // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 -// CHECK:STDOUT: %.loc5_14.2 => constants.%.6 -// CHECK:STDOUT: %.loc5_14.3 => constants.%.7 +// CHECK:STDOUT: %.loc5_14.2 => constants.%.7 +// CHECK:STDOUT: %.loc5_14.3 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Param, constants.%C) { diff --git a/toolchain/check/testdata/impl/fail_call_invalid.carbon b/toolchain/check/testdata/impl/fail_call_invalid.carbon index ee5845c7908d..31744c1c4fc6 100644 --- a/toolchain/check/testdata/impl/fail_call_invalid.carbon +++ b/toolchain/check/testdata/impl/fail_call_invalid.carbon @@ -32,8 +32,10 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %G.1: %G.type.1 = struct_value () [template] // CHECK:STDOUT: %.1: type = assoc_entity_type %Simple.type, %G.type.1 [template] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, @Simple.%G.decl [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.3 [template] // CHECK:STDOUT: %G.type.2: type = fn_type @G.2 [template] // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [template] // CHECK:STDOUT: %InstanceCall.type: type = fn_type @InstanceCall [template] @@ -42,7 +44,7 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -57,20 +59,22 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%Simple.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] {} { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32, %.loc15_6.1 [template = i32] +// CHECK:STDOUT: %.loc15_6.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_6.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_6.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_6.3: type = converted %int.make_type_signed, %.loc15_6.2 [template = constants.%i32] // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %InstanceCall.decl: %InstanceCall.type = fn_decl @InstanceCall [template = constants.%InstanceCall] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc22_20.2: type = converted %int.make_type_32, %.loc22_20.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %.loc22_20.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc22_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc22_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc22_20.3: type = converted %int.make_type_signed, %.loc22_20.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -94,7 +98,7 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: witness = (%G.decl) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc15_6.2 as %Simple.ref { +// CHECK:STDOUT: impl @impl: %.loc15_6.3 as %Simple.ref { // CHECK:STDOUT: %G.decl: %G.type.2 = fn_decl @G.2 [template = constants.%G.2] { // CHECK:STDOUT: %self.patt: = binding_pattern self // CHECK:STDOUT: %self.param_patt: = value_param_pattern %self.patt, runtime_param0 @@ -118,9 +122,9 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: // CHECK:STDOUT: fn @G.2[%self.param_patt: ](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @InstanceCall(%n.param_patt: i32) { +// CHECK:STDOUT: fn @InstanceCall(%n.param_patt: %i32) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n +// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: %G.ref: %.1 = name_ref G, @Simple.%.loc12 [template = constants.%.2] // CHECK:STDOUT: %.loc23_4.1: %G.type.1 = interface_witness_access , element0 [template = ] @@ -132,7 +136,7 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @G.1(i32) { -// CHECK:STDOUT: %Self => i32 +// CHECK:STDOUT: specific @G.1(constants.%i32) { +// CHECK:STDOUT: %Self => constants.%i32 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon index 6d1b846a3bdd..81f18d2365f4 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon @@ -20,14 +20,16 @@ extend impl i32 as I {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: = interface_witness () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -41,9 +43,10 @@ extend impl i32 as I {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] {} { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_32, %.loc16_13.1 [template = i32] +// CHECK:STDOUT: %.loc16_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc16_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc16_13.3: type = converted %int.make_type_signed, %.loc16_13.2 [template = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -56,8 +59,8 @@ extend impl i32 as I {} // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc16_13.2 as %I.ref { -// CHECK:STDOUT: %.loc16_22: = interface_witness () [template = constants.%.1] +// CHECK:STDOUT: impl @impl: %.loc16_13.3 as %I.ref { +// CHECK:STDOUT: %.loc16_22: = interface_witness () [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = %.loc16_22 diff --git a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon index e5e656280098..8119ac7b5b85 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon @@ -45,18 +45,20 @@ class E { // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: = interface_witness () [template] -// CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: = interface_witness () [template] +// CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %E: type = class_type @E [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -85,8 +87,8 @@ class E { // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %.loc18_15.2 as %I.ref { -// CHECK:STDOUT: %.loc18_24: = interface_witness () [template = constants.%.1] +// CHECK:STDOUT: impl @impl.1: %.loc18_15.3 as %I.ref { +// CHECK:STDOUT: %.loc18_24: = interface_witness () [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = %.loc18_24 @@ -95,7 +97,7 @@ class E { // CHECK:STDOUT: impl @impl.2: %D.ref as %I.ref; // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.3: %Self.ref as %I.ref { -// CHECK:STDOUT: %.loc39: = interface_witness () [template = constants.%.1] +// CHECK:STDOUT: %.loc39: = interface_witness () [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = %.loc39 @@ -103,12 +105,13 @@ class E { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: impl_decl @impl.1 [template] {} { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_15.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc18_15.2: type = converted %int.make_type_32, %.loc18_15.1 [template = i32] +// CHECK:STDOUT: %.loc18_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc18_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_15.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc18_15.3: type = converted %int.make_type_signed, %.loc18_15.2 [template = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc19: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -120,7 +123,7 @@ class E { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc30: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc30: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D @@ -132,7 +135,7 @@ class E { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [template = constants.%E] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc40: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc40: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%E diff --git a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon index eb16feac06e3..ce074594007f 100644 --- a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon @@ -19,15 +19,17 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -45,13 +47,14 @@ class C { // CHECK:STDOUT: impl @impl: %Self.ref as @C.%.loc15_18.2; // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc15_18.1: type = value_of_initializer @impl.%int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_18.2: type = converted @impl.%int.make_type_32, %.loc15_18.1 [template = i32] +// CHECK:STDOUT: %.loc15_18.1: type = value_of_initializer @impl.%int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_18.2: type = converted @impl.%int.make_type_signed, %.loc15_18.1 [template = constants.%i32] // CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc15: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc16: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc16: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon index 614e68fa533f..e9e098ecb65d 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -271,39 +271,41 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %SelfNested.type: type = facet_type <@SelfNested> [template] // CHECK:STDOUT: %Self.3: %SelfNested.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %.7: type = ptr_type %Self.3 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.8: type = struct_type {.x: %Self.3, .y: i32} [symbolic] +// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.8 [template] +// CHECK:STDOUT: %.9: type = struct_type {.x: %Self.3, .y: %i32} [symbolic] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%.7, %.8) [symbolic] -// CHECK:STDOUT: %.9: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %.10: type = array_type %.9, %Self.3 [symbolic] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%.7, %.9) [symbolic] +// CHECK:STDOUT: %.10: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.11: type = array_type %.10, %Self.3 [symbolic] // CHECK:STDOUT: %F.type.13: type = fn_type @F.13 [template] // CHECK:STDOUT: %F.14: %F.type.13 = struct_value () [template] -// CHECK:STDOUT: %.11: type = assoc_entity_type %SelfNested.type, %F.type.13 [template] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, @SelfNested.%F.decl [template] +// CHECK:STDOUT: %.12: type = assoc_entity_type %SelfNested.type, %F.type.13 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, @SelfNested.%F.decl [template] // CHECK:STDOUT: %SelfNestedBadParam: type = class_type @SelfNestedBadParam [template] -// CHECK:STDOUT: %.13: type = ptr_type %SelfNestedBadParam [template] -// CHECK:STDOUT: %.14: type = struct_type {.x: i32, .y: i32} [template] -// CHECK:STDOUT: %tuple.type.3: type = tuple_type (%.13, %.14) [template] -// CHECK:STDOUT: %.15: type = array_type %.9, %SelfNestedBadParam [template] +// CHECK:STDOUT: %.14: type = ptr_type %SelfNestedBadParam [template] +// CHECK:STDOUT: %.15: type = struct_type {.x: %i32, .y: %i32} [template] +// CHECK:STDOUT: %tuple.type.3: type = tuple_type (%.14, %.15) [template] +// CHECK:STDOUT: %.16: type = array_type %.10, %SelfNestedBadParam [template] // CHECK:STDOUT: %F.type.14: type = fn_type @F.14 [template] // CHECK:STDOUT: %F.15: %F.type.14 = struct_value () [template] -// CHECK:STDOUT: %.16: type = struct_type {.x: %SelfNestedBadParam, .y: i32} [template] -// CHECK:STDOUT: %tuple.type.4: type = tuple_type (%.13, %.16) [template] +// CHECK:STDOUT: %.17: type = struct_type {.x: %SelfNestedBadParam, .y: %i32} [template] +// CHECK:STDOUT: %tuple.type.4: type = tuple_type (%.14, %.17) [template] // CHECK:STDOUT: %SelfNestedBadReturnType: type = class_type @SelfNestedBadReturnType [template] -// CHECK:STDOUT: %.17: type = ptr_type %SelfNestedBadReturnType [template] -// CHECK:STDOUT: %.18: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template] -// CHECK:STDOUT: %tuple.type.5: type = tuple_type (%.17, %.18) [template] +// CHECK:STDOUT: %.18: type = ptr_type %SelfNestedBadReturnType [template] +// CHECK:STDOUT: %.19: type = struct_type {.x: %SelfNestedBadReturnType, .y: %i32} [template] +// CHECK:STDOUT: %tuple.type.5: type = tuple_type (%.18, %.19) [template] // CHECK:STDOUT: %F.type.15: type = fn_type @F.15 [template] // CHECK:STDOUT: %F.16: %F.type.15 = struct_value () [template] -// CHECK:STDOUT: %.19: type = array_type %.9, %SelfNestedBadReturnType [template] +// CHECK:STDOUT: %.20: type = array_type %.10, %SelfNestedBadReturnType [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.1 -// CHECK:STDOUT: .Int32 = %import_ref.2 +// CHECK:STDOUT: .Int = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -404,8 +406,8 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %F.decl: %F.type.13 = fn_decl @F.13 [template = constants.%F.14] { // CHECK:STDOUT: %x.patt: @F.13.%tuple.type (%tuple.type.2) = binding_pattern x // CHECK:STDOUT: %x.param_patt: @F.13.%tuple.type (%tuple.type.2) = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: @F.13.%.loc188_52.1 (%.10) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @F.13.%.loc188_52.1 (%.10) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: @F.13.%.loc188_52.1 (%.11) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @F.13.%.loc188_52.1 (%.11) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc188_12: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_16.2: type = facet_type_access %Self.ref.loc188_12 [symbolic = %Self (constants.%Self.3)] @@ -414,23 +416,24 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref.loc188_24: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_24.1: type = facet_type_access %Self.ref.loc188_24 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_24.2: type = converted %Self.ref.loc188_24, %.loc188_24.1 [symbolic = %Self (constants.%Self.3)] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc188_34.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc188_34.2: type = converted %int.make_type_32, %.loc188_34.1 [template = i32] -// CHECK:STDOUT: %.loc188_37.2: type = struct_type {.x: %Self.3, .y: i32} [symbolic = %.loc188_37.1 (constants.%.8)] +// CHECK:STDOUT: %.loc188_34.1: Core.IntLiteral = int_value 32 [template = constants.%.8] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc188_34.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc188_34.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc188_34.3: type = converted %int.make_type_signed, %.loc188_34.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc188_37.2: type = struct_type {.x: %Self.3, .y: %i32} [symbolic = %.loc188_37.1 (constants.%.9)] // CHECK:STDOUT: %.loc188_38.1: %tuple.type.1 = tuple_literal (%.loc188_16.4, %.loc188_37.2) // CHECK:STDOUT: %.loc188_38.2: type = converted %.loc188_38.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: %Self.ref.loc188_45: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)] -// CHECK:STDOUT: %.loc188_51: Core.IntLiteral = int_value 4 [template = constants.%.9] +// CHECK:STDOUT: %.loc188_51: Core.IntLiteral = int_value 4 [template = constants.%.10] // CHECK:STDOUT: %.loc188_45.1: type = facet_type_access %Self.ref.loc188_45 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_45.2: type = converted %Self.ref.loc188_45, %.loc188_45.1 [symbolic = %Self (constants.%Self.3)] -// CHECK:STDOUT: %.loc188_52.2: type = array_type %.loc188_51, %Self.3 [symbolic = %.loc188_52.1 (constants.%.10)] +// CHECK:STDOUT: %.loc188_52.2: type = array_type %.loc188_51, %Self.3 [symbolic = %.loc188_52.1 (constants.%.11)] // CHECK:STDOUT: %x.param: @F.13.%tuple.type (%tuple.type.2) = value_param runtime_param0 // CHECK:STDOUT: %x: @F.13.%tuple.type (%tuple.type.2) = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref @F.13.%.loc188_52.1 (%.10) = out_param runtime_param1 -// CHECK:STDOUT: %return: ref @F.13.%.loc188_52.1 (%.10) = return_slot %return.param +// CHECK:STDOUT: %return.param: ref @F.13.%.loc188_52.1 (%.11) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @F.13.%.loc188_52.1 (%.11) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc188: %.11 = assoc_entity element0, %F.decl [template = constants.%.12] +// CHECK:STDOUT: %.loc188: %.12 = assoc_entity element0, %F.decl [template = constants.%.13] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self @@ -717,27 +720,29 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %F.decl: %F.type.14 = fn_decl @F.14 [template = constants.%F.15] { // CHECK:STDOUT: %x.patt: %tuple.type.3 = binding_pattern x // CHECK:STDOUT: %x.param_patt: %tuple.type.3 = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.15 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.15 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %.16 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_14: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam] -// CHECK:STDOUT: %.loc200_32: type = ptr_type %SelfNestedBadParam [template = constants.%.13] -// CHECK:STDOUT: %int.make_type_32.loc200_40: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc200_40.1: type = value_of_initializer %int.make_type_32.loc200_40 [template = i32] -// CHECK:STDOUT: %.loc200_40.2: type = converted %int.make_type_32.loc200_40, %.loc200_40.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc200_49: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc200_49.1: type = value_of_initializer %int.make_type_32.loc200_49 [template = i32] -// CHECK:STDOUT: %.loc200_49.2: type = converted %int.make_type_32.loc200_49, %.loc200_49.1 [template = i32] -// CHECK:STDOUT: %.loc200_52: type = struct_type {.x: i32, .y: i32} [template = constants.%.14] +// CHECK:STDOUT: %.loc200_32: type = ptr_type %SelfNestedBadParam [template = constants.%.14] +// CHECK:STDOUT: %.loc200_40.1: Core.IntLiteral = int_value 32 [template = constants.%.8] +// CHECK:STDOUT: %int.make_type_signed.loc200_40: init type = call constants.%Int(%.loc200_40.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc200_40.2: type = value_of_initializer %int.make_type_signed.loc200_40 [template = constants.%i32] +// CHECK:STDOUT: %.loc200_40.3: type = converted %int.make_type_signed.loc200_40, %.loc200_40.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc200_49.1: Core.IntLiteral = int_value 32 [template = constants.%.8] +// CHECK:STDOUT: %int.make_type_signed.loc200_49: init type = call constants.%Int(%.loc200_49.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc200_49.2: type = value_of_initializer %int.make_type_signed.loc200_49 [template = constants.%i32] +// CHECK:STDOUT: %.loc200_49.3: type = converted %int.make_type_signed.loc200_49, %.loc200_49.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc200_52: type = struct_type {.x: %i32, .y: %i32} [template = constants.%.15] // CHECK:STDOUT: %.loc200_53.1: %tuple.type.1 = tuple_literal (%.loc200_32, %.loc200_52) // CHECK:STDOUT: %.loc200_53.2: type = converted %.loc200_53.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_60: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam] -// CHECK:STDOUT: %.loc200_80: Core.IntLiteral = int_value 4 [template = constants.%.9] -// CHECK:STDOUT: %.loc200_81: type = array_type %.loc200_80, %SelfNestedBadParam [template = constants.%.15] +// CHECK:STDOUT: %.loc200_80: Core.IntLiteral = int_value 4 [template = constants.%.10] +// CHECK:STDOUT: %.loc200_81: type = array_type %.loc200_80, %SelfNestedBadParam [template = constants.%.16] // CHECK:STDOUT: %x.param: %tuple.type.3 = value_param runtime_param0 // CHECK:STDOUT: %x: %tuple.type.3 = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref %.15 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.15 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %.16 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.16 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc192: = interface_witness () [template = ] // CHECK:STDOUT: @@ -750,25 +755,26 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %F.decl: %F.type.15 = fn_decl @F.15 [template = constants.%F.16] { // CHECK:STDOUT: %x.patt: %tuple.type.5 = binding_pattern x // CHECK:STDOUT: %x.param_patt: %tuple.type.5 = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.15 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.15 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %.16 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_14: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType] -// CHECK:STDOUT: %.loc212_37: type = ptr_type %SelfNestedBadReturnType [template = constants.%.17] +// CHECK:STDOUT: %.loc212_37: type = ptr_type %SelfNestedBadReturnType [template = constants.%.18] // CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_45: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc212_74.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc212_74.2: type = converted %int.make_type_32, %.loc212_74.1 [template = i32] -// CHECK:STDOUT: %.loc212_77: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template = constants.%.18] +// CHECK:STDOUT: %.loc212_74.1: Core.IntLiteral = int_value 32 [template = constants.%.8] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc212_74.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc212_74.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc212_74.3: type = converted %int.make_type_signed, %.loc212_74.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc212_77: type = struct_type {.x: %SelfNestedBadReturnType, .y: %i32} [template = constants.%.19] // CHECK:STDOUT: %.loc212_78.1: %tuple.type.1 = tuple_literal (%.loc212_37, %.loc212_77) // CHECK:STDOUT: %.loc212_78.2: type = converted %.loc212_78.1, constants.%tuple.type.5 [template = constants.%tuple.type.5] // CHECK:STDOUT: %SelfNestedBadParam.ref: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam] -// CHECK:STDOUT: %.loc212_105: Core.IntLiteral = int_value 4 [template = constants.%.9] -// CHECK:STDOUT: %.loc212_106: type = array_type %.loc212_105, %SelfNestedBadParam [template = constants.%.15] +// CHECK:STDOUT: %.loc212_105: Core.IntLiteral = int_value 4 [template = constants.%.10] +// CHECK:STDOUT: %.loc212_106: type = array_type %.loc212_105, %SelfNestedBadParam [template = constants.%.16] // CHECK:STDOUT: %x.param: %tuple.type.5 = value_param runtime_param0 // CHECK:STDOUT: %x: %tuple.type.5 = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref %.15 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.15 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %.16 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.16 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc205: = interface_witness () [template = ] // CHECK:STDOUT: @@ -979,16 +985,16 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: generic fn @F.13(@SelfNested.%Self: %SelfNested.type) { // CHECK:STDOUT: %Self: %SelfNested.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_16.1: type = ptr_type @F.13.%Self (%Self.3) [symbolic = %.loc188_16.1 (constants.%.7)] -// CHECK:STDOUT: %.loc188_37.1: type = struct_type {.x: @F.13.%Self (%Self.3), .y: i32} [symbolic = %.loc188_37.1 (constants.%.8)] -// CHECK:STDOUT: %tuple.type: type = tuple_type (@F.13.%.loc188_16.1 (%.7), @F.13.%.loc188_37.1 (%.8)) [symbolic = %tuple.type (constants.%tuple.type.2)] -// CHECK:STDOUT: %.loc188_52.1: type = array_type constants.%.9, @F.13.%Self (%Self.3) [symbolic = %.loc188_52.1 (constants.%.10)] +// CHECK:STDOUT: %.loc188_37.1: type = struct_type {.x: @F.13.%Self (%Self.3), .y: %i32} [symbolic = %.loc188_37.1 (constants.%.9)] +// CHECK:STDOUT: %tuple.type: type = tuple_type (@F.13.%.loc188_16.1 (%.7), @F.13.%.loc188_37.1 (%.9)) [symbolic = %tuple.type (constants.%tuple.type.2)] +// CHECK:STDOUT: %.loc188_52.1: type = array_type constants.%.10, @F.13.%Self (%Self.3) [symbolic = %.loc188_52.1 (constants.%.11)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param_patt: @F.13.%tuple.type (%tuple.type.2)) -> @F.13.%.loc188_52.1 (%.10); +// CHECK:STDOUT: fn(%x.param_patt: @F.13.%tuple.type (%tuple.type.2)) -> @F.13.%.loc188_52.1 (%.11); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.14(%x.param_patt: %tuple.type.3) -> %.15; +// CHECK:STDOUT: fn @F.14(%x.param_patt: %tuple.type.3) -> %.16; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.15(%x.param_patt: %tuple.type.5) -> %.15; +// CHECK:STDOUT: fn @F.15(%x.param_patt: %tuple.type.5) -> %.16; // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Self.1) {} // CHECK:STDOUT: @@ -1017,24 +1023,24 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: specific @F.13(constants.%Self.3) { // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: %.loc188_16.1 => constants.%.7 -// CHECK:STDOUT: %.loc188_37.1 => constants.%.8 +// CHECK:STDOUT: %.loc188_37.1 => constants.%.9 // CHECK:STDOUT: %tuple.type => constants.%tuple.type.2 -// CHECK:STDOUT: %.loc188_52.1 => constants.%.10 +// CHECK:STDOUT: %.loc188_52.1 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.13(constants.%SelfNestedBadParam) { // CHECK:STDOUT: %Self => constants.%SelfNestedBadParam -// CHECK:STDOUT: %.loc188_16.1 => constants.%.13 -// CHECK:STDOUT: %.loc188_37.1 => constants.%.16 +// CHECK:STDOUT: %.loc188_16.1 => constants.%.14 +// CHECK:STDOUT: %.loc188_37.1 => constants.%.17 // CHECK:STDOUT: %tuple.type => constants.%tuple.type.4 -// CHECK:STDOUT: %.loc188_52.1 => constants.%.15 +// CHECK:STDOUT: %.loc188_52.1 => constants.%.16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.13(constants.%SelfNestedBadReturnType) { // CHECK:STDOUT: %Self => constants.%SelfNestedBadReturnType -// CHECK:STDOUT: %.loc188_16.1 => constants.%.17 -// CHECK:STDOUT: %.loc188_37.1 => constants.%.18 +// CHECK:STDOUT: %.loc188_16.1 => constants.%.18 +// CHECK:STDOUT: %.loc188_37.1 => constants.%.19 // CHECK:STDOUT: %tuple.type => constants.%tuple.type.5 -// CHECK:STDOUT: %.loc188_52.1 => constants.%.19 +// CHECK:STDOUT: %.loc188_52.1 => constants.%.20 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon index 269e4c917682..33b66ebe53a1 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon @@ -46,14 +46,16 @@ impl f64 as type where .Self impls type {} // CHECK:STDOUT: --- fail_impl_as_false.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: bool = bool_literal false [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: bool = bool_literal false [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -65,16 +67,17 @@ impl f64 as type where .Self impls type {} // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %.loc11: type = converted @impl.13.%.loc11_13, [template = ] -// CHECK:STDOUT: impl_decl @impl.13 [template] {} { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_6.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_6.2: type = converted %int.make_type_32, %.loc11_6.1 [template = i32] -// CHECK:STDOUT: %.loc11_13: bool = bool_literal false [template = constants.%.1] +// CHECK:STDOUT: %.loc11: type = converted @impl.9.%.loc11_13, [template = ] +// CHECK:STDOUT: impl_decl @impl.9 [template] {} { +// CHECK:STDOUT: %.loc11_6.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_6.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_6.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_6.3: type = converted %int.make_type_signed, %.loc11_6.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13: bool = bool_literal false [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.13: %.loc11_6.2 as { +// CHECK:STDOUT: impl @impl.9: %.loc11_6.3 as { // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/fail_redefinition.carbon b/toolchain/check/testdata/impl/fail_redefinition.carbon index 41dc4860a1b8..0c07617e479b 100644 --- a/toolchain/check/testdata/impl/fail_redefinition.carbon +++ b/toolchain/check/testdata/impl/fail_redefinition.carbon @@ -25,13 +25,15 @@ impl i32 as I {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -45,15 +47,17 @@ impl i32 as I {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] {} { -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_6.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_6.2: type = converted %int.make_type_32.loc13, %.loc13_6.1 [template = i32] +// CHECK:STDOUT: %.loc13_6.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_6.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_6.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_6.3: type = converted %int.make_type_signed.loc13, %.loc13_6.2 [template = constants.%i32] // CHECK:STDOUT: %I.ref.loc13: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl [template] {} { -// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_6.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] -// CHECK:STDOUT: %.loc21_6.2: type = converted %int.make_type_32.loc21, %.loc21_6.1 [template = i32] +// CHECK:STDOUT: %.loc21_6.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%.loc21_6.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_6.2: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_6.3: type = converted %int.make_type_signed.loc21, %.loc21_6.2 [template = constants.%i32] // CHECK:STDOUT: %I.ref.loc21: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -66,8 +70,8 @@ impl i32 as I {} // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc13_6.2 as %I.ref.loc13 { +// CHECK:STDOUT: impl @impl: %.loc13_6.3 as %I.ref.loc13 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = .inst+20.loc13_15 +// CHECK:STDOUT: witness = .inst+27.loc13_15 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon index 786bbfb1e763..ccafb1ce761f 100644 --- a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon @@ -51,7 +51,7 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type.1] {} {} -// CHECK:STDOUT: impl_decl @impl.13 [template] {} { +// CHECK:STDOUT: impl_decl @impl.9 [template] {} { // CHECK:STDOUT: %bool.make_type.loc23_6: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc23_6.1: type = value_of_initializer %bool.make_type.loc23_6 [template = bool] // CHECK:STDOUT: %.loc23_6.2: type = converted %bool.make_type.loc23_6, %.loc23_6.1 [template = bool] @@ -78,7 +78,7 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: witness = (%T) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.13: %.loc23_6.2 as %.loc23_16 { +// CHECK:STDOUT: impl @impl.9: %.loc23_6.2 as %.loc23_16 { // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon index 11822d24ea5c..b964ca878e87 100644 --- a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon @@ -40,18 +40,20 @@ impl C as I { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] // CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.5 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.3 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %.6: = interface_witness (%F.3) [template] +// CHECK:STDOUT: %.7: = interface_witness (%F.3) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -68,14 +70,15 @@ impl C as I { // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc19_11.2: type = converted %int.make_type_32, %.loc19_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc19_11.1: Core.IntLiteral = int_value 32 [template = constants.%.5] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc19_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc19_11.3: type = converted %int.make_type_signed, %.loc19_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] @@ -98,7 +101,7 @@ impl C as I { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %C.ref as %I.ref { // CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.3] {} {} -// CHECK:STDOUT: %.loc27: = interface_witness (%F.decl) [template = constants.%.6] +// CHECK:STDOUT: %.loc27: = interface_witness (%F.decl) [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl @@ -122,7 +125,7 @@ impl C as I { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2() -> i32 { +// CHECK:STDOUT: fn @F.2() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %F.ref: %.1 = name_ref F, @I.%.loc12 [template = constants.%.2] diff --git a/toolchain/check/testdata/impl/lookup/instance_method.carbon b/toolchain/check/testdata/impl/lookup/instance_method.carbon index ae5262bd14a7..792c8588600b 100644 --- a/toolchain/check/testdata/impl/lookup/instance_method.carbon +++ b/toolchain/check/testdata/impl/lookup/instance_method.carbon @@ -30,24 +30,26 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] -// CHECK:STDOUT: %.1: type = assoc_entity_type %I.type, %F.type.1 [template] -// CHECK:STDOUT: %.2: %.1 = assoc_entity element0, @I.%F.decl [template] +// CHECK:STDOUT: %.2: type = assoc_entity_type %I.type, %F.type.1 [template] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @I.%F.decl [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.3: = interface_witness (%F.2) [template] -// CHECK:STDOUT: %.4: type = struct_type {} [template] -// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] +// CHECK:STDOUT: %.4: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %.5: type = struct_type {} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.3 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -67,17 +69,18 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.3] { // CHECK:STDOUT: %c.patt: %C = binding_pattern c // CHECK:STDOUT: %c.param_patt: %C = value_param_pattern %c.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl.loc11 [template = constants.%C] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_15.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc23_15.2: type = converted %int.make_type_32, %.loc23_15.1 [template = i32] +// CHECK:STDOUT: %.loc23_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc23_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_15.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc23_15.3: type = converted %int.make_type_signed, %.loc23_15.2 [template = constants.%i32] // CHECK:STDOUT: %c.param: %C = value_param runtime_param0 // CHECK:STDOUT: %c: %C = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -86,21 +89,22 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { // CHECK:STDOUT: %self.patt: @F.1.%Self (%Self) = binding_pattern self // CHECK:STDOUT: %self.param_patt: @F.1.%Self (%Self) = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc14_14.1: type = facet_type_access %Self.ref [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %.loc14_14.2: type = converted %Self.ref, %.loc14_14.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_25.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_25.2: type = converted %int.make_type_32, %.loc14_25.1 [template = i32] +// CHECK:STDOUT: %.loc14_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_25.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_25.3: type = converted %int.make_type_signed, %.loc14_25.2 [template = constants.%i32] // CHECK:STDOUT: %self.param: @F.1.%Self (%Self) = value_param runtime_param0 // CHECK:STDOUT: %self: @F.1.%Self (%Self) = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc14: %.1 = assoc_entity element0, %F.decl [template = constants.%.2] +// CHECK:STDOUT: %.loc14: %.2 = assoc_entity element0, %F.decl [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self @@ -112,19 +116,20 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_27.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc19_27.2: type = converted %int.make_type_32, %.loc19_27.1 [template = i32] +// CHECK:STDOUT: %.loc19_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc19_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_27.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc19_27.3: type = converted %int.make_type_signed, %.loc19_27.2 [template = constants.%i32] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 // CHECK:STDOUT: %self: %C = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc18: = interface_witness (%F.decl) [template = constants.%.3] +// CHECK:STDOUT: %.loc18: = interface_witness (%F.decl) [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl @@ -136,7 +141,7 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc21: = complete_type_witness %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc21: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -146,20 +151,20 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self (%Self)]() -> i32; +// CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self (%Self)]() -> %i32; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2[%self.param_patt: %C]() -> i32; +// CHECK:STDOUT: fn @F.2[%self.param_patt: %C]() -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.3(%c.param_patt: %C) -> i32 { +// CHECK:STDOUT: fn @F.3(%c.param_patt: %C) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c -// CHECK:STDOUT: %F.ref: %.1 = name_ref F, @I.%.loc14 [template = constants.%.2] -// CHECK:STDOUT: %.loc24_11.1: %F.type.1 = interface_witness_access constants.%.3, element0 [template = constants.%F.2] +// CHECK:STDOUT: %F.ref: %.2 = name_ref F, @I.%.loc14 [template = constants.%.3] +// CHECK:STDOUT: %.loc24_11.1: %F.type.1 = interface_witness_access constants.%.4, element0 [template = constants.%F.2] // CHECK:STDOUT: %.loc24_11.2: = bound_method %c.ref, %.loc24_11.1 -// CHECK:STDOUT: %F.call: init i32 = call %.loc24_11.2(%c.ref) -// CHECK:STDOUT: %.loc24_15.1: i32 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc24_15.2: i32 = converted %F.call, %.loc24_15.1 +// CHECK:STDOUT: %F.call: init %i32 = call %.loc24_11.2(%c.ref) +// CHECK:STDOUT: %.loc24_15.1: %i32 = value_of_initializer %F.call +// CHECK:STDOUT: %.loc24_15.2: %i32 = converted %F.call, %.loc24_15.1 // CHECK:STDOUT: return %.loc24_15.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/redeclaration.carbon b/toolchain/check/testdata/impl/redeclaration.carbon index 9ab74c0504d1..e4fb52d79037 100644 --- a/toolchain/check/testdata/impl/redeclaration.carbon +++ b/toolchain/check/testdata/impl/redeclaration.carbon @@ -23,17 +23,19 @@ impl i32 as I {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %X: type = class_type @X [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] -// CHECK:STDOUT: %.3: = interface_witness () [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -48,16 +50,18 @@ impl i32 as I {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @impl.1 [template] {} { -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_6.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_6.2: type = converted %int.make_type_32.loc13, %.loc13_6.1 [template = i32] +// CHECK:STDOUT: %.loc13_6.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_6.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_6.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_6.3: type = converted %int.make_type_signed.loc13, %.loc13_6.2 [template = constants.%i32] // CHECK:STDOUT: %I.ref.loc13: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} // CHECK:STDOUT: impl_decl @impl.2 [template] {} { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_6.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc19_6.2: type = converted %int.make_type_32, %.loc19_6.1 [template = i32] +// CHECK:STDOUT: %.loc19_6.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc19_6.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_6.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc19_6.3: type = converted %int.make_type_signed, %.loc19_6.2 [template = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -70,10 +74,10 @@ impl i32 as I {} // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %.loc13_6.2 as %I.ref.loc13; +// CHECK:STDOUT: impl @impl.1: %.loc13_6.3 as %I.ref.loc13; // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %.loc19_6.2 as %I.ref { -// CHECK:STDOUT: %.loc19_15: = interface_witness () [template = constants.%.3] +// CHECK:STDOUT: impl @impl.2: %.loc19_6.3 as %I.ref { +// CHECK:STDOUT: %.loc19_15: = interface_witness () [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = %.loc19_15 @@ -81,12 +85,13 @@ impl i32 as I {} // CHECK:STDOUT: // CHECK:STDOUT: class @X { // CHECK:STDOUT: impl_decl @impl.1 [template] {} { -// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_8.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] -// CHECK:STDOUT: %.loc16_8.2: type = converted %int.make_type_32.loc16, %.loc16_8.1 [template = i32] +// CHECK:STDOUT: %.loc16_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%.loc16_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_8.2: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_8.3: type = converted %int.make_type_signed.loc16, %.loc16_8.2 [template = constants.%i32] // CHECK:STDOUT: %I.ref.loc16: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc17: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc17: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X diff --git a/toolchain/check/testdata/index/array_element_access.carbon b/toolchain/check/testdata/index/array_element_access.carbon index 6a84ca2e19d8..c0636b4626c2 100644 --- a/toolchain/check/testdata/index/array_element_access.carbon +++ b/toolchain/check/testdata/index/array_element_access.carbon @@ -16,33 +16,39 @@ var d: i32 = a[b]; // CHECK:STDOUT: --- array_element_access.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 24 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 24 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.6: i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.30: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.31: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 12 [template] -// CHECK:STDOUT: %.33: i32 = int_value 1 [template] -// CHECK:STDOUT: %.34: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.35: i32 = int_value 24 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.32, %.35) [template] -// CHECK:STDOUT: %.36: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.37: = bound_method %.36, %Convert.15 [template] -// CHECK:STDOUT: %.38: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.39: = bound_method %.38, %Convert.15 [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.28: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 12 [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.32: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 24 [template] +// CHECK:STDOUT: %array: %.3 = tuple_value (%.30, %.34) [template] +// CHECK:STDOUT: %.35: = bound_method %.31, %Convert.14 [template] +// CHECK:STDOUT: %.36: = specific_function %.35, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.37: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.38: = bound_method %.7, %Convert.14 [template] +// CHECK:STDOUT: %.39: = specific_function %.38, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.40: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -58,73 +64,81 @@ var d: i32 = a[b]; // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 2 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_8.2: type = converted %int.make_type_32.loc13, %.loc13_8.1 [template = i32] -// CHECK:STDOUT: %c.var: ref i32 = var c -// CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var -// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_8.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] -// CHECK:STDOUT: %.loc14_8.2: type = converted %int.make_type_32.loc14, %.loc14_8.1 [template = i32] -// CHECK:STDOUT: %d.var: ref i32 = var d -// CHECK:STDOUT: %d: ref i32 = bind_name d, %d.var +// CHECK:STDOUT: %.loc11_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 2 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_9.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.3: type = converted %int.make_type_signed.loc11, %.loc11_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, %i32 [template = constants.%.3] +// CHECK:STDOUT: %a.var: ref %.3 = var a +// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var +// CHECK:STDOUT: %.loc12_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.3: type = converted %int.make_type_signed.loc12, %.loc12_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc13_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8.3: type = converted %int.make_type_signed.loc13, %.loc13_8.2 [template = constants.%i32] +// CHECK:STDOUT: %c.var: ref %i32 = var c +// CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var +// CHECK:STDOUT: %.loc14_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%.loc14_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_8.2: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_8.3: type = converted %int.make_type_signed.loc14, %.loc14_8.2 [template = constants.%i32] +// CHECK:STDOUT: %d.var: ref %i32 = var d +// CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 12 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_24: Core.IntLiteral = int_value 24 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 12 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_24: Core.IntLiteral = int_value 24 [template = constants.%.6] // CHECK:STDOUT: %.loc11_26.1: %tuple.type = tuple_literal (%.loc11_20, %.loc11_24) -// CHECK:STDOUT: %.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_26.3: = bound_method %.loc11_20, %.loc11_26.2 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc11_26.1: init i32 = call %.loc11_26.3(%.loc11_20) [template = constants.%.32] -// CHECK:STDOUT: %.loc11_26.4: init i32 = converted %.loc11_20, %int.convert_checked.loc11_26.1 [template = constants.%.32] -// CHECK:STDOUT: %.loc11_26.5: i32 = int_value 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc11_26.6: ref i32 = array_index file.%a.var, %.loc11_26.5 -// CHECK:STDOUT: %.loc11_26.7: init i32 = initialize_from %.loc11_26.4 to %.loc11_26.6 [template = constants.%.32] -// CHECK:STDOUT: %.loc11_26.8: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_26.9: = bound_method %.loc11_24, %.loc11_26.8 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc11_26.2: init i32 = call %.loc11_26.9(%.loc11_24) [template = constants.%.35] -// CHECK:STDOUT: %.loc11_26.10: init i32 = converted %.loc11_24, %int.convert_checked.loc11_26.2 [template = constants.%.35] -// CHECK:STDOUT: %.loc11_26.11: i32 = int_value 1 [template = constants.%.33] -// CHECK:STDOUT: %.loc11_26.12: ref i32 = array_index file.%a.var, %.loc11_26.11 -// CHECK:STDOUT: %.loc11_26.13: init i32 = initialize_from %.loc11_26.10 to %.loc11_26.12 [template = constants.%.35] -// CHECK:STDOUT: %.loc11_26.14: init %.2 = array_init (%.loc11_26.7, %.loc11_26.13) to file.%a.var [template = constants.%array] -// CHECK:STDOUT: %.loc11_27: init %.2 = converted %.loc11_26.1, %.loc11_26.14 [template = constants.%array] +// CHECK:STDOUT: %.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_26.3: = bound_method %.loc11_20, %.loc11_26.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_26.4: = specific_function %.loc11_26.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %.loc11_26.4(%.loc11_20) [template = constants.%.30] +// CHECK:STDOUT: %.loc11_26.5: init %i32 = converted %.loc11_20, %int.convert_checked.loc11_26.1 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_26.6: Core.IntLiteral = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc11_26.7: ref %i32 = array_index file.%a.var, %.loc11_26.6 +// CHECK:STDOUT: %.loc11_26.8: init %i32 = initialize_from %.loc11_26.5 to %.loc11_26.7 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_26.9: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_26.10: = bound_method %.loc11_24, %.loc11_26.9 [template = constants.%.32] +// CHECK:STDOUT: %.loc11_26.11: = specific_function %.loc11_26.10, @Convert.2(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %.loc11_26.11(%.loc11_24) [template = constants.%.34] +// CHECK:STDOUT: %.loc11_26.12: init %i32 = converted %.loc11_24, %int.convert_checked.loc11_26.2 [template = constants.%.34] +// CHECK:STDOUT: %.loc11_26.13: Core.IntLiteral = int_value 1 [template = constants.%.31] +// CHECK:STDOUT: %.loc11_26.14: ref %i32 = array_index file.%a.var, %.loc11_26.13 +// CHECK:STDOUT: %.loc11_26.15: init %i32 = initialize_from %.loc11_26.12 to %.loc11_26.14 [template = constants.%.34] +// CHECK:STDOUT: %.loc11_26.16: init %.3 = array_init (%.loc11_26.8, %.loc11_26.15) to file.%a.var [template = constants.%array] +// CHECK:STDOUT: %.loc11_27: init %.3 = converted %.loc11_26.1, %.loc11_26.16 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_27 -// CHECK:STDOUT: %.loc12_14: Core.IntLiteral = int_value 1 [template = constants.%.36] -// CHECK:STDOUT: %.loc12_15.1: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_15.2: = bound_method %.loc12_14, %.loc12_15.1 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc12: init i32 = call %.loc12_15.2(%.loc12_14) [template = constants.%.33] -// CHECK:STDOUT: %.loc12_15.3: init i32 = converted %.loc12_14, %int.convert_checked.loc12 [template = constants.%.33] -// CHECK:STDOUT: assign file.%b.var, %.loc12_15.3 -// CHECK:STDOUT: %a.ref.loc13: ref %.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc13_16.1: Core.IntLiteral = int_value 0 [template = constants.%.38] -// CHECK:STDOUT: %.loc13_16.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_16.3: = bound_method %.loc13_16.1, %.loc13_16.2 [template = constants.%.39] -// CHECK:STDOUT: %int.convert_checked.loc13: init i32 = call %.loc13_16.3(%.loc13_16.1) [template = constants.%.6] -// CHECK:STDOUT: %.loc13_16.4: i32 = value_of_initializer %int.convert_checked.loc13 [template = constants.%.6] -// CHECK:STDOUT: %.loc13_16.5: i32 = converted %.loc13_16.1, %.loc13_16.4 [template = constants.%.6] -// CHECK:STDOUT: %.loc13_17.1: ref i32 = array_index %a.ref.loc13, %.loc13_16.5 -// CHECK:STDOUT: %.loc13_17.2: i32 = bind_value %.loc13_17.1 +// CHECK:STDOUT: %.loc12_14: Core.IntLiteral = int_value 1 [template = constants.%.31] +// CHECK:STDOUT: %.loc12_15.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_15.2: = bound_method %.loc12_14, %.loc12_15.1 [template = constants.%.35] +// CHECK:STDOUT: %.loc12_15.3: = specific_function %.loc12_15.2, @Convert.2(constants.%.1) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %.loc12_15.3(%.loc12_14) [template = constants.%.37] +// CHECK:STDOUT: %.loc12_15.4: init %i32 = converted %.loc12_14, %int.convert_checked.loc12 [template = constants.%.37] +// CHECK:STDOUT: assign file.%b.var, %.loc12_15.4 +// CHECK:STDOUT: %a.ref.loc13: ref %.3 = name_ref a, file.%a +// CHECK:STDOUT: %.loc13_16.1: Core.IntLiteral = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc13_16.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_16.3: = bound_method %.loc13_16.1, %.loc13_16.2 [template = constants.%.38] +// CHECK:STDOUT: %.loc13_16.4: = specific_function %.loc13_16.3, @Convert.2(constants.%.1) [template = constants.%.39] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %.loc13_16.4(%.loc13_16.1) [template = constants.%.40] +// CHECK:STDOUT: %.loc13_16.5: %i32 = value_of_initializer %int.convert_checked.loc13 [template = constants.%.40] +// CHECK:STDOUT: %.loc13_16.6: %i32 = converted %.loc13_16.1, %.loc13_16.5 [template = constants.%.40] +// CHECK:STDOUT: %.loc13_17.1: ref %i32 = array_index %a.ref.loc13, %.loc13_16.6 +// CHECK:STDOUT: %.loc13_17.2: %i32 = bind_value %.loc13_17.1 // CHECK:STDOUT: assign file.%c.var, %.loc13_17.2 -// CHECK:STDOUT: %a.ref.loc14: ref %.2 = name_ref a, file.%a -// CHECK:STDOUT: %b.ref: ref i32 = name_ref b, file.%b -// CHECK:STDOUT: %.loc14_16: i32 = bind_value %b.ref -// CHECK:STDOUT: %.loc14_17.1: ref i32 = array_index %a.ref.loc14, %.loc14_16 -// CHECK:STDOUT: %.loc14_17.2: i32 = bind_value %.loc14_17.1 +// CHECK:STDOUT: %a.ref.loc14: ref %.3 = name_ref a, file.%a +// CHECK:STDOUT: %b.ref: ref %i32 = name_ref b, file.%b +// CHECK:STDOUT: %.loc14_16: %i32 = bind_value %b.ref +// CHECK:STDOUT: %.loc14_17.1: ref %i32 = array_index %a.ref.loc14, %.loc14_16 +// CHECK:STDOUT: %.loc14_17.2: %i32 = bind_value %.loc14_17.1 // CHECK:STDOUT: assign file.%d.var, %.loc14_17.2 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index 358c5245d0b8..d3b3b3beaae4 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -31,42 +31,49 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: --- expr_category.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.6: i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.30: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.31: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 1 [template] -// CHECK:STDOUT: %.33: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 2 [template] -// CHECK:STDOUT: %.35: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.36: i32 = int_value 3 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.32, %.34, %.36) [template] -// CHECK:STDOUT: %.37: type = ptr_type i32 [template] -// CHECK:STDOUT: %.38: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.39: = bound_method %.38, %Convert.15 [template] -// CHECK:STDOUT: %.40: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %.41: = bound_method %.40, %Convert.15 [template] -// CHECK:STDOUT: %.42: i32 = int_value 4 [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.28: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.31: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.34: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.35: = specific_function %.34, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.36: %i32 = int_value 3 [template] +// CHECK:STDOUT: %array: %.3 = tuple_value (%.30, %.33, %.36) [template] +// CHECK:STDOUT: %.37: type = ptr_type %i32 [template] +// CHECK:STDOUT: %.38: = bound_method %.7, %Convert.14 [template] +// CHECK:STDOUT: %.39: = specific_function %.38, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.40: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.41: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.42: = bound_method %.41, %Convert.14 [template] +// CHECK:STDOUT: %.43: = specific_function %.42, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.44: %i32 = int_value 4 [template] // CHECK:STDOUT: %ValueBinding.type: type = fn_type @ValueBinding [template] // CHECK:STDOUT: %ValueBinding: %ValueBinding.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -82,182 +89,200 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.3 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.3 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_32, %.loc11_12.1 [template = i32] -// CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17, i32 [template = constants.%.2] -// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param +// CHECK:STDOUT: %.loc11_12.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_12.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_12.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_12.3: type = converted %int.make_type_signed, %.loc11_12.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17, %i32 [template = constants.%.3] +// CHECK:STDOUT: %return.param: ref %.3 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %.3 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %b.patt: %.2 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %.2 = value_param_pattern %b.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %.3 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %.3 = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_15: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] -// CHECK:STDOUT: %.loc13_16: type = array_type %.loc13_15, i32 [template = constants.%.2] -// CHECK:STDOUT: %b.param: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %b: %.2 = bind_name b, %b.param +// CHECK:STDOUT: %.loc13_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_15: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc13_10.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.3: type = converted %int.make_type_signed.loc13, %.loc13_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_16: type = array_type %.loc13_15, %i32 [template = constants.%.3] +// CHECK:STDOUT: %b.param: %.3 = value_param runtime_param0 +// CHECK:STDOUT: %b: %.3 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %ValueBinding.decl: %ValueBinding.type = fn_decl @ValueBinding [template = constants.%ValueBinding] { -// CHECK:STDOUT: %b.patt: %.2 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %.2 = value_param_pattern %b.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %.3 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %.3 = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_26: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc21_21.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] -// CHECK:STDOUT: %.loc21_21.2: type = converted %int.make_type_32.loc21, %.loc21_21.1 [template = i32] -// CHECK:STDOUT: %.loc21_27: type = array_type %.loc21_26, i32 [template = constants.%.2] -// CHECK:STDOUT: %b.param: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %b: %.2 = bind_name b, %b.param +// CHECK:STDOUT: %.loc21_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%.loc21_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_26: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc21_21.2: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_21.3: type = converted %int.make_type_signed.loc21, %.loc21_21.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_27: type = array_type %.loc21_26, %i32 [template = constants.%.3] +// CHECK:STDOUT: %b.param: %.3 = value_param runtime_param0 +// CHECK:STDOUT: %b: %.3 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> %.2; +// CHECK:STDOUT: fn @F() -> %.3; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%b.param_patt: %.2) { +// CHECK:STDOUT: fn @G(%b.param_patt: %.3) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_16: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] -// CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_32.loc14, %.loc14_11.1 [template = i32] -// CHECK:STDOUT: %.loc14_17: type = array_type %.loc14_16, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %.loc14_22: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_25: Core.IntLiteral = int_value 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc14_28: Core.IntLiteral = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc14_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%.loc14_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_16: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_11.2: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_11.3: type = converted %int.make_type_signed.loc14, %.loc14_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_17: type = array_type %.loc14_16, %i32 [template = constants.%.3] +// CHECK:STDOUT: %a.var: ref %.3 = var a +// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var +// CHECK:STDOUT: %.loc14_22: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_25: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc14_28: Core.IntLiteral = int_value 3 [template = constants.%.2] // CHECK:STDOUT: %.loc14_29.1: %tuple.type = tuple_literal (%.loc14_22, %.loc14_25, %.loc14_28) -// CHECK:STDOUT: %.loc14_29.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_29.3: = bound_method %.loc14_22, %.loc14_29.2 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc14_29.1: init i32 = call %.loc14_29.3(%.loc14_22) [template = constants.%.32] -// CHECK:STDOUT: %.loc14_29.4: init i32 = converted %.loc14_22, %int.convert_checked.loc14_29.1 [template = constants.%.32] -// CHECK:STDOUT: %.loc14_29.5: i32 = int_value 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc14_29.6: ref i32 = array_index %a.var, %.loc14_29.5 -// CHECK:STDOUT: %.loc14_29.7: init i32 = initialize_from %.loc14_29.4 to %.loc14_29.6 [template = constants.%.32] -// CHECK:STDOUT: %.loc14_29.8: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_29.9: = bound_method %.loc14_25, %.loc14_29.8 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc14_29.2: init i32 = call %.loc14_29.9(%.loc14_25) [template = constants.%.34] -// CHECK:STDOUT: %.loc14_29.10: init i32 = converted %.loc14_25, %int.convert_checked.loc14_29.2 [template = constants.%.34] -// CHECK:STDOUT: %.loc14_29.11: i32 = int_value 1 [template = constants.%.32] -// CHECK:STDOUT: %.loc14_29.12: ref i32 = array_index %a.var, %.loc14_29.11 -// CHECK:STDOUT: %.loc14_29.13: init i32 = initialize_from %.loc14_29.10 to %.loc14_29.12 [template = constants.%.34] -// CHECK:STDOUT: %.loc14_29.14: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_29.15: = bound_method %.loc14_28, %.loc14_29.14 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc14_29.3: init i32 = call %.loc14_29.15(%.loc14_28) [template = constants.%.36] -// CHECK:STDOUT: %.loc14_29.16: init i32 = converted %.loc14_28, %int.convert_checked.loc14_29.3 [template = constants.%.36] -// CHECK:STDOUT: %.loc14_29.17: i32 = int_value 2 [template = constants.%.34] -// CHECK:STDOUT: %.loc14_29.18: ref i32 = array_index %a.var, %.loc14_29.17 -// CHECK:STDOUT: %.loc14_29.19: init i32 = initialize_from %.loc14_29.16 to %.loc14_29.18 [template = constants.%.36] -// CHECK:STDOUT: %.loc14_29.20: init %.2 = array_init (%.loc14_29.7, %.loc14_29.13, %.loc14_29.19) to %a.var [template = constants.%array] -// CHECK:STDOUT: %.loc14_30: init %.2 = converted %.loc14_29.1, %.loc14_29.20 [template = constants.%array] +// CHECK:STDOUT: %.loc14_29.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_29.3: = bound_method %.loc14_22, %.loc14_29.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc14_29.4: = specific_function %.loc14_29.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc14_29.1: init %i32 = call %.loc14_29.4(%.loc14_22) [template = constants.%.30] +// CHECK:STDOUT: %.loc14_29.5: init %i32 = converted %.loc14_22, %int.convert_checked.loc14_29.1 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_29.6: Core.IntLiteral = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc14_29.7: ref %i32 = array_index %a.var, %.loc14_29.6 +// CHECK:STDOUT: %.loc14_29.8: init %i32 = initialize_from %.loc14_29.5 to %.loc14_29.7 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_29.9: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_29.10: = bound_method %.loc14_25, %.loc14_29.9 [template = constants.%.31] +// CHECK:STDOUT: %.loc14_29.11: = specific_function %.loc14_29.10, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc14_29.2: init %i32 = call %.loc14_29.11(%.loc14_25) [template = constants.%.33] +// CHECK:STDOUT: %.loc14_29.12: init %i32 = converted %.loc14_25, %int.convert_checked.loc14_29.2 [template = constants.%.33] +// CHECK:STDOUT: %.loc14_29.13: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_29.14: ref %i32 = array_index %a.var, %.loc14_29.13 +// CHECK:STDOUT: %.loc14_29.15: init %i32 = initialize_from %.loc14_29.12 to %.loc14_29.14 [template = constants.%.33] +// CHECK:STDOUT: %.loc14_29.16: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_29.17: = bound_method %.loc14_28, %.loc14_29.16 [template = constants.%.34] +// CHECK:STDOUT: %.loc14_29.18: = specific_function %.loc14_29.17, @Convert.2(constants.%.1) [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc14_29.3: init %i32 = call %.loc14_29.18(%.loc14_28) [template = constants.%.36] +// CHECK:STDOUT: %.loc14_29.19: init %i32 = converted %.loc14_28, %int.convert_checked.loc14_29.3 [template = constants.%.36] +// CHECK:STDOUT: %.loc14_29.20: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc14_29.21: ref %i32 = array_index %a.var, %.loc14_29.20 +// CHECK:STDOUT: %.loc14_29.22: init %i32 = initialize_from %.loc14_29.19 to %.loc14_29.21 [template = constants.%.36] +// CHECK:STDOUT: %.loc14_29.23: init %.3 = array_init (%.loc14_29.8, %.loc14_29.15, %.loc14_29.22) to %a.var [template = constants.%array] +// CHECK:STDOUT: %.loc14_30: init %.3 = converted %.loc14_29.1, %.loc14_29.23 [template = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc14_30 -// CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_14.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] -// CHECK:STDOUT: %.loc17_14.2: type = converted %int.make_type_32.loc17, %.loc17_14.1 [template = i32] -// CHECK:STDOUT: %.loc17_14.3: type = ptr_type i32 [template = constants.%.37] +// CHECK:STDOUT: %.loc17_11: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%.loc17_11) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_14.1: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_14.2: type = converted %int.make_type_signed.loc17, %.loc17_14.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_14.3: type = ptr_type %i32 [template = constants.%.37] // CHECK:STDOUT: %pa.var: ref %.37 = var pa // CHECK:STDOUT: %pa: ref %.37 = bind_name pa, %pa.var -// CHECK:STDOUT: %a.ref.loc17: ref %.2 = name_ref a, %a -// CHECK:STDOUT: %.loc17_21.1: Core.IntLiteral = int_value 0 [template = constants.%.38] -// CHECK:STDOUT: %.loc17_21.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc17_21.3: = bound_method %.loc17_21.1, %.loc17_21.2 [template = constants.%.39] -// CHECK:STDOUT: %int.convert_checked.loc17: init i32 = call %.loc17_21.3(%.loc17_21.1) [template = constants.%.6] -// CHECK:STDOUT: %.loc17_21.4: i32 = value_of_initializer %int.convert_checked.loc17 [template = constants.%.6] -// CHECK:STDOUT: %.loc17_21.5: i32 = converted %.loc17_21.1, %.loc17_21.4 [template = constants.%.6] -// CHECK:STDOUT: %.loc17_22: ref i32 = array_index %a.ref.loc17, %.loc17_21.5 +// CHECK:STDOUT: %a.ref.loc17: ref %.3 = name_ref a, %a +// CHECK:STDOUT: %.loc17_21.1: Core.IntLiteral = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc17_21.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc17_21.3: = bound_method %.loc17_21.1, %.loc17_21.2 [template = constants.%.38] +// CHECK:STDOUT: %.loc17_21.4: = specific_function %.loc17_21.3, @Convert.2(constants.%.1) [template = constants.%.39] +// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %.loc17_21.4(%.loc17_21.1) [template = constants.%.40] +// CHECK:STDOUT: %.loc17_21.5: %i32 = value_of_initializer %int.convert_checked.loc17 [template = constants.%.40] +// CHECK:STDOUT: %.loc17_21.6: %i32 = converted %.loc17_21.1, %.loc17_21.5 [template = constants.%.40] +// CHECK:STDOUT: %.loc17_22: ref %i32 = array_index %a.ref.loc17, %.loc17_21.6 // CHECK:STDOUT: %.loc17_18: %.37 = addr_of %.loc17_22 // CHECK:STDOUT: assign %pa.var, %.loc17_18 -// CHECK:STDOUT: %a.ref.loc18: ref %.2 = name_ref a, %a -// CHECK:STDOUT: %.loc18_5.1: Core.IntLiteral = int_value 0 [template = constants.%.38] -// CHECK:STDOUT: %.loc18_5.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_5.3: = bound_method %.loc18_5.1, %.loc18_5.2 [template = constants.%.39] -// CHECK:STDOUT: %int.convert_checked.loc18_5: init i32 = call %.loc18_5.3(%.loc18_5.1) [template = constants.%.6] -// CHECK:STDOUT: %.loc18_5.4: i32 = value_of_initializer %int.convert_checked.loc18_5 [template = constants.%.6] -// CHECK:STDOUT: %.loc18_5.5: i32 = converted %.loc18_5.1, %.loc18_5.4 [template = constants.%.6] -// CHECK:STDOUT: %.loc18_6: ref i32 = array_index %a.ref.loc18, %.loc18_5.5 -// CHECK:STDOUT: %.loc18_10: Core.IntLiteral = int_value 4 [template = constants.%.40] -// CHECK:STDOUT: %.loc18_8.1: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_8.2: = bound_method %.loc18_10, %.loc18_8.1 [template = constants.%.41] -// CHECK:STDOUT: %int.convert_checked.loc18_8: init i32 = call %.loc18_8.2(%.loc18_10) [template = constants.%.42] -// CHECK:STDOUT: %.loc18_8.3: init i32 = converted %.loc18_10, %int.convert_checked.loc18_8 [template = constants.%.42] -// CHECK:STDOUT: assign %.loc18_6, %.loc18_8.3 +// CHECK:STDOUT: %a.ref.loc18: ref %.3 = name_ref a, %a +// CHECK:STDOUT: %.loc18_5.1: Core.IntLiteral = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc18_5.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_5.3: = bound_method %.loc18_5.1, %.loc18_5.2 [template = constants.%.38] +// CHECK:STDOUT: %.loc18_5.4: = specific_function %.loc18_5.3, @Convert.2(constants.%.1) [template = constants.%.39] +// CHECK:STDOUT: %int.convert_checked.loc18_5: init %i32 = call %.loc18_5.4(%.loc18_5.1) [template = constants.%.40] +// CHECK:STDOUT: %.loc18_5.5: %i32 = value_of_initializer %int.convert_checked.loc18_5 [template = constants.%.40] +// CHECK:STDOUT: %.loc18_5.6: %i32 = converted %.loc18_5.1, %.loc18_5.5 [template = constants.%.40] +// CHECK:STDOUT: %.loc18_6: ref %i32 = array_index %a.ref.loc18, %.loc18_5.6 +// CHECK:STDOUT: %.loc18_10: Core.IntLiteral = int_value 4 [template = constants.%.41] +// CHECK:STDOUT: %.loc18_8.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_8.2: = bound_method %.loc18_10, %.loc18_8.1 [template = constants.%.42] +// CHECK:STDOUT: %.loc18_8.3: = specific_function %.loc18_8.2, @Convert.2(constants.%.1) [template = constants.%.43] +// CHECK:STDOUT: %int.convert_checked.loc18_8: init %i32 = call %.loc18_8.3(%.loc18_10) [template = constants.%.44] +// CHECK:STDOUT: %.loc18_8.4: init %i32 = converted %.loc18_10, %int.convert_checked.loc18_8 [template = constants.%.44] +// CHECK:STDOUT: assign %.loc18_6, %.loc18_8.4 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ValueBinding(%b.param_patt: %.2) { +// CHECK:STDOUT: fn @ValueBinding(%b.param_patt: %.3) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_16: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] -// CHECK:STDOUT: %.loc22_11.2: type = converted %int.make_type_32.loc22, %.loc22_11.1 [template = i32] -// CHECK:STDOUT: %.loc22_17: type = array_type %.loc22_16, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %.loc22_22: Core.IntLiteral = int_value 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc22_25: Core.IntLiteral = int_value 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc22_28: Core.IntLiteral = int_value 3 [template = constants.%.1] +// CHECK:STDOUT: %.loc22_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%.loc22_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc22_16: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc22_11.2: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] +// CHECK:STDOUT: %.loc22_11.3: type = converted %int.make_type_signed.loc22, %.loc22_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc22_17: type = array_type %.loc22_16, %i32 [template = constants.%.3] +// CHECK:STDOUT: %a.var: ref %.3 = var a +// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var +// CHECK:STDOUT: %.loc22_22: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc22_25: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc22_28: Core.IntLiteral = int_value 3 [template = constants.%.2] // CHECK:STDOUT: %.loc22_29.1: %tuple.type = tuple_literal (%.loc22_22, %.loc22_25, %.loc22_28) -// CHECK:STDOUT: %.loc22_29.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc22_29.3: = bound_method %.loc22_22, %.loc22_29.2 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc22_29.1: init i32 = call %.loc22_29.3(%.loc22_22) [template = constants.%.32] -// CHECK:STDOUT: %.loc22_29.4: init i32 = converted %.loc22_22, %int.convert_checked.loc22_29.1 [template = constants.%.32] -// CHECK:STDOUT: %.loc22_29.5: i32 = int_value 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc22_29.6: ref i32 = array_index %a.var, %.loc22_29.5 -// CHECK:STDOUT: %.loc22_29.7: init i32 = initialize_from %.loc22_29.4 to %.loc22_29.6 [template = constants.%.32] -// CHECK:STDOUT: %.loc22_29.8: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc22_29.9: = bound_method %.loc22_25, %.loc22_29.8 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc22_29.2: init i32 = call %.loc22_29.9(%.loc22_25) [template = constants.%.34] -// CHECK:STDOUT: %.loc22_29.10: init i32 = converted %.loc22_25, %int.convert_checked.loc22_29.2 [template = constants.%.34] -// CHECK:STDOUT: %.loc22_29.11: i32 = int_value 1 [template = constants.%.32] -// CHECK:STDOUT: %.loc22_29.12: ref i32 = array_index %a.var, %.loc22_29.11 -// CHECK:STDOUT: %.loc22_29.13: init i32 = initialize_from %.loc22_29.10 to %.loc22_29.12 [template = constants.%.34] -// CHECK:STDOUT: %.loc22_29.14: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc22_29.15: = bound_method %.loc22_28, %.loc22_29.14 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc22_29.3: init i32 = call %.loc22_29.15(%.loc22_28) [template = constants.%.36] -// CHECK:STDOUT: %.loc22_29.16: init i32 = converted %.loc22_28, %int.convert_checked.loc22_29.3 [template = constants.%.36] -// CHECK:STDOUT: %.loc22_29.17: i32 = int_value 2 [template = constants.%.34] -// CHECK:STDOUT: %.loc22_29.18: ref i32 = array_index %a.var, %.loc22_29.17 -// CHECK:STDOUT: %.loc22_29.19: init i32 = initialize_from %.loc22_29.16 to %.loc22_29.18 [template = constants.%.36] -// CHECK:STDOUT: %.loc22_29.20: init %.2 = array_init (%.loc22_29.7, %.loc22_29.13, %.loc22_29.19) to %a.var [template = constants.%array] -// CHECK:STDOUT: %.loc22_30: init %.2 = converted %.loc22_29.1, %.loc22_29.20 [template = constants.%array] +// CHECK:STDOUT: %.loc22_29.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc22_29.3: = bound_method %.loc22_22, %.loc22_29.2 [template = constants.%.28] +// CHECK:STDOUT: %.loc22_29.4: = specific_function %.loc22_29.3, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc22_29.1: init %i32 = call %.loc22_29.4(%.loc22_22) [template = constants.%.30] +// CHECK:STDOUT: %.loc22_29.5: init %i32 = converted %.loc22_22, %int.convert_checked.loc22_29.1 [template = constants.%.30] +// CHECK:STDOUT: %.loc22_29.6: Core.IntLiteral = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc22_29.7: ref %i32 = array_index %a.var, %.loc22_29.6 +// CHECK:STDOUT: %.loc22_29.8: init %i32 = initialize_from %.loc22_29.5 to %.loc22_29.7 [template = constants.%.30] +// CHECK:STDOUT: %.loc22_29.9: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc22_29.10: = bound_method %.loc22_25, %.loc22_29.9 [template = constants.%.31] +// CHECK:STDOUT: %.loc22_29.11: = specific_function %.loc22_29.10, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc22_29.2: init %i32 = call %.loc22_29.11(%.loc22_25) [template = constants.%.33] +// CHECK:STDOUT: %.loc22_29.12: init %i32 = converted %.loc22_25, %int.convert_checked.loc22_29.2 [template = constants.%.33] +// CHECK:STDOUT: %.loc22_29.13: Core.IntLiteral = int_value 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc22_29.14: ref %i32 = array_index %a.var, %.loc22_29.13 +// CHECK:STDOUT: %.loc22_29.15: init %i32 = initialize_from %.loc22_29.12 to %.loc22_29.14 [template = constants.%.33] +// CHECK:STDOUT: %.loc22_29.16: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc22_29.17: = bound_method %.loc22_28, %.loc22_29.16 [template = constants.%.34] +// CHECK:STDOUT: %.loc22_29.18: = specific_function %.loc22_29.17, @Convert.2(constants.%.1) [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc22_29.3: init %i32 = call %.loc22_29.18(%.loc22_28) [template = constants.%.36] +// CHECK:STDOUT: %.loc22_29.19: init %i32 = converted %.loc22_28, %int.convert_checked.loc22_29.3 [template = constants.%.36] +// CHECK:STDOUT: %.loc22_29.20: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc22_29.21: ref %i32 = array_index %a.var, %.loc22_29.20 +// CHECK:STDOUT: %.loc22_29.22: init %i32 = initialize_from %.loc22_29.19 to %.loc22_29.21 [template = constants.%.36] +// CHECK:STDOUT: %.loc22_29.23: init %.3 = array_init (%.loc22_29.8, %.loc22_29.15, %.loc22_29.22) to %a.var [template = constants.%array] +// CHECK:STDOUT: %.loc22_30: init %.3 = converted %.loc22_29.1, %.loc22_29.23 [template = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc22_30 -// CHECK:STDOUT: %a.ref: ref %.2 = name_ref a, %a -// CHECK:STDOUT: %.loc26_5.1: Core.IntLiteral = int_value 0 [template = constants.%.38] -// CHECK:STDOUT: %.loc26_5.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc26_5.3: = bound_method %.loc26_5.1, %.loc26_5.2 [template = constants.%.39] -// CHECK:STDOUT: %int.convert_checked.loc26: init i32 = call %.loc26_5.3(%.loc26_5.1) [template = constants.%.6] -// CHECK:STDOUT: %.loc26_5.4: i32 = value_of_initializer %int.convert_checked.loc26 [template = constants.%.6] -// CHECK:STDOUT: %.loc26_5.5: i32 = converted %.loc26_5.1, %.loc26_5.4 [template = constants.%.6] -// CHECK:STDOUT: %.loc26_6: ref i32 = array_index %a.ref, %.loc26_5.5 -// CHECK:STDOUT: %b.ref: %.2 = name_ref b, %b -// CHECK:STDOUT: %.loc27_5.1: Core.IntLiteral = int_value 0 [template = constants.%.38] -// CHECK:STDOUT: %.loc27_5.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc27_5.3: = bound_method %.loc27_5.1, %.loc27_5.2 [template = constants.%.39] -// CHECK:STDOUT: %int.convert_checked.loc27: init i32 = call %.loc27_5.3(%.loc27_5.1) [template = constants.%.6] -// CHECK:STDOUT: %.loc27_5.4: i32 = value_of_initializer %int.convert_checked.loc27 [template = constants.%.6] -// CHECK:STDOUT: %.loc27_5.5: i32 = converted %.loc27_5.1, %.loc27_5.4 [template = constants.%.6] -// CHECK:STDOUT: %.loc27_6.1: ref %.2 = value_as_ref %b.ref -// CHECK:STDOUT: %.loc27_6.2: ref i32 = array_index %.loc27_6.1, %.loc27_5.5 -// CHECK:STDOUT: %.loc27_6.3: i32 = bind_value %.loc27_6.2 +// CHECK:STDOUT: %a.ref: ref %.3 = name_ref a, %a +// CHECK:STDOUT: %.loc26_5.1: Core.IntLiteral = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc26_5.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc26_5.3: = bound_method %.loc26_5.1, %.loc26_5.2 [template = constants.%.38] +// CHECK:STDOUT: %.loc26_5.4: = specific_function %.loc26_5.3, @Convert.2(constants.%.1) [template = constants.%.39] +// CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %.loc26_5.4(%.loc26_5.1) [template = constants.%.40] +// CHECK:STDOUT: %.loc26_5.5: %i32 = value_of_initializer %int.convert_checked.loc26 [template = constants.%.40] +// CHECK:STDOUT: %.loc26_5.6: %i32 = converted %.loc26_5.1, %.loc26_5.5 [template = constants.%.40] +// CHECK:STDOUT: %.loc26_6: ref %i32 = array_index %a.ref, %.loc26_5.6 +// CHECK:STDOUT: %b.ref: %.3 = name_ref b, %b +// CHECK:STDOUT: %.loc27_5.1: Core.IntLiteral = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc27_5.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc27_5.3: = bound_method %.loc27_5.1, %.loc27_5.2 [template = constants.%.38] +// CHECK:STDOUT: %.loc27_5.4: = specific_function %.loc27_5.3, @Convert.2(constants.%.1) [template = constants.%.39] +// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %.loc27_5.4(%.loc27_5.1) [template = constants.%.40] +// CHECK:STDOUT: %.loc27_5.5: %i32 = value_of_initializer %int.convert_checked.loc27 [template = constants.%.40] +// CHECK:STDOUT: %.loc27_5.6: %i32 = converted %.loc27_5.1, %.loc27_5.5 [template = constants.%.40] +// CHECK:STDOUT: %.loc27_6.1: ref %.3 = value_as_ref %b.ref +// CHECK:STDOUT: %.loc27_6.2: ref %i32 = array_index %.loc27_6.1, %.loc27_5.6 +// CHECK:STDOUT: %.loc27_6.3: %i32 = bind_value %.loc27_6.2 // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %.loc28_4.1: ref %.2 = temporary_storage -// CHECK:STDOUT: %F.call: init %.2 = call %F.ref() to %.loc28_4.1 -// CHECK:STDOUT: %.loc28_7.1: Core.IntLiteral = int_value 0 [template = constants.%.38] -// CHECK:STDOUT: %.loc28_4.2: ref %.2 = temporary %.loc28_4.1, %F.call -// CHECK:STDOUT: %.loc28_7.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc28_7.3: = bound_method %.loc28_7.1, %.loc28_7.2 [template = constants.%.39] -// CHECK:STDOUT: %int.convert_checked.loc28: init i32 = call %.loc28_7.3(%.loc28_7.1) [template = constants.%.6] -// CHECK:STDOUT: %.loc28_7.4: i32 = value_of_initializer %int.convert_checked.loc28 [template = constants.%.6] -// CHECK:STDOUT: %.loc28_7.5: i32 = converted %.loc28_7.1, %.loc28_7.4 [template = constants.%.6] -// CHECK:STDOUT: %.loc28_8.1: ref i32 = array_index %.loc28_4.2, %.loc28_7.5 -// CHECK:STDOUT: %.loc28_8.2: i32 = bind_value %.loc28_8.1 +// CHECK:STDOUT: %.loc28_4.1: ref %.3 = temporary_storage +// CHECK:STDOUT: %F.call: init %.3 = call %F.ref() to %.loc28_4.1 +// CHECK:STDOUT: %.loc28_7.1: Core.IntLiteral = int_value 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc28_4.2: ref %.3 = temporary %.loc28_4.1, %F.call +// CHECK:STDOUT: %.loc28_7.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc28_7.3: = bound_method %.loc28_7.1, %.loc28_7.2 [template = constants.%.38] +// CHECK:STDOUT: %.loc28_7.4: = specific_function %.loc28_7.3, @Convert.2(constants.%.1) [template = constants.%.39] +// CHECK:STDOUT: %int.convert_checked.loc28: init %i32 = call %.loc28_7.4(%.loc28_7.1) [template = constants.%.40] +// CHECK:STDOUT: %.loc28_7.5: %i32 = value_of_initializer %int.convert_checked.loc28 [template = constants.%.40] +// CHECK:STDOUT: %.loc28_7.6: %i32 = converted %.loc28_7.1, %.loc28_7.5 [template = constants.%.40] +// CHECK:STDOUT: %.loc28_8.1: ref %i32 = array_index %.loc28_4.2, %.loc28_7.6 +// CHECK:STDOUT: %.loc28_8.2: %i32 = bind_value %.loc28_8.1 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index 78dcb75e2c0e..c74fb94c56f0 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -24,30 +24,35 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: --- fail_array_large_index.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %.5: i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 12 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.31) [template] -// CHECK:STDOUT: %.32: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 1 [template] -// CHECK:STDOUT: %.34: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %.35: = bound_method %.34, %Convert.15 [template] -// CHECK:STDOUT: %.36: i32 = int_value 2147483647 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 12 [template] +// CHECK:STDOUT: %array: %.3 = tuple_value (%.29) [template] +// CHECK:STDOUT: %.30: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.33: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %.34: = bound_method %.33, %Convert.14 [template] +// CHECK:STDOUT: %.35: = specific_function %.34, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.36: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -62,58 +67,64 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_8.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] -// CHECK:STDOUT: %.loc17_8.2: type = converted %int.make_type_32.loc17, %.loc17_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_8.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] -// CHECK:STDOUT: %.loc22_8.2: type = converted %int.make_type_32.loc22, %.loc22_8.1 [template = i32] -// CHECK:STDOUT: %c.var: ref i32 = var c -// CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var +// CHECK:STDOUT: %.loc11_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_9.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.3: type = converted %int.make_type_signed.loc11, %.loc11_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, %i32 [template = constants.%.3] +// CHECK:STDOUT: %a.var: ref %.3 = var a +// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var +// CHECK:STDOUT: %.loc17_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%.loc17_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_8.2: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_8.3: type = converted %int.make_type_signed.loc17, %.loc17_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc22_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%.loc22_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc22_8.2: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] +// CHECK:STDOUT: %.loc22_8.3: type = converted %int.make_type_signed.loc22, %.loc22_8.2 [template = constants.%i32] +// CHECK:STDOUT: %c.var: ref %i32 = var c +// CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 12 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 12 [template = constants.%.5] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%.loc11_20) -// CHECK:STDOUT: %.loc11_23.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_23.3: = bound_method %.loc11_20, %.loc11_23.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11: init i32 = call %.loc11_23.3(%.loc11_20) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_23.4: init i32 = converted %.loc11_20, %int.convert_checked.loc11 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_23.5: i32 = int_value 0 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_23.6: ref i32 = array_index file.%a.var, %.loc11_23.5 -// CHECK:STDOUT: %.loc11_23.7: init i32 = initialize_from %.loc11_23.4 to %.loc11_23.6 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_23.8: init %.2 = array_init (%.loc11_23.7) to file.%a.var [template = constants.%array] -// CHECK:STDOUT: %.loc11_24: init %.2 = converted %.loc11_23.1, %.loc11_23.8 [template = constants.%array] +// CHECK:STDOUT: %.loc11_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_23.3: = bound_method %.loc11_20, %.loc11_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_23.4: = specific_function %.loc11_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %.loc11_23.4(%.loc11_20) [template = constants.%.29] +// CHECK:STDOUT: %.loc11_23.5: init %i32 = converted %.loc11_20, %int.convert_checked.loc11 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_23.6: Core.IntLiteral = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_23.7: ref %i32 = array_index file.%a.var, %.loc11_23.6 +// CHECK:STDOUT: %.loc11_23.8: init %i32 = initialize_from %.loc11_23.5 to %.loc11_23.7 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_23.9: init %.3 = array_init (%.loc11_23.8) to file.%a.var [template = constants.%array] +// CHECK:STDOUT: %.loc11_24: init %.3 = converted %.loc11_23.1, %.loc11_23.9 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_24 -// CHECK:STDOUT: %a.ref.loc17: ref %.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc17_16.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc17_16.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc17_16.3: = bound_method %.loc17_16.1, %.loc17_16.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc17: init i32 = call %.loc17_16.3(%.loc17_16.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc17_16.4: i32 = value_of_initializer %int.convert_checked.loc17 [template = constants.%.33] -// CHECK:STDOUT: %.loc17_16.5: i32 = converted %.loc17_16.1, %.loc17_16.4 [template = constants.%.33] -// CHECK:STDOUT: %.loc17_17.1: ref i32 = array_index %a.ref.loc17, %.loc17_16.5 [template = ] -// CHECK:STDOUT: %.loc17_17.2: i32 = bind_value %.loc17_17.1 +// CHECK:STDOUT: %a.ref.loc17: ref %.3 = name_ref a, file.%a +// CHECK:STDOUT: %.loc17_16.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc17_16.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc17_16.3: = bound_method %.loc17_16.1, %.loc17_16.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc17_16.4: = specific_function %.loc17_16.3, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %.loc17_16.4(%.loc17_16.1) [template = constants.%.32] +// CHECK:STDOUT: %.loc17_16.5: %i32 = value_of_initializer %int.convert_checked.loc17 [template = constants.%.32] +// CHECK:STDOUT: %.loc17_16.6: %i32 = converted %.loc17_16.1, %.loc17_16.5 [template = constants.%.32] +// CHECK:STDOUT: %.loc17_17.1: ref %i32 = array_index %a.ref.loc17, %.loc17_16.6 [template = ] +// CHECK:STDOUT: %.loc17_17.2: %i32 = bind_value %.loc17_17.1 // CHECK:STDOUT: assign file.%b.var, %.loc17_17.2 -// CHECK:STDOUT: %a.ref.loc22: ref %.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc22_16.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.34] -// CHECK:STDOUT: %.loc22_16.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc22_16.3: = bound_method %.loc22_16.1, %.loc22_16.2 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc22: init i32 = call %.loc22_16.3(%.loc22_16.1) [template = constants.%.36] -// CHECK:STDOUT: %.loc22_16.4: i32 = value_of_initializer %int.convert_checked.loc22 [template = constants.%.36] -// CHECK:STDOUT: %.loc22_16.5: i32 = converted %.loc22_16.1, %.loc22_16.4 [template = constants.%.36] -// CHECK:STDOUT: %.loc22_27.1: ref i32 = array_index %a.ref.loc22, %.loc22_16.5 [template = ] -// CHECK:STDOUT: %.loc22_27.2: i32 = bind_value %.loc22_27.1 +// CHECK:STDOUT: %a.ref.loc22: ref %.3 = name_ref a, file.%a +// CHECK:STDOUT: %.loc22_16.1: Core.IntLiteral = int_value 2147483647 [template = constants.%.33] +// CHECK:STDOUT: %.loc22_16.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc22_16.3: = bound_method %.loc22_16.1, %.loc22_16.2 [template = constants.%.34] +// CHECK:STDOUT: %.loc22_16.4: = specific_function %.loc22_16.3, @Convert.2(constants.%.1) [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc22: init %i32 = call %.loc22_16.4(%.loc22_16.1) [template = constants.%.36] +// CHECK:STDOUT: %.loc22_16.5: %i32 = value_of_initializer %int.convert_checked.loc22 [template = constants.%.36] +// CHECK:STDOUT: %.loc22_16.6: %i32 = converted %.loc22_16.1, %.loc22_16.5 [template = constants.%.36] +// CHECK:STDOUT: %.loc22_27.1: ref %i32 = array_index %a.ref.loc22, %.loc22_16.6 [template = ] +// CHECK:STDOUT: %.loc22_27.2: %i32 = bind_value %.loc22_27.1 // CHECK:STDOUT: assign file.%c.var, %.loc22_27.2 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon index f06db8d1dcd0..2cd16060a7da 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -20,26 +20,29 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: --- fail_array_non_int_indexing.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %.5: i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 12 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.31) [template] -// CHECK:STDOUT: %.32: f64 = float_literal 2.6000000000000001 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 12 [template] +// CHECK:STDOUT: %array: %.3 = tuple_value (%.29) [template] +// CHECK:STDOUT: %.30: f64 = float_literal 2.6000000000000001 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -53,39 +56,42 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_8.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] -// CHECK:STDOUT: %.loc18_8.2: type = converted %int.make_type_32.loc18, %.loc18_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc11_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_9.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.3: type = converted %int.make_type_signed.loc11, %.loc11_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, %i32 [template = constants.%.3] +// CHECK:STDOUT: %a.var: ref %.3 = var a +// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var +// CHECK:STDOUT: %.loc18_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%.loc18_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_8.2: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_8.3: type = converted %int.make_type_signed.loc18, %.loc18_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 12 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 12 [template = constants.%.5] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%.loc11_20) -// CHECK:STDOUT: %.loc11_23.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_23.3: = bound_method %.loc11_20, %.loc11_23.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc11_23.3(%.loc11_20) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_23.4: init i32 = converted %.loc11_20, %int.convert_checked [template = constants.%.31] -// CHECK:STDOUT: %.loc11_23.5: i32 = int_value 0 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_23.6: ref i32 = array_index file.%a.var, %.loc11_23.5 -// CHECK:STDOUT: %.loc11_23.7: init i32 = initialize_from %.loc11_23.4 to %.loc11_23.6 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_23.8: init %.2 = array_init (%.loc11_23.7) to file.%a.var [template = constants.%array] -// CHECK:STDOUT: %.loc11_24: init %.2 = converted %.loc11_23.1, %.loc11_23.8 [template = constants.%array] +// CHECK:STDOUT: %.loc11_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_23.3: = bound_method %.loc11_20, %.loc11_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_23.4: = specific_function %.loc11_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc11_23.4(%.loc11_20) [template = constants.%.29] +// CHECK:STDOUT: %.loc11_23.5: init %i32 = converted %.loc11_20, %int.convert_checked [template = constants.%.29] +// CHECK:STDOUT: %.loc11_23.6: Core.IntLiteral = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_23.7: ref %i32 = array_index file.%a.var, %.loc11_23.6 +// CHECK:STDOUT: %.loc11_23.8: init %i32 = initialize_from %.loc11_23.5 to %.loc11_23.7 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_23.9: init %.3 = array_init (%.loc11_23.8) to file.%a.var [template = constants.%array] +// CHECK:STDOUT: %.loc11_24: init %.3 = converted %.loc11_23.1, %.loc11_23.9 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_24 -// CHECK:STDOUT: %a.ref: ref %.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc18_16.1: f64 = float_literal 2.6000000000000001 [template = constants.%.32] -// CHECK:STDOUT: %.loc18_16.2: i32 = converted %.loc18_16.1, [template = ] -// CHECK:STDOUT: %.loc18_19.1: ref i32 = array_index %a.ref, [template = ] -// CHECK:STDOUT: %.loc18_19.2: i32 = bind_value %.loc18_19.1 +// CHECK:STDOUT: %a.ref: ref %.3 = name_ref a, file.%a +// CHECK:STDOUT: %.loc18_16.1: f64 = float_literal 2.6000000000000001 [template = constants.%.30] +// CHECK:STDOUT: %.loc18_16.2: %i32 = converted %.loc18_16.1, [template = ] +// CHECK:STDOUT: %.loc18_19.1: ref %i32 = array_index %a.ref, [template = ] +// CHECK:STDOUT: %.loc18_19.2: %i32 = bind_value %.loc18_19.1 // CHECK:STDOUT: assign file.%b.var, %.loc18_19.2 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon index e54dd8f0b3ab..d6b76e601b6e 100644 --- a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon +++ b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon @@ -17,27 +17,31 @@ var b: i32 = a[1]; // CHECK:STDOUT: --- fail_array_out_of_bound_access.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %.5: i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 12 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.31) [template] -// CHECK:STDOUT: %.32: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 1 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 12 [template] +// CHECK:STDOUT: %array: %.3 = tuple_value (%.29) [template] +// CHECK:STDOUT: %.30: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -51,43 +55,47 @@ var b: i32 = a[1]; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc11_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_9.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.3: type = converted %int.make_type_signed.loc11, %.loc11_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, %i32 [template = constants.%.3] +// CHECK:STDOUT: %a.var: ref %.3 = var a +// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed.loc15, %.loc15_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 12 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 12 [template = constants.%.5] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%.loc11_20) -// CHECK:STDOUT: %.loc11_23.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_23.3: = bound_method %.loc11_20, %.loc11_23.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11: init i32 = call %.loc11_23.3(%.loc11_20) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_23.4: init i32 = converted %.loc11_20, %int.convert_checked.loc11 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_23.5: i32 = int_value 0 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_23.6: ref i32 = array_index file.%a.var, %.loc11_23.5 -// CHECK:STDOUT: %.loc11_23.7: init i32 = initialize_from %.loc11_23.4 to %.loc11_23.6 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_23.8: init %.2 = array_init (%.loc11_23.7) to file.%a.var [template = constants.%array] -// CHECK:STDOUT: %.loc11_24: init %.2 = converted %.loc11_23.1, %.loc11_23.8 [template = constants.%array] +// CHECK:STDOUT: %.loc11_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_23.3: = bound_method %.loc11_20, %.loc11_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_23.4: = specific_function %.loc11_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %.loc11_23.4(%.loc11_20) [template = constants.%.29] +// CHECK:STDOUT: %.loc11_23.5: init %i32 = converted %.loc11_20, %int.convert_checked.loc11 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_23.6: Core.IntLiteral = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_23.7: ref %i32 = array_index file.%a.var, %.loc11_23.6 +// CHECK:STDOUT: %.loc11_23.8: init %i32 = initialize_from %.loc11_23.5 to %.loc11_23.7 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_23.9: init %.3 = array_init (%.loc11_23.8) to file.%a.var [template = constants.%array] +// CHECK:STDOUT: %.loc11_24: init %.3 = converted %.loc11_23.1, %.loc11_23.9 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_24 -// CHECK:STDOUT: %a.ref: ref %.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc15_16.1: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc15_16.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_16.3: = bound_method %.loc15_16.1, %.loc15_16.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc15: init i32 = call %.loc15_16.3(%.loc15_16.1) [template = constants.%.33] -// CHECK:STDOUT: %.loc15_16.4: i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%.33] -// CHECK:STDOUT: %.loc15_16.5: i32 = converted %.loc15_16.1, %.loc15_16.4 [template = constants.%.33] -// CHECK:STDOUT: %.loc15_17.1: ref i32 = array_index %a.ref, %.loc15_16.5 [template = ] -// CHECK:STDOUT: %.loc15_17.2: i32 = bind_value %.loc15_17.1 +// CHECK:STDOUT: %a.ref: ref %.3 = name_ref a, file.%a +// CHECK:STDOUT: %.loc15_16.1: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_16.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_16.3: = bound_method %.loc15_16.1, %.loc15_16.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc15_16.4: = specific_function %.loc15_16.3, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %.loc15_16.4(%.loc15_16.1) [template = constants.%.32] +// CHECK:STDOUT: %.loc15_16.5: %i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%.32] +// CHECK:STDOUT: %.loc15_16.6: %i32 = converted %.loc15_16.1, %.loc15_16.5 [template = constants.%.32] +// CHECK:STDOUT: %.loc15_17.1: ref %i32 = array_index %a.ref, %.loc15_16.6 [template = ] +// CHECK:STDOUT: %.loc15_17.2: %i32 = bind_value %.loc15_17.1 // CHECK:STDOUT: assign file.%b.var, %.loc15_17.2 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index 165f05a02153..860fe4e9c5ad 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -39,30 +39,34 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: --- fail_expr_category.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type i32 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 0 [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 4 [template] +// CHECK:STDOUT: %.5: type = ptr_type %i32 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.31: = bound_method %.30, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -77,107 +81,117 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.3 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.3 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_32, %.loc11_12.1 [template = i32] -// CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17, i32 [template = constants.%.2] -// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param +// CHECK:STDOUT: %.loc11_12.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_12.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_12.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_12.3: type = converted %int.make_type_signed, %.loc11_12.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17, %i32 [template = constants.%.3] +// CHECK:STDOUT: %return.param: ref %.3 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %.3 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %b.patt: %.2 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %.2 = value_param_pattern %b.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %.3 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %.3 = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_15: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] -// CHECK:STDOUT: %.loc13_16: type = array_type %.loc13_15, i32 [template = constants.%.2] -// CHECK:STDOUT: %b.param: %.2 = value_param runtime_param0 -// CHECK:STDOUT: %b: %.2 = bind_name b, %b.param +// CHECK:STDOUT: %.loc13_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_15: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc13_10.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.3: type = converted %int.make_type_signed.loc13, %.loc13_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_16: type = array_type %.loc13_15, %i32 [template = constants.%.3] +// CHECK:STDOUT: %b.param: %.3 = value_param runtime_param0 +// CHECK:STDOUT: %b: %.3 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> %.2; +// CHECK:STDOUT: fn @F() -> %.3; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%b.param_patt: %.2) { +// CHECK:STDOUT: fn @G(%b.param_patt: %.3) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_14.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] -// CHECK:STDOUT: %.loc19_14.2: type = converted %int.make_type_32.loc19, %.loc19_14.1 [template = i32] -// CHECK:STDOUT: %.loc19_14.3: type = ptr_type i32 [template = constants.%.4] -// CHECK:STDOUT: %pb.var: ref %.4 = var pb -// CHECK:STDOUT: %pb: ref %.4 = bind_name pb, %pb.var -// CHECK:STDOUT: %b.ref.loc19: %.2 = name_ref b, %b -// CHECK:STDOUT: %.loc19_21.1: Core.IntLiteral = int_value 0 [template = constants.%.5] -// CHECK:STDOUT: %.loc19_21.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc19_21.3: = bound_method %.loc19_21.1, %.loc19_21.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc19: init i32 = call %.loc19_21.3(%.loc19_21.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc19_21.4: i32 = value_of_initializer %int.convert_checked.loc19 [template = constants.%.31] -// CHECK:STDOUT: %.loc19_21.5: i32 = converted %.loc19_21.1, %.loc19_21.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc19_22.1: ref %.2 = value_as_ref %b.ref.loc19 -// CHECK:STDOUT: %.loc19_22.2: ref i32 = array_index %.loc19_22.1, %.loc19_21.5 -// CHECK:STDOUT: %.loc19_22.3: i32 = bind_value %.loc19_22.2 -// CHECK:STDOUT: %.loc19_18: %.4 = addr_of [template = ] +// CHECK:STDOUT: %.loc19_11: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19: init type = call constants.%Int(%.loc19_11) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_14.1: type = value_of_initializer %int.make_type_signed.loc19 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_14.2: type = converted %int.make_type_signed.loc19, %.loc19_14.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_14.3: type = ptr_type %i32 [template = constants.%.5] +// CHECK:STDOUT: %pb.var: ref %.5 = var pb +// CHECK:STDOUT: %pb: ref %.5 = bind_name pb, %pb.var +// CHECK:STDOUT: %b.ref.loc19: %.3 = name_ref b, %b +// CHECK:STDOUT: %.loc19_21.1: Core.IntLiteral = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc19_21.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc19_21.3: = bound_method %.loc19_21.1, %.loc19_21.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc19_21.4: = specific_function %.loc19_21.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %.loc19_21.4(%.loc19_21.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc19_21.5: %i32 = value_of_initializer %int.convert_checked.loc19 [template = constants.%.29] +// CHECK:STDOUT: %.loc19_21.6: %i32 = converted %.loc19_21.1, %.loc19_21.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc19_22.1: ref %.3 = value_as_ref %b.ref.loc19 +// CHECK:STDOUT: %.loc19_22.2: ref %i32 = array_index %.loc19_22.1, %.loc19_21.6 +// CHECK:STDOUT: %.loc19_22.3: %i32 = bind_value %.loc19_22.2 +// CHECK:STDOUT: %.loc19_18: %.5 = addr_of [template = ] // CHECK:STDOUT: assign %pb.var, %.loc19_18 -// CHECK:STDOUT: %b.ref.loc24: %.2 = name_ref b, %b -// CHECK:STDOUT: %.loc24_5.1: Core.IntLiteral = int_value 0 [template = constants.%.5] -// CHECK:STDOUT: %.loc24_5.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc24_5.3: = bound_method %.loc24_5.1, %.loc24_5.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc24_5: init i32 = call %.loc24_5.3(%.loc24_5.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc24_5.4: i32 = value_of_initializer %int.convert_checked.loc24_5 [template = constants.%.31] -// CHECK:STDOUT: %.loc24_5.5: i32 = converted %.loc24_5.1, %.loc24_5.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc24_6.1: ref %.2 = value_as_ref %b.ref.loc24 -// CHECK:STDOUT: %.loc24_6.2: ref i32 = array_index %.loc24_6.1, %.loc24_5.5 -// CHECK:STDOUT: %.loc24_6.3: i32 = bind_value %.loc24_6.2 -// CHECK:STDOUT: %.loc24_10: Core.IntLiteral = int_value 4 [template = constants.%.32] -// CHECK:STDOUT: %.loc24_8.1: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc24_8.2: = bound_method %.loc24_10, %.loc24_8.1 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc24_8: init i32 = call %.loc24_8.2(%.loc24_10) [template = constants.%.34] -// CHECK:STDOUT: %.loc24_8.3: init i32 = converted %.loc24_10, %int.convert_checked.loc24_8 [template = constants.%.34] -// CHECK:STDOUT: assign %.loc24_6.3, %.loc24_8.3 -// CHECK:STDOUT: %int.make_type_32.loc32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc32_14.1: type = value_of_initializer %int.make_type_32.loc32 [template = i32] -// CHECK:STDOUT: %.loc32_14.2: type = converted %int.make_type_32.loc32, %.loc32_14.1 [template = i32] -// CHECK:STDOUT: %.loc32_14.3: type = ptr_type i32 [template = constants.%.4] -// CHECK:STDOUT: %pf.var: ref %.4 = var pf -// CHECK:STDOUT: %pf: ref %.4 = bind_name pf, %pf.var +// CHECK:STDOUT: %b.ref.loc24: %.3 = name_ref b, %b +// CHECK:STDOUT: %.loc24_5.1: Core.IntLiteral = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc24_5.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc24_5.3: = bound_method %.loc24_5.1, %.loc24_5.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc24_5.4: = specific_function %.loc24_5.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc24_5: init %i32 = call %.loc24_5.4(%.loc24_5.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc24_5.5: %i32 = value_of_initializer %int.convert_checked.loc24_5 [template = constants.%.29] +// CHECK:STDOUT: %.loc24_5.6: %i32 = converted %.loc24_5.1, %.loc24_5.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc24_6.1: ref %.3 = value_as_ref %b.ref.loc24 +// CHECK:STDOUT: %.loc24_6.2: ref %i32 = array_index %.loc24_6.1, %.loc24_5.6 +// CHECK:STDOUT: %.loc24_6.3: %i32 = bind_value %.loc24_6.2 +// CHECK:STDOUT: %.loc24_10: Core.IntLiteral = int_value 4 [template = constants.%.30] +// CHECK:STDOUT: %.loc24_8.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc24_8.2: = bound_method %.loc24_10, %.loc24_8.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc24_8.3: = specific_function %.loc24_8.2, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc24_8: init %i32 = call %.loc24_8.3(%.loc24_10) [template = constants.%.33] +// CHECK:STDOUT: %.loc24_8.4: init %i32 = converted %.loc24_10, %int.convert_checked.loc24_8 [template = constants.%.33] +// CHECK:STDOUT: assign %.loc24_6.3, %.loc24_8.4 +// CHECK:STDOUT: %.loc32_11: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc32: init type = call constants.%Int(%.loc32_11) [template = constants.%i32] +// CHECK:STDOUT: %.loc32_14.1: type = value_of_initializer %int.make_type_signed.loc32 [template = constants.%i32] +// CHECK:STDOUT: %.loc32_14.2: type = converted %int.make_type_signed.loc32, %.loc32_14.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc32_14.3: type = ptr_type %i32 [template = constants.%.5] +// CHECK:STDOUT: %pf.var: ref %.5 = var pf +// CHECK:STDOUT: %pf: ref %.5 = bind_name pf, %pf.var // CHECK:STDOUT: %F.ref.loc32: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %.loc32_20.1: ref %.2 = temporary_storage -// CHECK:STDOUT: %F.call.loc32: init %.2 = call %F.ref.loc32() to %.loc32_20.1 -// CHECK:STDOUT: %.loc32_23.1: Core.IntLiteral = int_value 0 [template = constants.%.5] -// CHECK:STDOUT: %.loc32_20.2: ref %.2 = temporary %.loc32_20.1, %F.call.loc32 -// CHECK:STDOUT: %.loc32_23.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc32_23.3: = bound_method %.loc32_23.1, %.loc32_23.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc32: init i32 = call %.loc32_23.3(%.loc32_23.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc32_23.4: i32 = value_of_initializer %int.convert_checked.loc32 [template = constants.%.31] -// CHECK:STDOUT: %.loc32_23.5: i32 = converted %.loc32_23.1, %.loc32_23.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc32_24.1: ref i32 = array_index %.loc32_20.2, %.loc32_23.5 -// CHECK:STDOUT: %.loc32_24.2: i32 = bind_value %.loc32_24.1 -// CHECK:STDOUT: %.loc32_18: %.4 = addr_of [template = ] +// CHECK:STDOUT: %.loc32_20.1: ref %.3 = temporary_storage +// CHECK:STDOUT: %F.call.loc32: init %.3 = call %F.ref.loc32() to %.loc32_20.1 +// CHECK:STDOUT: %.loc32_23.1: Core.IntLiteral = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc32_20.2: ref %.3 = temporary %.loc32_20.1, %F.call.loc32 +// CHECK:STDOUT: %.loc32_23.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc32_23.3: = bound_method %.loc32_23.1, %.loc32_23.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc32_23.4: = specific_function %.loc32_23.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc32: init %i32 = call %.loc32_23.4(%.loc32_23.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc32_23.5: %i32 = value_of_initializer %int.convert_checked.loc32 [template = constants.%.29] +// CHECK:STDOUT: %.loc32_23.6: %i32 = converted %.loc32_23.1, %.loc32_23.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc32_24.1: ref %i32 = array_index %.loc32_20.2, %.loc32_23.6 +// CHECK:STDOUT: %.loc32_24.2: %i32 = bind_value %.loc32_24.1 +// CHECK:STDOUT: %.loc32_18: %.5 = addr_of [template = ] // CHECK:STDOUT: assign %pf.var, %.loc32_18 // CHECK:STDOUT: %F.ref.loc36: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %.loc36_4.1: ref %.2 = temporary_storage -// CHECK:STDOUT: %F.call.loc36: init %.2 = call %F.ref.loc36() to %.loc36_4.1 -// CHECK:STDOUT: %.loc36_7.1: Core.IntLiteral = int_value 0 [template = constants.%.5] -// CHECK:STDOUT: %.loc36_4.2: ref %.2 = temporary %.loc36_4.1, %F.call.loc36 -// CHECK:STDOUT: %.loc36_7.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc36_7.3: = bound_method %.loc36_7.1, %.loc36_7.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc36_7: init i32 = call %.loc36_7.3(%.loc36_7.1) [template = constants.%.31] -// CHECK:STDOUT: %.loc36_7.4: i32 = value_of_initializer %int.convert_checked.loc36_7 [template = constants.%.31] -// CHECK:STDOUT: %.loc36_7.5: i32 = converted %.loc36_7.1, %.loc36_7.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc36_8.1: ref i32 = array_index %.loc36_4.2, %.loc36_7.5 -// CHECK:STDOUT: %.loc36_8.2: i32 = bind_value %.loc36_8.1 -// CHECK:STDOUT: %.loc36_12: Core.IntLiteral = int_value 4 [template = constants.%.32] -// CHECK:STDOUT: %.loc36_10.1: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc36_10.2: = bound_method %.loc36_12, %.loc36_10.1 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc36_10: init i32 = call %.loc36_10.2(%.loc36_12) [template = constants.%.34] -// CHECK:STDOUT: %.loc36_10.3: init i32 = converted %.loc36_12, %int.convert_checked.loc36_10 [template = constants.%.34] -// CHECK:STDOUT: assign %.loc36_8.2, %.loc36_10.3 +// CHECK:STDOUT: %.loc36_4.1: ref %.3 = temporary_storage +// CHECK:STDOUT: %F.call.loc36: init %.3 = call %F.ref.loc36() to %.loc36_4.1 +// CHECK:STDOUT: %.loc36_7.1: Core.IntLiteral = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc36_4.2: ref %.3 = temporary %.loc36_4.1, %F.call.loc36 +// CHECK:STDOUT: %.loc36_7.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc36_7.3: = bound_method %.loc36_7.1, %.loc36_7.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc36_7.4: = specific_function %.loc36_7.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc36_7: init %i32 = call %.loc36_7.4(%.loc36_7.1) [template = constants.%.29] +// CHECK:STDOUT: %.loc36_7.5: %i32 = value_of_initializer %int.convert_checked.loc36_7 [template = constants.%.29] +// CHECK:STDOUT: %.loc36_7.6: %i32 = converted %.loc36_7.1, %.loc36_7.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc36_8.1: ref %i32 = array_index %.loc36_4.2, %.loc36_7.6 +// CHECK:STDOUT: %.loc36_8.2: %i32 = bind_value %.loc36_8.1 +// CHECK:STDOUT: %.loc36_12: Core.IntLiteral = int_value 4 [template = constants.%.30] +// CHECK:STDOUT: %.loc36_10.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc36_10.2: = bound_method %.loc36_12, %.loc36_10.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc36_10.3: = specific_function %.loc36_10.2, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc36_10: init %i32 = call %.loc36_10.3(%.loc36_12) [template = constants.%.33] +// CHECK:STDOUT: %.loc36_10.4: init %i32 = converted %.loc36_12, %int.convert_checked.loc36_10 [template = constants.%.33] +// CHECK:STDOUT: assign %.loc36_8.2, %.loc36_10.4 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_invalid_base.carbon b/toolchain/check/testdata/index/fail_invalid_base.carbon index 51ea0400f509..7391d276240f 100644 --- a/toolchain/check/testdata/index/fail_invalid_base.carbon +++ b/toolchain/check/testdata/index/fail_invalid_base.carbon @@ -36,21 +36,23 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: --- fail_invalid_base.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.4: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %struct: %.4 = struct_value (%.2, %.3) [template] -// CHECK:STDOUT: %.8: type = struct_type {.a: i32, .b: i32} [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.5: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %struct: %.5 = struct_value (%.3, %.4) [template] +// CHECK:STDOUT: %.9: type = struct_type {.a: %i32, .b: %i32} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .IndexWith = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -69,27 +71,31 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %N: = namespace [template] {} -// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_8.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] -// CHECK:STDOUT: %.loc16_8.2: type = converted %int.make_type_32.loc16, %.loc16_8.1 [template = i32] -// CHECK:STDOUT: %a.var: ref i32 = var a -// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var +// CHECK:STDOUT: %.loc16_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%.loc16_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_8.2: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_8.3: type = converted %int.make_type_signed.loc16, %.loc16_8.2 [template = constants.%i32] +// CHECK:STDOUT: %a.var: ref %i32 = var a +// CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} -// CHECK:STDOUT: %int.make_type_32.loc23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_8.1: type = value_of_initializer %int.make_type_32.loc23 [template = i32] -// CHECK:STDOUT: %.loc23_8.2: type = converted %int.make_type_32.loc23, %.loc23_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %int.make_type_32.loc29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc29_8.1: type = value_of_initializer %int.make_type_32.loc29 [template = i32] -// CHECK:STDOUT: %.loc29_8.2: type = converted %int.make_type_32.loc29, %.loc29_8.1 [template = i32] -// CHECK:STDOUT: %c.var: ref i32 = var c -// CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var -// CHECK:STDOUT: %int.make_type_32.loc34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc34_8.1: type = value_of_initializer %int.make_type_32.loc34 [template = i32] -// CHECK:STDOUT: %.loc34_8.2: type = converted %int.make_type_32.loc34, %.loc34_8.1 [template = i32] -// CHECK:STDOUT: %d.var: ref i32 = var d -// CHECK:STDOUT: %d: ref i32 = bind_name d, %d.var +// CHECK:STDOUT: %.loc23_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc23: init type = call constants.%Int(%.loc23_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_8.2: type = value_of_initializer %int.make_type_signed.loc23 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_8.3: type = converted %int.make_type_signed.loc23, %.loc23_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc29_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc29: init type = call constants.%Int(%.loc29_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc29_8.2: type = value_of_initializer %int.make_type_signed.loc29 [template = constants.%i32] +// CHECK:STDOUT: %.loc29_8.3: type = converted %int.make_type_signed.loc29, %.loc29_8.2 [template = constants.%i32] +// CHECK:STDOUT: %c.var: ref %i32 = var c +// CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var +// CHECK:STDOUT: %.loc34_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc34: init type = call constants.%Int(%.loc34_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc34_8.2: type = value_of_initializer %int.make_type_signed.loc34 [template = constants.%i32] +// CHECK:STDOUT: %.loc34_8.3: type = converted %int.make_type_signed.loc34, %.loc34_8.2 [template = constants.%i32] +// CHECK:STDOUT: %d.var: ref %i32 = var d +// CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); @@ -97,26 +103,28 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref: = name_ref N, file.%N [template = file.%N] -// CHECK:STDOUT: %.loc16: Core.IntLiteral = int_value 0 [template = constants.%.1] +// CHECK:STDOUT: %.loc16: Core.IntLiteral = int_value 0 [template = constants.%.2] // CHECK:STDOUT: assign file.%a.var, // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %.loc23: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc23: Core.IntLiteral = int_value 1 [template = constants.%.3] // CHECK:STDOUT: assign file.%b.var, -// CHECK:STDOUT: %.loc29_20: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc29_28: Core.IntLiteral = int_value 2 [template = constants.%.3] -// CHECK:STDOUT: %.loc29_29.1: %.4 = struct_literal (%.loc29_20, %.loc29_28) -// CHECK:STDOUT: %.loc29_31: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %struct: %.4 = struct_value (%.loc29_20, %.loc29_28) [template = constants.%struct] -// CHECK:STDOUT: %.loc29_29.2: %.4 = converted %.loc29_29.1, %struct [template = constants.%struct] +// CHECK:STDOUT: %.loc29_20: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc29_28: Core.IntLiteral = int_value 2 [template = constants.%.4] +// CHECK:STDOUT: %.loc29_29.1: %.5 = struct_literal (%.loc29_20, %.loc29_28) +// CHECK:STDOUT: %.loc29_31: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %struct: %.5 = struct_value (%.loc29_20, %.loc29_28) [template = constants.%struct] +// CHECK:STDOUT: %.loc29_29.2: %.5 = converted %.loc29_29.1, %struct [template = constants.%struct] // CHECK:STDOUT: assign file.%c.var, -// CHECK:STDOUT: %int.make_type_32.loc34_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc34_19.1: type = value_of_initializer %int.make_type_32.loc34_19 [template = i32] -// CHECK:STDOUT: %.loc34_19.2: type = converted %int.make_type_32.loc34_19, %.loc34_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc34_28: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc34_28.1: type = value_of_initializer %int.make_type_32.loc34_28 [template = i32] -// CHECK:STDOUT: %.loc34_28.2: type = converted %int.make_type_32.loc34_28, %.loc34_28.1 [template = i32] -// CHECK:STDOUT: %.loc34_31: type = struct_type {.a: i32, .b: i32} [template = constants.%.8] -// CHECK:STDOUT: %.loc34_33: Core.IntLiteral = int_value 0 [template = constants.%.1] +// CHECK:STDOUT: %.loc34_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc34_19: init type = call constants.%Int(%.loc34_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc34_19.2: type = value_of_initializer %int.make_type_signed.loc34_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc34_19.3: type = converted %int.make_type_signed.loc34_19, %.loc34_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc34_28.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc34_28: init type = call constants.%Int(%.loc34_28.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc34_28.2: type = value_of_initializer %int.make_type_signed.loc34_28 [template = constants.%i32] +// CHECK:STDOUT: %.loc34_28.3: type = converted %int.make_type_signed.loc34_28, %.loc34_28.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc34_31: type = struct_type {.a: %i32, .b: %i32} [template = constants.%.9] +// CHECK:STDOUT: %.loc34_33: Core.IntLiteral = int_value 0 [template = constants.%.2] // CHECK:STDOUT: assign file.%d.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/fail_name_not_found.carbon b/toolchain/check/testdata/index/fail_name_not_found.carbon index 2de0dd00316d..af23612b66c9 100644 --- a/toolchain/check/testdata/index/fail_name_not_found.carbon +++ b/toolchain/check/testdata/index/fail_name_not_found.carbon @@ -20,14 +20,16 @@ fn Main() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -44,13 +46,14 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_10.2: type = converted %int.make_type_32, %.loc15_10.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc15_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_10.3: type = converted %int.make_type_signed, %.loc15_10.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %a.ref: = name_ref a, [template = ] -// CHECK:STDOUT: %.loc15_18: Core.IntLiteral = int_value 0 [template = constants.%.1] +// CHECK:STDOUT: %.loc15_18: Core.IntLiteral = int_value 0 [template = constants.%.2] // CHECK:STDOUT: assign %b.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index 7f7b8476f0ee..b7b2f2a65f74 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -18,29 +18,32 @@ var d: i32 = c[-10]; // CHECK:STDOUT: --- fail_negative_indexing.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 42 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.3: type = array_type %.2, %i32 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 42 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.5: i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 42 [template] -// CHECK:STDOUT: %.32: i32 = int_value 1 [template] -// CHECK:STDOUT: %array: %.2 = tuple_value (%.31, %.31) [template] -// CHECK:STDOUT: %.33: Core.IntLiteral = int_value 10 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 42 [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %array: %.3 = tuple_value (%.29, %.29) [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Negate = %import_ref.51 +// CHECK:STDOUT: .Negate = %import_ref.38 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -53,46 +56,50 @@ var d: i32 = c[-10]; // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 2 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] -// CHECK:STDOUT: %c.var: ref %.2 = var c -// CHECK:STDOUT: %c: ref %.2 = bind_name c, %c.var -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] -// CHECK:STDOUT: %d.var: ref i32 = var d -// CHECK:STDOUT: %d: ref i32 = bind_name d, %d.var +// CHECK:STDOUT: %.loc11_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 2 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_9.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.3: type = converted %int.make_type_signed.loc11, %.loc11_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, %i32 [template = constants.%.3] +// CHECK:STDOUT: %c.var: ref %.3 = var c +// CHECK:STDOUT: %c: ref %.3 = bind_name c, %c.var +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed.loc15, %.loc15_8.2 [template = constants.%i32] +// CHECK:STDOUT: %d.var: ref %i32 = var d +// CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 42 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_24: Core.IntLiteral = int_value 42 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 42 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_24: Core.IntLiteral = int_value 42 [template = constants.%.5] // CHECK:STDOUT: %.loc11_26.1: %tuple.type = tuple_literal (%.loc11_20, %.loc11_24) -// CHECK:STDOUT: %.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_26.3: = bound_method %.loc11_20, %.loc11_26.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_26.1: init i32 = call %.loc11_26.3(%.loc11_20) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_26.4: init i32 = converted %.loc11_20, %int.convert_checked.loc11_26.1 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_26.5: i32 = int_value 0 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_26.6: ref i32 = array_index file.%c.var, %.loc11_26.5 -// CHECK:STDOUT: %.loc11_26.7: init i32 = initialize_from %.loc11_26.4 to %.loc11_26.6 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_26.8: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_26.9: = bound_method %.loc11_24, %.loc11_26.8 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_26.2: init i32 = call %.loc11_26.9(%.loc11_24) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_26.10: init i32 = converted %.loc11_24, %int.convert_checked.loc11_26.2 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_26.11: i32 = int_value 1 [template = constants.%.32] -// CHECK:STDOUT: %.loc11_26.12: ref i32 = array_index file.%c.var, %.loc11_26.11 -// CHECK:STDOUT: %.loc11_26.13: init i32 = initialize_from %.loc11_26.10 to %.loc11_26.12 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_26.14: init %.2 = array_init (%.loc11_26.7, %.loc11_26.13) to file.%c.var [template = constants.%array] -// CHECK:STDOUT: %.loc11_27: init %.2 = converted %.loc11_26.1, %.loc11_26.14 [template = constants.%array] +// CHECK:STDOUT: %.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_26.3: = bound_method %.loc11_20, %.loc11_26.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_26.4: = specific_function %.loc11_26.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %.loc11_26.4(%.loc11_20) [template = constants.%.29] +// CHECK:STDOUT: %.loc11_26.5: init %i32 = converted %.loc11_20, %int.convert_checked.loc11_26.1 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_26.6: Core.IntLiteral = int_value 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_26.7: ref %i32 = array_index file.%c.var, %.loc11_26.6 +// CHECK:STDOUT: %.loc11_26.8: init %i32 = initialize_from %.loc11_26.5 to %.loc11_26.7 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_26.9: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_26.10: = bound_method %.loc11_24, %.loc11_26.9 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_26.11: = specific_function %.loc11_26.10, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %.loc11_26.11(%.loc11_24) [template = constants.%.29] +// CHECK:STDOUT: %.loc11_26.12: init %i32 = converted %.loc11_24, %int.convert_checked.loc11_26.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_26.13: Core.IntLiteral = int_value 1 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_26.14: ref %i32 = array_index file.%c.var, %.loc11_26.13 +// CHECK:STDOUT: %.loc11_26.15: init %i32 = initialize_from %.loc11_26.12 to %.loc11_26.14 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_26.16: init %.3 = array_init (%.loc11_26.8, %.loc11_26.15) to file.%c.var [template = constants.%array] +// CHECK:STDOUT: %.loc11_27: init %.3 = converted %.loc11_26.1, %.loc11_26.16 [template = constants.%array] // CHECK:STDOUT: assign file.%c.var, %.loc11_27 -// CHECK:STDOUT: %c.ref: ref %.2 = name_ref c, file.%c -// CHECK:STDOUT: %.loc15_17: Core.IntLiteral = int_value 10 [template = constants.%.33] -// CHECK:STDOUT: %.loc15_19.1: ref i32 = array_index %c.ref, [template = ] -// CHECK:STDOUT: %.loc15_19.2: i32 = bind_value %.loc15_19.1 +// CHECK:STDOUT: %c.ref: ref %.3 = name_ref c, file.%c +// CHECK:STDOUT: %.loc15_17: Core.IntLiteral = int_value 10 [template = constants.%.31] +// CHECK:STDOUT: %.loc15_19.1: ref %i32 = array_index %c.ref, [template = ] +// CHECK:STDOUT: %.loc15_19.2: %i32 = bind_value %.loc15_19.1 // CHECK:STDOUT: assign file.%d.var, %.loc15_19.2 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/assoc_const.carbon b/toolchain/check/testdata/interface/assoc_const.carbon index ffacf28b660a..eb1719044804 100644 --- a/toolchain/check/testdata/interface/assoc_const.carbon +++ b/toolchain/check/testdata/interface/assoc_const.carbon @@ -20,15 +20,17 @@ interface I { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %.1: type = assoc_entity_type %I.type, type [template] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, @I.%T [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = assoc_entity_type %I.type, i32 [template] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element1, @I.%N [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.3 [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %I.type, %i32 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element1, @I.%N [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -47,11 +49,12 @@ interface I { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] // CHECK:STDOUT: %T: type = assoc_const_decl T [template] // CHECK:STDOUT: %.loc12: %.1 = assoc_entity element0, %T [template = constants.%.2] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_32, %.loc13_11.1 [template = i32] -// CHECK:STDOUT: %N: i32 = assoc_const_decl N [template] -// CHECK:STDOUT: %.loc13_14: %.3 = assoc_entity element1, %N [template = constants.%.4] +// CHECK:STDOUT: %.loc13_11.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_11.3: type = converted %int.make_type_signed, %.loc13_11.2 [template = constants.%i32] +// CHECK:STDOUT: %N: %i32 = assoc_const_decl N [template] +// CHECK:STDOUT: %.loc13_14: %.4 = assoc_entity element1, %N [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self diff --git a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon index 35f2deaf6b75..7d7955c1ce15 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon @@ -24,8 +24,8 @@ interface I { // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self.1: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 42 [template] -// CHECK:STDOUT: %.27: type = assoc_entity_type %I.type, type [template] -// CHECK:STDOUT: %.28: %.27 = assoc_entity element0, @I.%T [template] +// CHECK:STDOUT: %.21: type = assoc_entity_type %I.type, type [template] +// CHECK:STDOUT: %.22: %.21 = assoc_entity element0, @I.%T [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -50,7 +50,7 @@ interface I { // CHECK:STDOUT: %.loc18_18: Core.IntLiteral = int_value 42 [template = constants.%.1] // CHECK:STDOUT: %.loc18_20.1: type = converted %.loc18_18, [template = ] // CHECK:STDOUT: %T: type = assoc_const_decl T [template] -// CHECK:STDOUT: %.loc18_20.2: %.27 = assoc_entity element0, %T [template = constants.%.28] +// CHECK:STDOUT: %.loc18_20.2: %.21 = assoc_entity element0, %T [template = constants.%.22] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self diff --git a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon index 3c5a036503d9..573041fc397b 100644 --- a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon +++ b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon @@ -25,26 +25,29 @@ interface I { // CHECK:STDOUT: constants { // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self.1: %I.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.1: type = assoc_entity_type %I.type, type [template] -// CHECK:STDOUT: %.2: %.1 = assoc_entity element0, @I.%T [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 42 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 42 [template] -// CHECK:STDOUT: %.30: type = assoc_entity_type %I.type, i32 [template] -// CHECK:STDOUT: %.31: %.30 = assoc_entity element1, @I.%N [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %.2: type = assoc_entity_type %I.type, type [template] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @I.%T [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 42 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 42 [template] +// CHECK:STDOUT: %.28: type = assoc_entity_type %I.type, %i32 [template] +// CHECK:STDOUT: %.29: %.28 = assoc_entity element1, @I.%N [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -62,32 +65,36 @@ interface I { // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1] -// CHECK:STDOUT: %int.make_type_32.loc16_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc16_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_35: %tuple.type.1 = tuple_literal (%int.make_type_32.loc16_27, %int.make_type_32.loc16_32) -// CHECK:STDOUT: %.loc16_36.1: type = value_of_initializer %int.make_type_32.loc16_27 [template = i32] -// CHECK:STDOUT: %.loc16_36.2: type = converted %int.make_type_32.loc16_27, %.loc16_36.1 [template = i32] -// CHECK:STDOUT: %.loc16_36.3: type = value_of_initializer %int.make_type_32.loc16_32 [template = i32] -// CHECK:STDOUT: %.loc16_36.4: type = converted %int.make_type_32.loc16_32, %.loc16_36.3 [template = i32] +// CHECK:STDOUT: %.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16_27: init type = call constants.%Int(%.loc16_27) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_32: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16_32: init type = call constants.%Int(%.loc16_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_35: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc16_27, %int.make_type_signed.loc16_32) +// CHECK:STDOUT: %.loc16_36.1: type = value_of_initializer %int.make_type_signed.loc16_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_36.2: type = converted %int.make_type_signed.loc16_27, %.loc16_36.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_36.3: type = value_of_initializer %int.make_type_signed.loc16_32 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_36.4: type = converted %int.make_type_signed.loc16_32, %.loc16_36.3 [template = constants.%i32] // CHECK:STDOUT: %.loc16_36.5: type = converted %.loc16_35, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %T: type = assoc_const_decl T [template] -// CHECK:STDOUT: %.loc16_36.6: %.1 = assoc_entity element0, %T [template = constants.%.2] -// CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc20_19.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32] -// CHECK:STDOUT: %.loc20_19.2: type = converted %int.make_type_32.loc20, %.loc20_19.1 [template = i32] -// CHECK:STDOUT: %.loc20_25: Core.IntLiteral = int_value 42 [template = constants.%.3] -// CHECK:STDOUT: %.loc20_27.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc20_27.2: = bound_method %.loc20_25, %.loc20_27.1 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc20_27.2(%.loc20_25) [template = constants.%.29] -// CHECK:STDOUT: %.loc20_27.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.29] -// CHECK:STDOUT: %.loc20_27.4: i32 = converted %.loc20_25, %.loc20_27.3 [template = constants.%.29] -// CHECK:STDOUT: %N: i32 = assoc_const_decl N [template] -// CHECK:STDOUT: %.loc20_27.5: %.30 = assoc_entity element1, %N [template = constants.%.31] +// CHECK:STDOUT: %.loc16_36.6: %.2 = assoc_entity element0, %T [template = constants.%.3] +// CHECK:STDOUT: %.loc20_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%.loc20_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc20_19.2: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] +// CHECK:STDOUT: %.loc20_19.3: type = converted %int.make_type_signed.loc20, %.loc20_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc20_25: Core.IntLiteral = int_value 42 [template = constants.%.4] +// CHECK:STDOUT: %.loc20_27.1: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc20_27.2: = bound_method %.loc20_25, %.loc20_27.1 [template = constants.%.25] +// CHECK:STDOUT: %.loc20_27.3: = specific_function %.loc20_27.2, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc20_27.3(%.loc20_25) [template = constants.%.27] +// CHECK:STDOUT: %.loc20_27.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc20_27.5: %i32 = converted %.loc20_25, %.loc20_27.4 [template = constants.%.27] +// CHECK:STDOUT: %N: %i32 = assoc_const_decl N [template] +// CHECK:STDOUT: %.loc20_27.6: %.28 = assoc_entity element1, %N [template = constants.%.29] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self // CHECK:STDOUT: .T = %.loc16_36.6 -// CHECK:STDOUT: .N = %.loc20_27.5 +// CHECK:STDOUT: .N = %.loc20_27.6 // CHECK:STDOUT: witness = (%T, %N) // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon index 004c3fc40fa3..abeb9af97bd7 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon @@ -30,17 +30,19 @@ interface Interface { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.1: type = assoc_entity_type %Interface.type, %F.type [template] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, @Interface.%F.decl [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.3 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = assoc_entity_type %Interface.type, %G.type [template] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element1, @Interface.%G.decl [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %Interface.type, %G.type [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element1, @Interface.%G.decl [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -60,30 +62,33 @@ interface Interface { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.loc16: %.1 = assoc_entity element0, %F.decl [template = constants.%.2] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc21_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_19.1: type = value_of_initializer %int.make_type_32.loc21_19 [template = i32] -// CHECK:STDOUT: %.loc21_19.2: type = converted %int.make_type_32.loc21_19, %.loc21_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc21_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_27.1: type = value_of_initializer %int.make_type_32.loc21_27 [template = i32] -// CHECK:STDOUT: %.loc21_27.2: type = converted %int.make_type_32.loc21_27, %.loc21_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc21_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_35.1: type = value_of_initializer %int.make_type_32.loc21_35 [template = i32] -// CHECK:STDOUT: %.loc21_35.2: type = converted %int.make_type_32.loc21_35, %.loc21_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc21_19.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc21_19: init type = call constants.%Int(%.loc21_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_19.2: type = value_of_initializer %int.make_type_signed.loc21_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_19.3: type = converted %int.make_type_signed.loc21_19, %.loc21_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_27.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc21_27: init type = call constants.%Int(%.loc21_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_27.2: type = value_of_initializer %int.make_type_signed.loc21_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_27.3: type = converted %int.make_type_signed.loc21_27, %.loc21_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_35.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc21_35: init type = call constants.%Int(%.loc21_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_35.2: type = value_of_initializer %int.make_type_signed.loc21_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_35.3: type = converted %int.make_type_signed.loc21_35, %.loc21_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc21: %.3 = assoc_entity element1, %G.decl [template = constants.%.4] +// CHECK:STDOUT: %.loc21: %.4 = assoc_entity element1, %G.decl [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self @@ -104,7 +109,7 @@ interface Interface { // CHECK:STDOUT: generic fn @G(@Interface.%Self: %Interface.type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Self) {} diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon index 45131d36609d..e685eb2c6782 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon @@ -72,21 +72,23 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.1: type = assoc_entity_type %Interface.type, %F.type [template] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, @Interface.%F.decl [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.3 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = assoc_entity_type %Interface.type, %G.type [template] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element1, @Interface.%G.decl [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %Interface.type, %G.type [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element1, @Interface.%G.decl [template] // CHECK:STDOUT: %.type.1: type = fn_type @.1 [template] -// CHECK:STDOUT: %.5: %.type.1 = struct_value () [template] +// CHECK:STDOUT: %.6: %.type.1 = struct_value () [template] // CHECK:STDOUT: %.type.2: type = fn_type @.2 [template] -// CHECK:STDOUT: %.6: %.type.2 = struct_value () [template] +// CHECK:STDOUT: %.7: %.type.2 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -99,30 +101,33 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%Interface.type] {} {} -// CHECK:STDOUT: %.decl.loc23: %.type.1 = fn_decl @.1 [template = constants.%.5] {} {} -// CHECK:STDOUT: %.decl.loc31: %.type.2 = fn_decl @.2 [template = constants.%.6] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %.decl.loc23: %.type.1 = fn_decl @.1 [template = constants.%.6] {} {} +// CHECK:STDOUT: %.decl.loc31: %.type.2 = fn_decl @.2 [template = constants.%.7] { +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc31_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc31_19.1: type = value_of_initializer %int.make_type_32.loc31_19 [template = i32] -// CHECK:STDOUT: %.loc31_19.2: type = converted %int.make_type_32.loc31_19, %.loc31_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc31_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc31_27.1: type = value_of_initializer %int.make_type_32.loc31_27 [template = i32] -// CHECK:STDOUT: %.loc31_27.2: type = converted %int.make_type_32.loc31_27, %.loc31_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc31_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc31_35.1: type = value_of_initializer %int.make_type_32.loc31_35 [template = i32] -// CHECK:STDOUT: %.loc31_35.2: type = converted %int.make_type_32.loc31_35, %.loc31_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc31_19.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc31_19: init type = call constants.%Int(%.loc31_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc31_19.2: type = value_of_initializer %int.make_type_signed.loc31_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc31_19.3: type = converted %int.make_type_signed.loc31_19, %.loc31_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc31_27.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc31_27: init type = call constants.%Int(%.loc31_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc31_27.2: type = value_of_initializer %int.make_type_signed.loc31_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc31_27.3: type = converted %int.make_type_signed.loc31_27, %.loc31_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc31_35.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc31_35: init type = call constants.%Int(%.loc31_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc31_35.2: type = value_of_initializer %int.make_type_signed.loc31_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc31_35.3: type = converted %int.make_type_signed.loc31_35, %.loc31_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -131,30 +136,33 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.loc7: %.1 = assoc_entity element0, %F.decl [template = constants.%.2] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc13_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_19.1: type = value_of_initializer %int.make_type_32.loc13_19 [template = i32] -// CHECK:STDOUT: %.loc13_19.2: type = converted %int.make_type_32.loc13_19, %.loc13_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_27.1: type = value_of_initializer %int.make_type_32.loc13_27 [template = i32] -// CHECK:STDOUT: %.loc13_27.2: type = converted %int.make_type_32.loc13_27, %.loc13_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc13_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_35.1: type = value_of_initializer %int.make_type_32.loc13_35 [template = i32] -// CHECK:STDOUT: %.loc13_35.2: type = converted %int.make_type_32.loc13_35, %.loc13_35.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc13_19.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc13_19: init type = call constants.%Int(%.loc13_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_19.2: type = value_of_initializer %int.make_type_signed.loc13_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_19.3: type = converted %int.make_type_signed.loc13_19, %.loc13_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_27.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc13_27: init type = call constants.%Int(%.loc13_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_27.2: type = value_of_initializer %int.make_type_signed.loc13_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_27.3: type = converted %int.make_type_signed.loc13_27, %.loc13_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_35.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc13_35: init type = call constants.%Int(%.loc13_35.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_35.2: type = value_of_initializer %int.make_type_signed.loc13_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_35.3: type = converted %int.make_type_signed.loc13_35, %.loc13_35.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13: %.3 = assoc_entity element1, %G.decl [template = constants.%.4] +// CHECK:STDOUT: %.loc13: %.4 = assoc_entity element1, %G.decl [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self @@ -170,7 +178,7 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(@Interface.%Self: %Interface.type) { // CHECK:STDOUT: -// CHECK:STDOUT: fn(%a.param_patt: i32, %b.param_patt: i32) -> i32; +// CHECK:STDOUT: fn(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.1(@Interface.%Self: %Interface.type) { @@ -185,7 +193,7 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: generic fn @.2(@Interface.%Self: %Interface.type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Self) {} diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon index 0b68b1166b00..cf3fb078f02a 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon @@ -30,6 +30,7 @@ alias UseOther = I.other; // CHECK:STDOUT: constants { // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -49,6 +50,7 @@ alias UseOther = I.other; // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %.loc19: Core.IntLiteral = int_value 32 [template = constants.%.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self diff --git a/toolchain/check/testdata/interface/todo_define_not_default.carbon b/toolchain/check/testdata/interface/todo_define_not_default.carbon index 32040d83d8a2..21cc2e6c76ca 100644 --- a/toolchain/check/testdata/interface/todo_define_not_default.carbon +++ b/toolchain/check/testdata/interface/todo_define_not_default.carbon @@ -28,30 +28,33 @@ interface I { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.1: type = assoc_entity_type %I.type, %F.type [template] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, @I.%F.decl [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.3 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = assoc_entity_type %I.type, %G.type [template] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element1, @I.%G.decl [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %I.type, %G.type [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element1, @I.%G.decl [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.5: type = assoc_entity_type %I.type, type [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element2, @I.%T [template] -// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 42 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.32: = bound_method %.7, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 42 [template] -// CHECK:STDOUT: %.34: type = assoc_entity_type %I.type, i32 [template] -// CHECK:STDOUT: %.35: %.34 = assoc_entity element3, @I.%N [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %I.type, type [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element2, @I.%T [template] +// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 42 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.3) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.28: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.29: = bound_method %.8, %Convert.14 [template] +// CHECK:STDOUT: %.30: = specific_function %.29, @Convert.2(%.3) [template] +// CHECK:STDOUT: %.31: %i32 = int_value 42 [template] +// CHECK:STDOUT: %.32: type = assoc_entity_type %I.type, %i32 [template] +// CHECK:STDOUT: %.33: %.32 = assoc_entity element3, @I.%N [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -72,58 +75,65 @@ interface I { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %.loc13: %.1 = assoc_entity element0, %F.decl [template = constants.%.2] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc14_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_32.loc14_11 [template = i32] -// CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_32.loc14_11, %.loc14_11.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_19.1: type = value_of_initializer %int.make_type_32.loc14_19 [template = i32] -// CHECK:STDOUT: %.loc14_19.2: type = converted %int.make_type_32.loc14_19, %.loc14_19.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_27.1: type = value_of_initializer %int.make_type_32.loc14_27 [template = i32] -// CHECK:STDOUT: %.loc14_27.2: type = converted %int.make_type_32.loc14_27, %.loc14_27.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc14_11.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc14_11: init type = call constants.%Int(%.loc14_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_11.2: type = value_of_initializer %int.make_type_signed.loc14_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_11.3: type = converted %int.make_type_signed.loc14_11, %.loc14_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_19.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc14_19: init type = call constants.%Int(%.loc14_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_19.2: type = value_of_initializer %int.make_type_signed.loc14_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_19.3: type = converted %int.make_type_signed.loc14_19, %.loc14_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_27.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc14_27: init type = call constants.%Int(%.loc14_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_27.2: type = value_of_initializer %int.make_type_signed.loc14_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_27.3: type = converted %int.make_type_signed.loc14_27, %.loc14_27.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc14: %.3 = assoc_entity element1, %G.decl [template = constants.%.4] -// CHECK:STDOUT: %int.make_type_32.loc18_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc18_24: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_27: %tuple.type.1 = tuple_literal (%int.make_type_32.loc18_19, %int.make_type_32.loc18_24) -// CHECK:STDOUT: %.loc18_28.1: type = value_of_initializer %int.make_type_32.loc18_19 [template = i32] -// CHECK:STDOUT: %.loc18_28.2: type = converted %int.make_type_32.loc18_19, %.loc18_28.1 [template = i32] -// CHECK:STDOUT: %.loc18_28.3: type = value_of_initializer %int.make_type_32.loc18_24 [template = i32] -// CHECK:STDOUT: %.loc18_28.4: type = converted %int.make_type_32.loc18_24, %.loc18_28.3 [template = i32] +// CHECK:STDOUT: %.loc14: %.4 = assoc_entity element1, %G.decl [template = constants.%.5] +// CHECK:STDOUT: %.loc18_19: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc18_19: init type = call constants.%Int(%.loc18_19) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_24: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc18_24: init type = call constants.%Int(%.loc18_24) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_27: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc18_19, %int.make_type_signed.loc18_24) +// CHECK:STDOUT: %.loc18_28.1: type = value_of_initializer %int.make_type_signed.loc18_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_28.2: type = converted %int.make_type_signed.loc18_19, %.loc18_28.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_28.3: type = value_of_initializer %int.make_type_signed.loc18_24 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_28.4: type = converted %int.make_type_signed.loc18_24, %.loc18_28.3 [template = constants.%i32] // CHECK:STDOUT: %.loc18_28.5: type = converted %.loc18_27, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %T: type = assoc_const_decl T [template] -// CHECK:STDOUT: %.loc18_28.6: %.5 = assoc_entity element2, %T [template = constants.%.6] -// CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] -// CHECK:STDOUT: %.loc19_11.2: type = converted %int.make_type_32.loc19, %.loc19_11.1 [template = i32] -// CHECK:STDOUT: %.loc19_17: Core.IntLiteral = int_value 42 [template = constants.%.7] -// CHECK:STDOUT: %.loc19_19.1: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc19_19.2: = bound_method %.loc19_17, %.loc19_19.1 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc19_19.2(%.loc19_17) [template = constants.%.33] -// CHECK:STDOUT: %.loc19_19.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.33] -// CHECK:STDOUT: %.loc19_19.4: i32 = converted %.loc19_17, %.loc19_19.3 [template = constants.%.33] -// CHECK:STDOUT: %N: i32 = assoc_const_decl N [template] -// CHECK:STDOUT: %.loc19_19.5: %.34 = assoc_entity element3, %N [template = constants.%.35] +// CHECK:STDOUT: %.loc18_28.6: %.6 = assoc_entity element2, %T [template = constants.%.7] +// CHECK:STDOUT: %.loc19_11.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed.loc19: init type = call constants.%Int(%.loc19_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_11.2: type = value_of_initializer %int.make_type_signed.loc19 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_11.3: type = converted %int.make_type_signed.loc19, %.loc19_11.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_17: Core.IntLiteral = int_value 42 [template = constants.%.8] +// CHECK:STDOUT: %.loc19_19.1: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc19_19.2: = bound_method %.loc19_17, %.loc19_19.1 [template = constants.%.29] +// CHECK:STDOUT: %.loc19_19.3: = specific_function %.loc19_19.2, @Convert.2(constants.%.3) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc19_19.3(%.loc19_17) [template = constants.%.31] +// CHECK:STDOUT: %.loc19_19.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.31] +// CHECK:STDOUT: %.loc19_19.5: %i32 = converted %.loc19_17, %.loc19_19.4 [template = constants.%.31] +// CHECK:STDOUT: %N: %i32 = assoc_const_decl N [template] +// CHECK:STDOUT: %.loc19_19.6: %.32 = assoc_entity element3, %N [template = constants.%.33] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self // CHECK:STDOUT: .F = %.loc13 // CHECK:STDOUT: .G = %.loc14 // CHECK:STDOUT: .T = %.loc18_28.6 -// CHECK:STDOUT: .N = %.loc19_19.5 +// CHECK:STDOUT: .N = %.loc19_19.6 // CHECK:STDOUT: witness = (%F.decl, %G.decl, %T, %N) // CHECK:STDOUT: } // CHECK:STDOUT: @@ -139,7 +149,7 @@ interface I { // CHECK:STDOUT: generic fn @G(@I.%Self: %I.type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd"; +// CHECK:STDOUT: fn(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Self.1) {} diff --git a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon index 91f34b1ef33e..9e935bbd1355 100644 --- a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon +++ b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon @@ -16,23 +16,27 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %.1: bool = bool_literal true [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 2 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.2 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.2) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.28: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -54,17 +58,19 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: if %.loc11_14 br !if.then.loc11_18 else br !if.else.loc11_18 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc11_18: -// CHECK:STDOUT: %int.make_type_32.loc11_29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_29.1: type = value_of_initializer %int.make_type_32.loc11_29 [template = i32] -// CHECK:STDOUT: %.loc11_29.2: type = converted %int.make_type_32.loc11_29, %.loc11_29.1 [template = i32] -// CHECK:STDOUT: %n.var.loc11_26: ref i32 = var n -// CHECK:STDOUT: %n.loc11_26: ref i32 = bind_name n, %n.var.loc11_26 -// CHECK:STDOUT: %.loc11_35: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc11_36.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_36.2: = bound_method %.loc11_35, %.loc11_36.1 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc11_36: init i32 = call %.loc11_36.2(%.loc11_35) [template = constants.%.28] -// CHECK:STDOUT: %.loc11_36.3: init i32 = converted %.loc11_35, %int.convert_checked.loc11_36 [template = constants.%.28] -// CHECK:STDOUT: assign %n.var.loc11_26, %.loc11_36.3 +// CHECK:STDOUT: %.loc11_29.1: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc11_29: init type = call constants.%Int(%.loc11_29.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_29.2: type = value_of_initializer %int.make_type_signed.loc11_29 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_29.3: type = converted %int.make_type_signed.loc11_29, %.loc11_29.2 [template = constants.%i32] +// CHECK:STDOUT: %n.var.loc11_26: ref %i32 = var n +// CHECK:STDOUT: %n.loc11_26: ref %i32 = bind_name n, %n.var.loc11_26 +// CHECK:STDOUT: %.loc11_35: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_36.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_36.2: = bound_method %.loc11_35, %.loc11_36.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc11_36.3: = specific_function %.loc11_36.2, @Convert.2(constants.%.2) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc11_36: init %i32 = call %.loc11_36.3(%.loc11_35) [template = constants.%.26] +// CHECK:STDOUT: %.loc11_36.4: init %i32 = converted %.loc11_35, %int.convert_checked.loc11_36 [template = constants.%.26] +// CHECK:STDOUT: assign %n.var.loc11_26, %.loc11_36.4 // CHECK:STDOUT: br !if.else.loc11_18 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc11_18: @@ -72,17 +78,19 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: if %.loc11_44 br !if.then.loc11_48 else br !if.else.loc11_48 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc11_48: -// CHECK:STDOUT: %int.make_type_32.loc11_59: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_59.1: type = value_of_initializer %int.make_type_32.loc11_59 [template = i32] -// CHECK:STDOUT: %.loc11_59.2: type = converted %int.make_type_32.loc11_59, %.loc11_59.1 [template = i32] -// CHECK:STDOUT: %n.var.loc11_56: ref i32 = var n -// CHECK:STDOUT: %n.loc11_56: ref i32 = bind_name n, %n.var.loc11_56 -// CHECK:STDOUT: %.loc11_65: Core.IntLiteral = int_value 2 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_66.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_66.2: = bound_method %.loc11_65, %.loc11_66.1 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_66: init i32 = call %.loc11_66.2(%.loc11_65) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_66.3: init i32 = converted %.loc11_65, %int.convert_checked.loc11_66 [template = constants.%.31] -// CHECK:STDOUT: assign %n.var.loc11_56, %.loc11_66.3 +// CHECK:STDOUT: %.loc11_59.1: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc11_59: init type = call constants.%Int(%.loc11_59.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_59.2: type = value_of_initializer %int.make_type_signed.loc11_59 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_59.3: type = converted %int.make_type_signed.loc11_59, %.loc11_59.2 [template = constants.%i32] +// CHECK:STDOUT: %n.var.loc11_56: ref %i32 = var n +// CHECK:STDOUT: %n.loc11_56: ref %i32 = bind_name n, %n.var.loc11_56 +// CHECK:STDOUT: %.loc11_65: Core.IntLiteral = int_value 2 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_66.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_66.2: = bound_method %.loc11_65, %.loc11_66.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_66.3: = specific_function %.loc11_66.2, @Convert.2(constants.%.2) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc11_66: init %i32 = call %.loc11_66.3(%.loc11_65) [template = constants.%.30] +// CHECK:STDOUT: %.loc11_66.4: init %i32 = converted %.loc11_65, %int.convert_checked.loc11_66 [template = constants.%.30] +// CHECK:STDOUT: assign %n.var.loc11_56, %.loc11_66.4 // CHECK:STDOUT: br !if.else.loc11_48 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc11_48: diff --git a/toolchain/check/testdata/let/compile_time_bindings.carbon b/toolchain/check/testdata/let/compile_time_bindings.carbon index 4136342c5837..bc802c798fee 100644 --- a/toolchain/check/testdata/let/compile_time_bindings.carbon +++ b/toolchain/check/testdata/let/compile_time_bindings.carbon @@ -525,23 +525,26 @@ impl i32 as Empty { // CHECK:STDOUT: --- use_in_function.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] -// CHECK:STDOUT: %Zero: i32 = bind_symbolic_name Zero, 0 [symbolic] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] +// CHECK:STDOUT: %Zero: %i32 = bind_symbolic_name Zero, 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -555,57 +558,64 @@ impl i32 as Empty { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32 { +// CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_14.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_14.2: type = converted %int.make_type_32.loc5, %.loc5_14.1 [template = i32] -// CHECK:STDOUT: %.loc5_20: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc5_21.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc5_21.2: = bound_method %.loc5_20, %.loc5_21.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc5_21.2(%.loc5_20) [template = constants.%.27] -// CHECK:STDOUT: %.loc5_21.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc5_21.4: i32 = converted %.loc5_20, %.loc5_21.3 [template = constants.%.27] -// CHECK:STDOUT: %Zero: i32 = bind_symbolic_name Zero, 0, %.loc5_21.4 [symbolic = constants.%Zero] -// CHECK:STDOUT: %Zero.ref: i32 = name_ref Zero, %Zero [symbolic = constants.%Zero] +// CHECK:STDOUT: %.loc5_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_14.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_14.3: type = converted %int.make_type_signed.loc5, %.loc5_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_20: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc5_21.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc5_21.2: = bound_method %.loc5_20, %.loc5_21.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc5_21.3: = specific_function %.loc5_21.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc5_21.3(%.loc5_20) [template = constants.%.25] +// CHECK:STDOUT: %.loc5_21.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc5_21.5: %i32 = converted %.loc5_20, %.loc5_21.4 [template = constants.%.25] +// CHECK:STDOUT: %Zero: %i32 = bind_symbolic_name Zero, 0, %.loc5_21.5 [symbolic = constants.%Zero] +// CHECK:STDOUT: %Zero.ref: %i32 = name_ref Zero, %Zero [symbolic = constants.%Zero] // CHECK:STDOUT: return %Zero.ref // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_in_block.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: bool = bool_literal true [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 0 [template] -// CHECK:STDOUT: %Zero: i32 = bind_symbolic_name Zero, 0 [symbolic] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] +// CHECK:STDOUT: %.2: bool = bool_literal true [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 0 [template] +// CHECK:STDOUT: %Zero: %i32 = bind_symbolic_name Zero, 0 [symbolic] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -619,44 +629,48 @@ impl i32 as Empty { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32.loc4, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed.loc4, %.loc4_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32 { +// CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc5: bool = bool_literal true [template = constants.%.1] +// CHECK:STDOUT: %.loc5: bool = bool_literal true [template = constants.%.2] // CHECK:STDOUT: if %.loc5 br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_16.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_16.2: type = converted %int.make_type_32.loc6, %.loc6_16.1 [template = i32] -// CHECK:STDOUT: %.loc6_22: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc6_23.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_23.2: = bound_method %.loc6_22, %.loc6_23.1 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc6: init i32 = call %.loc6_23.2(%.loc6_22) [template = constants.%.28] -// CHECK:STDOUT: %.loc6_23.3: i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_23.4: i32 = converted %.loc6_22, %.loc6_23.3 [template = constants.%.28] -// CHECK:STDOUT: %Zero: i32 = bind_symbolic_name Zero, 0, %.loc6_23.4 [symbolic = constants.%Zero] -// CHECK:STDOUT: %Zero.ref: i32 = name_ref Zero, %Zero [symbolic = constants.%Zero] +// CHECK:STDOUT: %.loc6_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_16.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_16.3: type = converted %int.make_type_signed.loc6, %.loc6_16.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_22: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc6_23.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_23.2: = bound_method %.loc6_22, %.loc6_23.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc6_23.3: = specific_function %.loc6_23.2, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %.loc6_23.3(%.loc6_22) [template = constants.%.26] +// CHECK:STDOUT: %.loc6_23.4: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%.26] +// CHECK:STDOUT: %.loc6_23.5: %i32 = converted %.loc6_22, %.loc6_23.4 [template = constants.%.26] +// CHECK:STDOUT: %Zero: %i32 = bind_symbolic_name Zero, 0, %.loc6_23.5 [symbolic = constants.%Zero] +// CHECK:STDOUT: %Zero.ref: %i32 = name_ref Zero, %Zero [symbolic = constants.%Zero] // CHECK:STDOUT: return %Zero.ref // CHECK:STDOUT: // CHECK:STDOUT: !if.else: -// CHECK:STDOUT: %.loc9_10: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc9_11.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_11.2: = bound_method %.loc9_10, %.loc9_11.1 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc9: init i32 = call %.loc9_11.2(%.loc9_10) [template = constants.%.31] -// CHECK:STDOUT: %.loc9_11.3: i32 = value_of_initializer %int.convert_checked.loc9 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_11.4: i32 = converted %.loc9_10, %.loc9_11.3 [template = constants.%.31] -// CHECK:STDOUT: return %.loc9_11.4 +// CHECK:STDOUT: %.loc9_10: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc9_11.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_11.2: = bound_method %.loc9_10, %.loc9_11.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc9_11.3: = specific_function %.loc9_11.2, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %.loc9_11.3(%.loc9_10) [template = constants.%.30] +// CHECK:STDOUT: %.loc9_11.4: %i32 = value_of_initializer %int.convert_checked.loc9 [template = constants.%.30] +// CHECK:STDOUT: %.loc9_11.5: %i32 = converted %.loc9_10, %.loc9_11.4 [template = constants.%.30] +// CHECK:STDOUT: return %.loc9_11.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_return_in_interface.carbon @@ -664,19 +678,21 @@ impl i32 as Empty { // CHECK:STDOUT: constants { // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self.1: %I.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = assoc_entity_type %I.type, type [template] -// CHECK:STDOUT: %.2: %.1 = assoc_entity element0, @I.%T [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = assoc_entity_type %I.type, type [template] +// CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @I.%T [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.28: type = assoc_entity_type %I.type, %F.type [template] -// CHECK:STDOUT: %.29: %.28 = assoc_entity element1, @I.%F.decl [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %I.type, %F.type [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element1, @I.%F.decl [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -694,21 +710,22 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_21.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc5_21.2: type = converted %int.make_type_32, %.loc5_21.1 [template = i32] +// CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc5_18) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_21.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc5_21.2: type = converted %int.make_type_signed, %.loc5_21.1 [template = constants.%i32] // CHECK:STDOUT: %T: type = assoc_const_decl T [template] -// CHECK:STDOUT: %.loc5_21.3: %.1 = assoc_entity element0, %T [template = constants.%.2] +// CHECK:STDOUT: %.loc5_21.3: %.2 = assoc_entity element0, %T [template = constants.%.3] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %return.patt: = return_slot_pattern // CHECK:STDOUT: %return.param_patt: = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: %.1 = name_ref T, @I.%.loc5_21.3 [template = constants.%.2] +// CHECK:STDOUT: %T.ref: %.2 = name_ref T, @I.%.loc5_21.3 [template = constants.%.3] // CHECK:STDOUT: %.loc13: type = converted %T.ref, [template = ] // CHECK:STDOUT: %return.param: ref = out_param runtime_param0 // CHECK:STDOUT: %return: ref = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13: %.28 = assoc_entity element1, %F.decl [template = constants.%.29] +// CHECK:STDOUT: %.loc13: %.23 = assoc_entity element1, %F.decl [template = constants.%.24] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self @@ -728,17 +745,19 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %I: type = class_type @I [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -754,9 +773,10 @@ impl i32 as Empty { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @I { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_21.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc9_21.2: type = converted %int.make_type_32, %.loc9_21.1 [template = i32] +// CHECK:STDOUT: %.loc9_18: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc9_18) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_21.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc9_21.2: type = converted %int.make_type_signed, %.loc9_21.1 [template = constants.%i32] // CHECK:STDOUT: %T: type = bind_name T, %.loc9_21.2 // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %return.patt: = return_slot_pattern @@ -766,7 +786,7 @@ impl i32 as Empty { // CHECK:STDOUT: %return.param: ref = out_param runtime_param0 // CHECK:STDOUT: %return: ref = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc15: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%I @@ -779,15 +799,17 @@ impl i32 as Empty { // CHECK:STDOUT: --- fail_return_in_package_scope.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -814,9 +836,10 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_19.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_19.2: type = converted %int.make_type_32, %.loc8_19.1 [template = i32] +// CHECK:STDOUT: %.loc8_16: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_16) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_19.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_19.2: type = converted %int.make_type_signed, %.loc8_19.1 [template = constants.%i32] // CHECK:STDOUT: %T: type = bind_name T, %.loc8_19.2 // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -826,21 +849,24 @@ impl i32 as Empty { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Empty.type: type = facet_type <@Empty> [template] // CHECK:STDOUT: %Self.1: %Empty.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] -// CHECK:STDOUT: %.28: = interface_witness () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.2(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.26: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -855,9 +881,10 @@ impl i32 as Empty { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%Empty.type] {} {} // CHECK:STDOUT: impl_decl @impl.1 [template] {} { -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_6.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_6.2: type = converted %int.make_type_32.loc6, %.loc6_6.1 [template = i32] +// CHECK:STDOUT: %.loc6_6.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_6.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_6.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_6.3: type = converted %int.make_type_signed.loc6, %.loc6_6.2 [template = constants.%i32] // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [template = constants.%Empty.type] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -870,18 +897,20 @@ impl i32 as Empty { // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %.loc6_6.2 as %Empty.ref { -// CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_14.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32] -// CHECK:STDOUT: %.loc10_14.2: type = converted %int.make_type_32.loc10, %.loc10_14.1 [template = i32] -// CHECK:STDOUT: %.loc10_20: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc10_21.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_21.2: = bound_method %.loc10_20, %.loc10_21.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc10_21.2(%.loc10_20) [template = constants.%.27] -// CHECK:STDOUT: %.loc10_21.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc10_21.4: i32 = converted %.loc10_20, %.loc10_21.3 [template = constants.%.27] -// CHECK:STDOUT: %Zero: i32 = bind_name Zero, %.loc10_21.4 -// CHECK:STDOUT: %.loc6_19: = interface_witness () [template = constants.%.28] +// CHECK:STDOUT: impl @impl.1: %.loc6_6.3 as %Empty.ref { +// CHECK:STDOUT: %.loc10_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc10: init type = call constants.%Int(%.loc10_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_14.2: type = value_of_initializer %int.make_type_signed.loc10 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_14.3: type = converted %int.make_type_signed.loc10, %.loc10_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_20: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc10_21.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_21.2: = bound_method %.loc10_20, %.loc10_21.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc10_21.3: = specific_function %.loc10_21.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc10_21.3(%.loc10_20) [template = constants.%.25] +// CHECK:STDOUT: %.loc10_21.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc10_21.5: %i32 = converted %.loc10_20, %.loc10_21.4 [template = constants.%.25] +// CHECK:STDOUT: %Zero: %i32 = bind_name Zero, %.loc10_21.5 +// CHECK:STDOUT: %.loc6_19: = interface_witness () [template = constants.%.26] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Zero = %Zero diff --git a/toolchain/check/testdata/let/convert.carbon b/toolchain/check/testdata/let/convert.carbon index 43ee059ef1e4..89255380254a 100644 --- a/toolchain/check/testdata/let/convert.carbon +++ b/toolchain/check/testdata/let/convert.carbon @@ -18,32 +18,37 @@ fn F() -> i32 { // CHECK:STDOUT: --- convert.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32, i32) [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32, %i32) [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.29: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 1 [template] -// CHECK:STDOUT: %.31: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 2 [template] -// CHECK:STDOUT: %.33: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 3 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.30, %.32, %.34) [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.26: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.27: = specific_function %.26, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.28: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.29: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.30: = specific_function %.29, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.31: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.32: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 3 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.28, %.31, %.34) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -57,81 +62,91 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed.loc11, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32 { +// CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc12_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc12_16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc12_21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_24.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc12_11, %int.make_type_32.loc12_16, %int.make_type_32.loc12_21) -// CHECK:STDOUT: %.loc12_24.2: type = value_of_initializer %int.make_type_32.loc12_11 [template = i32] -// CHECK:STDOUT: %.loc12_24.3: type = converted %int.make_type_32.loc12_11, %.loc12_24.2 [template = i32] -// CHECK:STDOUT: %.loc12_24.4: type = value_of_initializer %int.make_type_32.loc12_16 [template = i32] -// CHECK:STDOUT: %.loc12_24.5: type = converted %int.make_type_32.loc12_16, %.loc12_24.4 [template = i32] -// CHECK:STDOUT: %.loc12_24.6: type = value_of_initializer %int.make_type_32.loc12_21 [template = i32] -// CHECK:STDOUT: %.loc12_24.7: type = converted %int.make_type_32.loc12_21, %.loc12_24.6 [template = i32] +// CHECK:STDOUT: %.loc12_11: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_11: init type = call constants.%Int(%.loc12_11) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_16: init type = call constants.%Int(%.loc12_16) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_21: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_21: init type = call constants.%Int(%.loc12_21) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_24.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc12_11, %int.make_type_signed.loc12_16, %int.make_type_signed.loc12_21) +// CHECK:STDOUT: %.loc12_24.2: type = value_of_initializer %int.make_type_signed.loc12_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_24.3: type = converted %int.make_type_signed.loc12_11, %.loc12_24.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_24.4: type = value_of_initializer %int.make_type_signed.loc12_16 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_24.5: type = converted %int.make_type_signed.loc12_16, %.loc12_24.4 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_24.6: type = value_of_initializer %int.make_type_signed.loc12_21 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_24.7: type = converted %int.make_type_signed.loc12_21, %.loc12_24.6 [template = constants.%i32] // CHECK:STDOUT: %.loc12_24.8: type = converted %.loc12_24.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %v.var: ref %tuple.type.2 = var v // CHECK:STDOUT: %v: ref %tuple.type.2 = bind_name v, %v.var -// CHECK:STDOUT: %.loc12_29: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc12_32: Core.IntLiteral = int_value 2 [template = constants.%.3] -// CHECK:STDOUT: %.loc12_35: Core.IntLiteral = int_value 3 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_29: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_32: Core.IntLiteral = int_value 2 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_35: Core.IntLiteral = int_value 3 [template = constants.%.5] // CHECK:STDOUT: %.loc12_36.1: %tuple.type.3 = tuple_literal (%.loc12_29, %.loc12_32, %.loc12_35) -// CHECK:STDOUT: %.loc12_36.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_36.3: = bound_method %.loc12_29, %.loc12_36.2 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc12_36.1: init i32 = call %.loc12_36.3(%.loc12_29) [template = constants.%.30] -// CHECK:STDOUT: %.loc12_36.4: init i32 = converted %.loc12_29, %int.convert_checked.loc12_36.1 [template = constants.%.30] -// CHECK:STDOUT: %.loc12_36.5: ref i32 = tuple_access %v.var, element0 -// CHECK:STDOUT: %.loc12_36.6: init i32 = initialize_from %.loc12_36.4 to %.loc12_36.5 [template = constants.%.30] -// CHECK:STDOUT: %.loc12_36.7: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_36.8: = bound_method %.loc12_32, %.loc12_36.7 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc12_36.2: init i32 = call %.loc12_36.8(%.loc12_32) [template = constants.%.32] -// CHECK:STDOUT: %.loc12_36.9: init i32 = converted %.loc12_32, %int.convert_checked.loc12_36.2 [template = constants.%.32] -// CHECK:STDOUT: %.loc12_36.10: ref i32 = tuple_access %v.var, element1 -// CHECK:STDOUT: %.loc12_36.11: init i32 = initialize_from %.loc12_36.9 to %.loc12_36.10 [template = constants.%.32] -// CHECK:STDOUT: %.loc12_36.12: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_36.13: = bound_method %.loc12_35, %.loc12_36.12 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc12_36.3: init i32 = call %.loc12_36.13(%.loc12_35) [template = constants.%.34] -// CHECK:STDOUT: %.loc12_36.14: init i32 = converted %.loc12_35, %int.convert_checked.loc12_36.3 [template = constants.%.34] -// CHECK:STDOUT: %.loc12_36.15: ref i32 = tuple_access %v.var, element2 -// CHECK:STDOUT: %.loc12_36.16: init i32 = initialize_from %.loc12_36.14 to %.loc12_36.15 [template = constants.%.34] -// CHECK:STDOUT: %.loc12_36.17: init %tuple.type.2 = tuple_init (%.loc12_36.6, %.loc12_36.11, %.loc12_36.16) to %v.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc12_37: init %tuple.type.2 = converted %.loc12_36.1, %.loc12_36.17 [template = constants.%tuple] +// CHECK:STDOUT: %.loc12_36.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_36.3: = bound_method %.loc12_29, %.loc12_36.2 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_36.4: = specific_function %.loc12_36.3, @Convert.2(constants.%.1) [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked.loc12_36.1: init %i32 = call %.loc12_36.4(%.loc12_29) [template = constants.%.28] +// CHECK:STDOUT: %.loc12_36.5: init %i32 = converted %.loc12_29, %int.convert_checked.loc12_36.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc12_36.6: ref %i32 = tuple_access %v.var, element0 +// CHECK:STDOUT: %.loc12_36.7: init %i32 = initialize_from %.loc12_36.5 to %.loc12_36.6 [template = constants.%.28] +// CHECK:STDOUT: %.loc12_36.8: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_36.9: = bound_method %.loc12_32, %.loc12_36.8 [template = constants.%.29] +// CHECK:STDOUT: %.loc12_36.10: = specific_function %.loc12_36.9, @Convert.2(constants.%.1) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc12_36.2: init %i32 = call %.loc12_36.10(%.loc12_32) [template = constants.%.31] +// CHECK:STDOUT: %.loc12_36.11: init %i32 = converted %.loc12_32, %int.convert_checked.loc12_36.2 [template = constants.%.31] +// CHECK:STDOUT: %.loc12_36.12: ref %i32 = tuple_access %v.var, element1 +// CHECK:STDOUT: %.loc12_36.13: init %i32 = initialize_from %.loc12_36.11 to %.loc12_36.12 [template = constants.%.31] +// CHECK:STDOUT: %.loc12_36.14: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_36.15: = bound_method %.loc12_35, %.loc12_36.14 [template = constants.%.32] +// CHECK:STDOUT: %.loc12_36.16: = specific_function %.loc12_36.15, @Convert.2(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc12_36.3: init %i32 = call %.loc12_36.16(%.loc12_35) [template = constants.%.34] +// CHECK:STDOUT: %.loc12_36.17: init %i32 = converted %.loc12_35, %int.convert_checked.loc12_36.3 [template = constants.%.34] +// CHECK:STDOUT: %.loc12_36.18: ref %i32 = tuple_access %v.var, element2 +// CHECK:STDOUT: %.loc12_36.19: init %i32 = initialize_from %.loc12_36.17 to %.loc12_36.18 [template = constants.%.34] +// CHECK:STDOUT: %.loc12_36.20: init %tuple.type.2 = tuple_init (%.loc12_36.7, %.loc12_36.13, %.loc12_36.19) to %v.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc12_37: init %tuple.type.2 = converted %.loc12_36.1, %.loc12_36.20 [template = constants.%tuple] // CHECK:STDOUT: assign %v.var, %.loc12_37 -// CHECK:STDOUT: %int.make_type_32.loc14_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_24.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc14_11, %int.make_type_32.loc14_16, %int.make_type_32.loc14_21) -// CHECK:STDOUT: %.loc14_24.2: type = value_of_initializer %int.make_type_32.loc14_11 [template = i32] -// CHECK:STDOUT: %.loc14_24.3: type = converted %int.make_type_32.loc14_11, %.loc14_24.2 [template = i32] -// CHECK:STDOUT: %.loc14_24.4: type = value_of_initializer %int.make_type_32.loc14_16 [template = i32] -// CHECK:STDOUT: %.loc14_24.5: type = converted %int.make_type_32.loc14_16, %.loc14_24.4 [template = i32] -// CHECK:STDOUT: %.loc14_24.6: type = value_of_initializer %int.make_type_32.loc14_21 [template = i32] -// CHECK:STDOUT: %.loc14_24.7: type = converted %int.make_type_32.loc14_21, %.loc14_24.6 [template = i32] +// CHECK:STDOUT: %.loc14_11: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_11: init type = call constants.%Int(%.loc14_11) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_16: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_16: init type = call constants.%Int(%.loc14_16) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_21: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_21: init type = call constants.%Int(%.loc14_21) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_11, %int.make_type_signed.loc14_16, %int.make_type_signed.loc14_21) +// CHECK:STDOUT: %.loc14_24.2: type = value_of_initializer %int.make_type_signed.loc14_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.3: type = converted %int.make_type_signed.loc14_11, %.loc14_24.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.4: type = value_of_initializer %int.make_type_signed.loc14_16 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.5: type = converted %int.make_type_signed.loc14_16, %.loc14_24.4 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.6: type = value_of_initializer %int.make_type_signed.loc14_21 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.7: type = converted %int.make_type_signed.loc14_21, %.loc14_24.6 [template = constants.%i32] // CHECK:STDOUT: %.loc14_24.8: type = converted %.loc14_24.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %v.ref: ref %tuple.type.2 = name_ref v, %v -// CHECK:STDOUT: %.loc14_28.1: ref i32 = tuple_access %v.ref, element0 -// CHECK:STDOUT: %.loc14_28.2: i32 = bind_value %.loc14_28.1 -// CHECK:STDOUT: %.loc14_28.3: ref i32 = tuple_access %v.ref, element1 -// CHECK:STDOUT: %.loc14_28.4: i32 = bind_value %.loc14_28.3 -// CHECK:STDOUT: %.loc14_28.5: ref i32 = tuple_access %v.ref, element2 -// CHECK:STDOUT: %.loc14_28.6: i32 = bind_value %.loc14_28.5 +// CHECK:STDOUT: %.loc14_28.1: ref %i32 = tuple_access %v.ref, element0 +// CHECK:STDOUT: %.loc14_28.2: %i32 = bind_value %.loc14_28.1 +// CHECK:STDOUT: %.loc14_28.3: ref %i32 = tuple_access %v.ref, element1 +// CHECK:STDOUT: %.loc14_28.4: %i32 = bind_value %.loc14_28.3 +// CHECK:STDOUT: %.loc14_28.5: ref %i32 = tuple_access %v.ref, element2 +// CHECK:STDOUT: %.loc14_28.6: %i32 = bind_value %.loc14_28.5 // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.loc14_28.2, %.loc14_28.4, %.loc14_28.6) // CHECK:STDOUT: %.loc14_29: %tuple.type.2 = converted %v.ref, %tuple // CHECK:STDOUT: %w: %tuple.type.2 = bind_name w, %.loc14_29 // CHECK:STDOUT: %w.ref: %tuple.type.2 = name_ref w, %w -// CHECK:STDOUT: %.loc15_12: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc15_11: i32 = tuple_access %w.ref, element1 +// CHECK:STDOUT: %.loc15_12: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_11: %i32 = tuple_access %w.ref, element1 // CHECK:STDOUT: return %.loc15_11 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index 05de0137c806..8168bf88662b 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -24,23 +24,27 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.27: = bound_method %.26, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -58,26 +62,30 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_17.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_17.2: = bound_method %.loc12_16, %.loc12_17.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc12: init i32 = call %.loc12_17.2(%.loc12_16) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_17.3: i32 = value_of_initializer %int.convert_checked.loc12 [template = constants.%.27] -// CHECK:STDOUT: %.loc12_17.4: i32 = converted %.loc12_16, %.loc12_17.3 [template = constants.%.27] -// CHECK:STDOUT: %a.loc12: i32 = bind_name a, %.loc12_17.4 -// CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_10.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] -// CHECK:STDOUT: %.loc19_10.2: type = converted %int.make_type_32.loc19, %.loc19_10.1 [template = i32] -// CHECK:STDOUT: %.loc19_16: Core.IntLiteral = int_value 2 [template = constants.%.28] -// CHECK:STDOUT: %.loc19_17.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc19_17.2: = bound_method %.loc19_16, %.loc19_17.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc19: init i32 = call %.loc19_17.2(%.loc19_16) [template = constants.%.30] -// CHECK:STDOUT: %.loc19_17.3: i32 = value_of_initializer %int.convert_checked.loc19 [template = constants.%.30] -// CHECK:STDOUT: %.loc19_17.4: i32 = converted %.loc19_16, %.loc19_17.3 [template = constants.%.30] -// CHECK:STDOUT: %a.loc19: i32 = bind_name a, %.loc19_17.4 +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed.loc12, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_17.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_17.2: = bound_method %.loc12_16, %.loc12_17.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_17.3: = specific_function %.loc12_17.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %.loc12_17.3(%.loc12_16) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_17.4: %i32 = value_of_initializer %int.convert_checked.loc12 [template = constants.%.25] +// CHECK:STDOUT: %.loc12_17.5: %i32 = converted %.loc12_16, %.loc12_17.4 [template = constants.%.25] +// CHECK:STDOUT: %a.loc12: %i32 = bind_name a, %.loc12_17.5 +// CHECK:STDOUT: %.loc19_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19: init type = call constants.%Int(%.loc19_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_10.2: type = value_of_initializer %int.make_type_signed.loc19 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_10.3: type = converted %int.make_type_signed.loc19, %.loc19_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_16: Core.IntLiteral = int_value 2 [template = constants.%.26] +// CHECK:STDOUT: %.loc19_17.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc19_17.2: = bound_method %.loc19_16, %.loc19_17.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc19_17.3: = specific_function %.loc19_17.2, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %.loc19_17.3(%.loc19_16) [template = constants.%.29] +// CHECK:STDOUT: %.loc19_17.4: %i32 = value_of_initializer %int.convert_checked.loc19 [template = constants.%.29] +// CHECK:STDOUT: %.loc19_17.5: %i32 = converted %.loc19_16, %.loc19_17.4 [template = constants.%.29] +// CHECK:STDOUT: %a.loc19: %i32 = bind_name a, %.loc19_17.5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_generic.carbon b/toolchain/check/testdata/let/fail_generic.carbon index 9c30d50cafc3..3f78074dfe5e 100644 --- a/toolchain/check/testdata/let/fail_generic.carbon +++ b/toolchain/check/testdata/let/fail_generic.carbon @@ -31,17 +31,19 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: --- fail_generic.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -55,36 +57,39 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc12_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_9.1: type = value_of_initializer %int.make_type_32.loc12_9 [template = i32] -// CHECK:STDOUT: %.loc12_9.2: type = converted %int.make_type_32.loc12_9, %.loc12_9.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc12_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_17.1: type = value_of_initializer %int.make_type_32.loc12_17 [template = i32] -// CHECK:STDOUT: %.loc12_17.2: type = converted %int.make_type_32.loc12_17, %.loc12_17.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc12_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_9: init type = call constants.%Int(%.loc12_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_9.2: type = value_of_initializer %int.make_type_signed.loc12_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_9.3: type = converted %int.make_type_signed.loc12_9, %.loc12_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_17: init type = call constants.%Int(%.loc12_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_17.2: type = value_of_initializer %int.make_type_signed.loc12_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_17.3: type = converted %int.make_type_signed.loc12_17, %.loc12_17.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%a.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @F(%a.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_21.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_21.2: type = converted %int.make_type_32.loc13, %.loc13_21.1 [template = i32] +// CHECK:STDOUT: %.loc13_18: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_18) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_21.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_21.2: type = converted %int.make_type_signed.loc13, %.loc13_21.1 [template = constants.%i32] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0, %.loc13_21.2 [symbolic = constants.%T] // CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T] -// CHECK:STDOUT: %.loc21_14: Core.IntLiteral = int_value 5 [template = constants.%.1] +// CHECK:STDOUT: %.loc21_14: Core.IntLiteral = int_value 5 [template = constants.%.2] // CHECK:STDOUT: %.loc21_15: %T = converted %.loc21_14, [template = ] // CHECK:STDOUT: %x: %T = bind_name x, // CHECK:STDOUT: %x.ref: %T = name_ref x, %x -// CHECK:STDOUT: %.loc28: i32 = converted %x.ref, [template = ] +// CHECK:STDOUT: %.loc28: %i32 = converted %x.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_generic_import.carbon b/toolchain/check/testdata/let/fail_generic_import.carbon index 25ab3b5aba61..e8256c8e037a 100644 --- a/toolchain/check/testdata/let/fail_generic_import.carbon +++ b/toolchain/check/testdata/let/fail_generic_import.carbon @@ -31,13 +31,15 @@ let a: T = 0; // CHECK:STDOUT: --- fail_implicit.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -53,9 +55,10 @@ let a: T = 0; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_19.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_19.2: type = converted %int.make_type_32, %.loc8_19.1 [template = i32] +// CHECK:STDOUT: %.loc8_16: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_16) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_19.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_19.2: type = converted %int.make_type_signed, %.loc8_19.1 [template = constants.%i32] // CHECK:STDOUT: %T: type = bind_name T, %.loc8_19.2 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/fail_missing_value.carbon b/toolchain/check/testdata/let/fail_missing_value.carbon index 1c6e2092d754..8716d55f557f 100644 --- a/toolchain/check/testdata/let/fail_missing_value.carbon +++ b/toolchain/check/testdata/let/fail_missing_value.carbon @@ -24,15 +24,17 @@ fn F() { // CHECK:STDOUT: --- fail_missing_value.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -45,19 +47,21 @@ fn F() { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32, %.loc15_8.1 [template = i32] -// CHECK:STDOUT: %n: i32 = bind_name n, +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed, %.loc15_8.2 [template = constants.%i32] +// CHECK:STDOUT: %n: %i32 = bind_name n, // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc21_10.2: type = converted %int.make_type_32, %.loc21_10.1 [template = i32] -// CHECK:STDOUT: %n: i32 = bind_name n, +// CHECK:STDOUT: %.loc21_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc21_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc21_10.3: type = converted %int.make_type_signed, %.loc21_10.2 [template = constants.%i32] +// CHECK:STDOUT: %n: %i32 = bind_name n, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_modifiers.carbon b/toolchain/check/testdata/let/fail_modifiers.carbon index be6d805baf5d..0fce63bb9d61 100644 --- a/toolchain/check/testdata/let/fail_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_modifiers.carbon @@ -86,20 +86,23 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: --- fail_modifiers.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -119,90 +122,106 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: .i = @__global_init.%i // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_18.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_18.2: type = converted %int.make_type_32.loc15, %.loc15_18.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_16.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] -// CHECK:STDOUT: %.loc21_16.2: type = converted %int.make_type_32.loc21, %.loc21_16.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc27_14.1: type = value_of_initializer %int.make_type_32.loc27 [template = i32] -// CHECK:STDOUT: %.loc27_14.2: type = converted %int.make_type_32.loc27, %.loc27_14.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc33: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc33_16.1: type = value_of_initializer %int.make_type_32.loc33 [template = i32] -// CHECK:STDOUT: %.loc33_16.2: type = converted %int.make_type_32.loc33, %.loc33_16.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc46: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc46_22.1: type = value_of_initializer %int.make_type_32.loc46 [template = i32] -// CHECK:STDOUT: %.loc46_22.2: type = converted %int.make_type_32.loc46, %.loc46_22.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc59: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc59_24.1: type = value_of_initializer %int.make_type_32.loc59 [template = i32] -// CHECK:STDOUT: %.loc59_24.2: type = converted %int.make_type_32.loc59, %.loc59_24.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc72: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc72_26.1: type = value_of_initializer %int.make_type_32.loc72 [template = i32] -// CHECK:STDOUT: %.loc72_26.2: type = converted %int.make_type_32.loc72, %.loc72_26.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc84: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc84_28.1: type = value_of_initializer %int.make_type_32.loc84 [template = i32] -// CHECK:STDOUT: %.loc84_28.2: type = converted %int.make_type_32.loc84, %.loc84_28.1 [template = i32] +// CHECK:STDOUT: %.loc15_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_18.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_18.3: type = converted %int.make_type_signed.loc15, %.loc15_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%.loc21_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_16.2: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_16.3: type = converted %int.make_type_signed.loc21, %.loc21_16.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc27_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc27: init type = call constants.%Int(%.loc27_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc27_14.2: type = value_of_initializer %int.make_type_signed.loc27 [template = constants.%i32] +// CHECK:STDOUT: %.loc27_14.3: type = converted %int.make_type_signed.loc27, %.loc27_14.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc33_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc33: init type = call constants.%Int(%.loc33_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc33_16.2: type = value_of_initializer %int.make_type_signed.loc33 [template = constants.%i32] +// CHECK:STDOUT: %.loc33_16.3: type = converted %int.make_type_signed.loc33, %.loc33_16.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc46_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc46: init type = call constants.%Int(%.loc46_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc46_22.2: type = value_of_initializer %int.make_type_signed.loc46 [template = constants.%i32] +// CHECK:STDOUT: %.loc46_22.3: type = converted %int.make_type_signed.loc46, %.loc46_22.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc59_24.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc59: init type = call constants.%Int(%.loc59_24.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc59_24.2: type = value_of_initializer %int.make_type_signed.loc59 [template = constants.%i32] +// CHECK:STDOUT: %.loc59_24.3: type = converted %int.make_type_signed.loc59, %.loc59_24.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc72_26.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc72: init type = call constants.%Int(%.loc72_26.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc72_26.2: type = value_of_initializer %int.make_type_signed.loc72 [template = constants.%i32] +// CHECK:STDOUT: %.loc72_26.3: type = converted %int.make_type_signed.loc72, %.loc72_26.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc84_28.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc84: init type = call constants.%Int(%.loc84_28.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc84_28.2: type = value_of_initializer %int.make_type_signed.loc84 [template = constants.%i32] +// CHECK:STDOUT: %.loc84_28.3: type = converted %int.make_type_signed.loc84, %.loc84_28.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15_24: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc15_25.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_25.2: = bound_method %.loc15_24, %.loc15_25.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc15: init i32 = call %.loc15_25.2(%.loc15_24) [template = constants.%.27] -// CHECK:STDOUT: %.loc15_25.3: i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%.27] -// CHECK:STDOUT: %.loc15_25.4: i32 = converted %.loc15_24, %.loc15_25.3 [template = constants.%.27] -// CHECK:STDOUT: %b: i32 = bind_name b, %.loc15_25.4 -// CHECK:STDOUT: %.loc21_22: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc21_23.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc21_23.2: = bound_method %.loc21_22, %.loc21_23.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc21: init i32 = call %.loc21_23.2(%.loc21_22) [template = constants.%.27] -// CHECK:STDOUT: %.loc21_23.3: i32 = value_of_initializer %int.convert_checked.loc21 [template = constants.%.27] -// CHECK:STDOUT: %.loc21_23.4: i32 = converted %.loc21_22, %.loc21_23.3 [template = constants.%.27] -// CHECK:STDOUT: %c: i32 = bind_name c, %.loc21_23.4 -// CHECK:STDOUT: %.loc27_20: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc27_21.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc27_21.2: = bound_method %.loc27_20, %.loc27_21.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc27: init i32 = call %.loc27_21.2(%.loc27_20) [template = constants.%.27] -// CHECK:STDOUT: %.loc27_21.3: i32 = value_of_initializer %int.convert_checked.loc27 [template = constants.%.27] -// CHECK:STDOUT: %.loc27_21.4: i32 = converted %.loc27_20, %.loc27_21.3 [template = constants.%.27] -// CHECK:STDOUT: %d: i32 = bind_name d, %.loc27_21.4 -// CHECK:STDOUT: %.loc33_22: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc33_23.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc33_23.2: = bound_method %.loc33_22, %.loc33_23.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc33: init i32 = call %.loc33_23.2(%.loc33_22) [template = constants.%.27] -// CHECK:STDOUT: %.loc33_23.3: i32 = value_of_initializer %int.convert_checked.loc33 [template = constants.%.27] -// CHECK:STDOUT: %.loc33_23.4: i32 = converted %.loc33_22, %.loc33_23.3 [template = constants.%.27] -// CHECK:STDOUT: %e: i32 = bind_name e, %.loc33_23.4 -// CHECK:STDOUT: %.loc46_28: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc46_29.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc46_29.2: = bound_method %.loc46_28, %.loc46_29.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc46: init i32 = call %.loc46_29.2(%.loc46_28) [template = constants.%.27] -// CHECK:STDOUT: %.loc46_29.3: i32 = value_of_initializer %int.convert_checked.loc46 [template = constants.%.27] -// CHECK:STDOUT: %.loc46_29.4: i32 = converted %.loc46_28, %.loc46_29.3 [template = constants.%.27] -// CHECK:STDOUT: %f: i32 = bind_name f, %.loc46_29.4 -// CHECK:STDOUT: %.loc59_30: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc59_31.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc59_31.2: = bound_method %.loc59_30, %.loc59_31.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc59: init i32 = call %.loc59_31.2(%.loc59_30) [template = constants.%.27] -// CHECK:STDOUT: %.loc59_31.3: i32 = value_of_initializer %int.convert_checked.loc59 [template = constants.%.27] -// CHECK:STDOUT: %.loc59_31.4: i32 = converted %.loc59_30, %.loc59_31.3 [template = constants.%.27] -// CHECK:STDOUT: %g: i32 = bind_name g, %.loc59_31.4 -// CHECK:STDOUT: %.loc72_32: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc72_33.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc72_33.2: = bound_method %.loc72_32, %.loc72_33.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc72: init i32 = call %.loc72_33.2(%.loc72_32) [template = constants.%.27] -// CHECK:STDOUT: %.loc72_33.3: i32 = value_of_initializer %int.convert_checked.loc72 [template = constants.%.27] -// CHECK:STDOUT: %.loc72_33.4: i32 = converted %.loc72_32, %.loc72_33.3 [template = constants.%.27] -// CHECK:STDOUT: %h: i32 = bind_name h, %.loc72_33.4 -// CHECK:STDOUT: %.loc84_34: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc84_35.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc84_35.2: = bound_method %.loc84_34, %.loc84_35.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc84: init i32 = call %.loc84_35.2(%.loc84_34) [template = constants.%.27] -// CHECK:STDOUT: %.loc84_35.3: i32 = value_of_initializer %int.convert_checked.loc84 [template = constants.%.27] -// CHECK:STDOUT: %.loc84_35.4: i32 = converted %.loc84_34, %.loc84_35.3 [template = constants.%.27] -// CHECK:STDOUT: %i: i32 = bind_name i, %.loc84_35.4 +// CHECK:STDOUT: %.loc15_24: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_25.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_25.2: = bound_method %.loc15_24, %.loc15_25.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc15_25.3: = specific_function %.loc15_25.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %.loc15_25.3(%.loc15_24) [template = constants.%.25] +// CHECK:STDOUT: %.loc15_25.4: %i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%.25] +// CHECK:STDOUT: %.loc15_25.5: %i32 = converted %.loc15_24, %.loc15_25.4 [template = constants.%.25] +// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc15_25.5 +// CHECK:STDOUT: %.loc21_22: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc21_23.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc21_23.2: = bound_method %.loc21_22, %.loc21_23.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc21_23.3: = specific_function %.loc21_23.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %.loc21_23.3(%.loc21_22) [template = constants.%.25] +// CHECK:STDOUT: %.loc21_23.4: %i32 = value_of_initializer %int.convert_checked.loc21 [template = constants.%.25] +// CHECK:STDOUT: %.loc21_23.5: %i32 = converted %.loc21_22, %.loc21_23.4 [template = constants.%.25] +// CHECK:STDOUT: %c: %i32 = bind_name c, %.loc21_23.5 +// CHECK:STDOUT: %.loc27_20: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc27_21.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc27_21.2: = bound_method %.loc27_20, %.loc27_21.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc27_21.3: = specific_function %.loc27_21.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %.loc27_21.3(%.loc27_20) [template = constants.%.25] +// CHECK:STDOUT: %.loc27_21.4: %i32 = value_of_initializer %int.convert_checked.loc27 [template = constants.%.25] +// CHECK:STDOUT: %.loc27_21.5: %i32 = converted %.loc27_20, %.loc27_21.4 [template = constants.%.25] +// CHECK:STDOUT: %d: %i32 = bind_name d, %.loc27_21.5 +// CHECK:STDOUT: %.loc33_22: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc33_23.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc33_23.2: = bound_method %.loc33_22, %.loc33_23.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc33_23.3: = specific_function %.loc33_23.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc33: init %i32 = call %.loc33_23.3(%.loc33_22) [template = constants.%.25] +// CHECK:STDOUT: %.loc33_23.4: %i32 = value_of_initializer %int.convert_checked.loc33 [template = constants.%.25] +// CHECK:STDOUT: %.loc33_23.5: %i32 = converted %.loc33_22, %.loc33_23.4 [template = constants.%.25] +// CHECK:STDOUT: %e: %i32 = bind_name e, %.loc33_23.5 +// CHECK:STDOUT: %.loc46_28: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc46_29.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc46_29.2: = bound_method %.loc46_28, %.loc46_29.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc46_29.3: = specific_function %.loc46_29.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc46: init %i32 = call %.loc46_29.3(%.loc46_28) [template = constants.%.25] +// CHECK:STDOUT: %.loc46_29.4: %i32 = value_of_initializer %int.convert_checked.loc46 [template = constants.%.25] +// CHECK:STDOUT: %.loc46_29.5: %i32 = converted %.loc46_28, %.loc46_29.4 [template = constants.%.25] +// CHECK:STDOUT: %f: %i32 = bind_name f, %.loc46_29.5 +// CHECK:STDOUT: %.loc59_30: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc59_31.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc59_31.2: = bound_method %.loc59_30, %.loc59_31.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc59_31.3: = specific_function %.loc59_31.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc59: init %i32 = call %.loc59_31.3(%.loc59_30) [template = constants.%.25] +// CHECK:STDOUT: %.loc59_31.4: %i32 = value_of_initializer %int.convert_checked.loc59 [template = constants.%.25] +// CHECK:STDOUT: %.loc59_31.5: %i32 = converted %.loc59_30, %.loc59_31.4 [template = constants.%.25] +// CHECK:STDOUT: %g: %i32 = bind_name g, %.loc59_31.5 +// CHECK:STDOUT: %.loc72_32: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc72_33.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc72_33.2: = bound_method %.loc72_32, %.loc72_33.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc72_33.3: = specific_function %.loc72_33.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc72: init %i32 = call %.loc72_33.3(%.loc72_32) [template = constants.%.25] +// CHECK:STDOUT: %.loc72_33.4: %i32 = value_of_initializer %int.convert_checked.loc72 [template = constants.%.25] +// CHECK:STDOUT: %.loc72_33.5: %i32 = converted %.loc72_32, %.loc72_33.4 [template = constants.%.25] +// CHECK:STDOUT: %h: %i32 = bind_name h, %.loc72_33.5 +// CHECK:STDOUT: %.loc84_34: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc84_35.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc84_35.2: = bound_method %.loc84_34, %.loc84_35.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc84_35.3: = specific_function %.loc84_35.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc84: init %i32 = call %.loc84_35.3(%.loc84_34) [template = constants.%.25] +// CHECK:STDOUT: %.loc84_35.4: %i32 = value_of_initializer %int.convert_checked.loc84 [template = constants.%.25] +// CHECK:STDOUT: %.loc84_35.5: %i32 = converted %.loc84_34, %.loc84_35.4 [template = constants.%.25] +// CHECK:STDOUT: %i: %i32 = bind_name i, %.loc84_35.5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_use_in_init.carbon b/toolchain/check/testdata/let/fail_use_in_init.carbon index fd8284440e6d..6a3165c44a77 100644 --- a/toolchain/check/testdata/let/fail_use_in_init.carbon +++ b/toolchain/check/testdata/let/fail_use_in_init.carbon @@ -20,13 +20,15 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -43,11 +45,12 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_10.2: type = converted %int.make_type_32, %.loc15_10.1 [template = i32] +// CHECK:STDOUT: %.loc15_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_10.3: type = converted %int.make_type_signed, %.loc15_10.2 [template = constants.%i32] // CHECK:STDOUT: %a.ref: = name_ref a, [template = ] -// CHECK:STDOUT: %a: i32 = bind_name a, +// CHECK:STDOUT: %a: %i32 = bind_name a, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/generic.carbon b/toolchain/check/testdata/let/generic.carbon index 8d1dfe3734c3..98c7aee53eed 100644 --- a/toolchain/check/testdata/let/generic.carbon +++ b/toolchain/check/testdata/let/generic.carbon @@ -19,15 +19,17 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %.1: type = ptr_type %T [symbolic] +// CHECK:STDOUT: %.2: type = ptr_type %T [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -44,19 +46,20 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_21.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_21.2: type = converted %int.make_type_32, %.loc12_21.1 [template = i32] +// CHECK:STDOUT: %.loc12_18: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_18) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_21.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_21.2: type = converted %int.make_type_signed, %.loc12_21.1 [template = constants.%i32] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0, %.loc12_21.2 [symbolic = constants.%T] // CHECK:STDOUT: %T.ref.loc13: type = name_ref T, %T [symbolic = constants.%T] -// CHECK:STDOUT: %.loc13: type = ptr_type %T [symbolic = constants.%.1] -// CHECK:STDOUT: %p.var: ref %.1 = var p -// CHECK:STDOUT: %p: ref %.1 = bind_name p, %p.var +// CHECK:STDOUT: %.loc13: type = ptr_type %T [symbolic = constants.%.2] +// CHECK:STDOUT: %p.var: ref %.2 = var p +// CHECK:STDOUT: %p: ref %.2 = bind_name p, %p.var // CHECK:STDOUT: %T.ref.loc14: type = name_ref T, %T [symbolic = constants.%T] // CHECK:STDOUT: %a.var: ref %T = var a // CHECK:STDOUT: %a: ref %T = bind_name a, %a.var -// CHECK:STDOUT: %p.ref: ref %.1 = name_ref p, %p -// CHECK:STDOUT: %.loc14_15: %.1 = bind_value %p.ref +// CHECK:STDOUT: %p.ref: ref %.2 = name_ref p, %p +// CHECK:STDOUT: %.loc14_15: %.2 = bind_value %p.ref // CHECK:STDOUT: %.loc14_14.1: ref %T = deref %.loc14_15 // CHECK:STDOUT: %.loc14_14.2: %T = bind_value %.loc14_14.1 // CHECK:STDOUT: assign %a.var, %.loc14_14.2 diff --git a/toolchain/check/testdata/let/generic_import.carbon b/toolchain/check/testdata/let/generic_import.carbon index 5dbf3f110273..0587557570f3 100644 --- a/toolchain/check/testdata/let/generic_import.carbon +++ b/toolchain/check/testdata/let/generic_import.carbon @@ -35,13 +35,15 @@ var b: T = *a; // CHECK:STDOUT: --- fail_implicit.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -57,9 +59,10 @@ var b: T = *a; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_19.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_19.2: type = converted %int.make_type_32, %.loc8_19.1 [template = i32] +// CHECK:STDOUT: %.loc8_16: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_16) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_19.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_19.2: type = converted %int.make_type_signed, %.loc8_19.1 [template = constants.%i32] // CHECK:STDOUT: %T: type = bind_name T, %.loc8_19.2 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/global.carbon b/toolchain/check/testdata/let/global.carbon index 176348866c52..b1941024c915 100644 --- a/toolchain/check/testdata/let/global.carbon +++ b/toolchain/check/testdata/let/global.carbon @@ -15,22 +15,25 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: --- global.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -44,36 +47,39 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_32, %.loc11_8.1 [template = i32] +// CHECK:STDOUT: %.loc11_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_8.3: type = converted %int.make_type_signed, %.loc11_8.2 [template = constants.%i32] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_32, %.loc13_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc13_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_11.3: type = converted %int.make_type_signed, %.loc13_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32 { +// CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, @__global_init.%n +// CHECK:STDOUT: %n.ref: %i32 = name_ref n, @__global_init.%n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_15.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_15.2: = bound_method %.loc11_14, %.loc11_15.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc11_15.2(%.loc11_14) [template = constants.%.27] -// CHECK:STDOUT: %.loc11_15.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc11_15.4: i32 = converted %.loc11_14, %.loc11_15.3 [template = constants.%.27] -// CHECK:STDOUT: %n: i32 = bind_name n, %.loc11_15.4 +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_15.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_15.2: = bound_method %.loc11_14, %.loc11_15.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc11_15.3: = specific_function %.loc11_15.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc11_15.3(%.loc11_14) [template = constants.%.25] +// CHECK:STDOUT: %.loc11_15.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc11_15.5: %i32 = converted %.loc11_14, %.loc11_15.4 [template = constants.%.25] +// CHECK:STDOUT: %n: %i32 = bind_name n, %.loc11_15.5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/local.carbon b/toolchain/check/testdata/let/local.carbon index 6e230e6373b0..206ac6b4670a 100644 --- a/toolchain/check/testdata/let/local.carbon +++ b/toolchain/check/testdata/let/local.carbon @@ -16,15 +16,17 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: --- local.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -37,32 +39,35 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11_9, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17.1: type = value_of_initializer %int.make_type_32.loc11_17 [template = i32] -// CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_32.loc11_17, %.loc11_17.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%.loc11_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.3: type = converted %int.make_type_signed.loc11_9, %.loc11_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_17: init type = call constants.%Int(%.loc11_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_17, %.loc11_17.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%a.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @F(%a.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a -// CHECK:STDOUT: %b: i32 = bind_name b, %a.ref -// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed.loc12, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b: %i32 = bind_name b, %a.ref +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: return %b.ref // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/shadowed_decl.carbon b/toolchain/check/testdata/let/shadowed_decl.carbon index abdce43ea47a..040d6817d386 100644 --- a/toolchain/check/testdata/let/shadowed_decl.carbon +++ b/toolchain/check/testdata/let/shadowed_decl.carbon @@ -17,22 +17,25 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: --- shadowed_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -46,37 +49,41 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %a.patt: i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11_9, %.loc11_9.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17.1: type = value_of_initializer %int.make_type_32.loc11_17 [template = i32] -// CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_32.loc11_17, %.loc11_17.1 [template = i32] -// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %a.loc11: i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%.loc11_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_9.3: type = converted %int.make_type_signed.loc11_9, %.loc11_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_17: init type = call constants.%Int(%.loc11_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_17, %.loc11_17.2 [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a.loc11: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%a.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @F(%a.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_17.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_17.2: = bound_method %.loc12_16, %.loc12_17.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_17.2(%.loc12_16) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_17.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc12_17.4: i32 = converted %.loc12_16, %.loc12_17.3 [template = constants.%.27] -// CHECK:STDOUT: %a.loc12: i32 = bind_name a, %.loc12_17.4 -// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a.loc12 +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed.loc12, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_17.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_17.2: = bound_method %.loc12_16, %.loc12_17.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_17.3: = specific_function %.loc12_17.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc12_17.3(%.loc12_16) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_17.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc12_17.5: %i32 = converted %.loc12_16, %.loc12_17.4 [template = constants.%.25] +// CHECK:STDOUT: %a.loc12: %i32 = bind_name a, %.loc12_17.5 +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a.loc12 // CHECK:STDOUT: return %a.ref // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/add_to_import.carbon b/toolchain/check/testdata/namespace/add_to_import.carbon index d893f396ae67..47acdf4bb272 100644 --- a/toolchain/check/testdata/namespace/add_to_import.carbon +++ b/toolchain/check/testdata/namespace/add_to_import.carbon @@ -43,17 +43,20 @@ var a: i32 = NS.A(); // CHECK:STDOUT: --- implicit.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -62,7 +65,7 @@ var a: i32 = NS.A(); // CHECK:STDOUT: .A = file.%A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.2 +// CHECK:STDOUT: .Int = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -79,38 +82,41 @@ var a: i32 = NS.A(); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_14.2: type = converted %int.make_type_32, %.loc4_14.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc4_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_14.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_14.3: type = converted %int.make_type_signed, %.loc4_14.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32, %.loc6_8.1 [template = i32] -// CHECK:STDOUT: %a.var: ref i32 = var a -// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var +// CHECK:STDOUT: %.loc6_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc6_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.3: type = converted %int.make_type_signed, %.loc6_8.2 [template = constants.%i32] +// CHECK:STDOUT: %a.var: ref %i32 = var a +// CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @A() -> i32 { +// CHECK:STDOUT: fn @A() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc4_27: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_28.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_28.2: = bound_method %.loc4_27, %.loc4_28.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc4_28.2(%.loc4_27) [template = constants.%.27] -// CHECK:STDOUT: %.loc4_28.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc4_28.4: i32 = converted %.loc4_27, %.loc4_28.3 [template = constants.%.27] -// CHECK:STDOUT: return %.loc4_28.4 +// CHECK:STDOUT: %.loc4_27: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_28.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_28.2: = bound_method %.loc4_27, %.loc4_28.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc4_28.3: = specific_function %.loc4_28.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc4_28.3(%.loc4_27) [template = constants.%.25] +// CHECK:STDOUT: %.loc4_28.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc4_28.5: %i32 = converted %.loc4_27, %.loc4_28.4 [template = constants.%.25] +// CHECK:STDOUT: return %.loc4_28.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %A.call: init i32 = call %A.ref() +// CHECK:STDOUT: %A.call: init %i32 = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/alias.carbon b/toolchain/check/testdata/namespace/alias.carbon index 95c5b273090d..f98794d9541a 100644 --- a/toolchain/check/testdata/namespace/alias.carbon +++ b/toolchain/check/testdata/namespace/alias.carbon @@ -23,17 +23,20 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: --- alias.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %D.type: type = fn_type @D [template] @@ -42,7 +45,7 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -65,67 +68,71 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: %NS.ref.loc13: = name_ref NS, %NS [template = %NS] // CHECK:STDOUT: %ns: = bind_alias ns, %NS [template = %NS] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_14.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_14.2: type = converted %int.make_type_32, %.loc15_14.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc15_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_14.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_14.3: type = converted %int.make_type_signed, %.loc15_14.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc17_11.2: type = converted %int.make_type_32, %.loc17_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc17_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc17_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc17_11.3: type = converted %int.make_type_signed, %.loc17_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %NS.ref.loc19: = name_ref NS, %NS [template = %NS] // CHECK:STDOUT: %A.ref: %A.type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %C: %A.type = bind_alias C, %A.decl [template = constants.%A] // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc21_11.2: type = converted %int.make_type_32, %.loc21_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc21_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc21_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc21_11.3: type = converted %int.make_type_signed, %.loc21_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @A() -> i32 { +// CHECK:STDOUT: fn @A() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15_27: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc15_28.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_28.2: = bound_method %.loc15_27, %.loc15_28.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc15_28.2(%.loc15_27) [template = constants.%.27] -// CHECK:STDOUT: %.loc15_28.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc15_28.4: i32 = converted %.loc15_27, %.loc15_28.3 [template = constants.%.27] -// CHECK:STDOUT: return %.loc15_28.4 +// CHECK:STDOUT: %.loc15_27: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_28.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_28.2: = bound_method %.loc15_27, %.loc15_28.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc15_28.3: = specific_function %.loc15_28.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc15_28.3(%.loc15_27) [template = constants.%.25] +// CHECK:STDOUT: %.loc15_28.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc15_28.5: %i32 = converted %.loc15_27, %.loc15_28.4 [template = constants.%.25] +// CHECK:STDOUT: return %.loc15_28.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @B() -> i32 { +// CHECK:STDOUT: fn @B() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %ns.ref: = name_ref ns, file.%ns [template = file.%NS] // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %A.call: init i32 = call %A.ref() -// CHECK:STDOUT: %.loc17_30.1: i32 = value_of_initializer %A.call -// CHECK:STDOUT: %.loc17_30.2: i32 = converted %A.call, %.loc17_30.1 +// CHECK:STDOUT: %A.call: init %i32 = call %A.ref() +// CHECK:STDOUT: %.loc17_30.1: %i32 = value_of_initializer %A.call +// CHECK:STDOUT: %.loc17_30.2: %i32 = converted %A.call, %.loc17_30.1 // CHECK:STDOUT: return %.loc17_30.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @D() -> i32 { +// CHECK:STDOUT: fn @D() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref: %A.type = name_ref C, file.%C [template = constants.%A] -// CHECK:STDOUT: %A.call: init i32 = call %C.ref() -// CHECK:STDOUT: %.loc21_27.1: i32 = value_of_initializer %A.call -// CHECK:STDOUT: %.loc21_27.2: i32 = converted %A.call, %.loc21_27.1 +// CHECK:STDOUT: %A.call: init %i32 = call %C.ref() +// CHECK:STDOUT: %.loc21_27.1: %i32 = value_of_initializer %A.call +// CHECK:STDOUT: %.loc21_27.2: %i32 = converted %A.call, %.loc21_27.1 // CHECK:STDOUT: return %.loc21_27.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon index d2c7cc15c3ba..546c9e6967a0 100644 --- a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon +++ b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon @@ -24,22 +24,25 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: --- fail_decl_in_alias.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] -// CHECK:STDOUT: %.1: %.type = struct_value () [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 0 [template] +// CHECK:STDOUT: %.2: %.type = struct_value () [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -56,26 +59,28 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: %NS: = namespace [template] {} // CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] // CHECK:STDOUT: %ns: = bind_alias ns, %NS [template = %NS] -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.1] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] { +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_14.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc22_14.2: type = converted %int.make_type_32, %.loc22_14.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc22_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc22_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc22_14.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc22_14.3: type = converted %int.make_type_signed, %.loc22_14.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @.1() -> i32 { +// CHECK:STDOUT: fn @.1() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc22_27: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc22_28.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc22_28.2: = bound_method %.loc22_27, %.loc22_28.1 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc22_28.2(%.loc22_27) [template = constants.%.28] -// CHECK:STDOUT: %.loc22_28.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.28] -// CHECK:STDOUT: %.loc22_28.4: i32 = converted %.loc22_27, %.loc22_28.3 [template = constants.%.28] -// CHECK:STDOUT: return %.loc22_28.4 +// CHECK:STDOUT: %.loc22_27: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc22_28.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc22_28.2: = bound_method %.loc22_27, %.loc22_28.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc22_28.3: = specific_function %.loc22_28.2, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc22_28.3(%.loc22_27) [template = constants.%.26] +// CHECK:STDOUT: %.loc22_28.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.26] +// CHECK:STDOUT: %.loc22_28.5: %i32 = converted %.loc22_27, %.loc22_28.4 [template = constants.%.26] +// CHECK:STDOUT: return %.loc22_28.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/fail_params.carbon b/toolchain/check/testdata/namespace/fail_params.carbon index 938491317a54..67d58e40c946 100644 --- a/toolchain/check/testdata/namespace/fail_params.carbon +++ b/toolchain/check/testdata/namespace/fail_params.carbon @@ -43,17 +43,19 @@ fn D(T:! type).F() {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] -// CHECK:STDOUT: %.1: %.type = struct_value () [template] +// CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -72,11 +74,12 @@ fn D(T:! type).F() {} // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc24_16.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc24_16.2: type = converted %int.make_type_32, %.loc24_16.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %.loc24_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc24_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc24_16.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc24_16.3: type = converted %int.make_type_signed, %.loc24_16.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %B: = namespace [template] {} // CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T] // CHECK:STDOUT: %T.param: type = value_param runtime_param @@ -85,7 +88,7 @@ fn D(T:! type).F() {} // CHECK:STDOUT: %x: %T = bind_name x, %x.param // CHECK:STDOUT: %C: = namespace [template] {} // CHECK:STDOUT: %D: = namespace [template] {} -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.1] {} { +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} { // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc39_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc39_6.2 (constants.%T)] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/shadow.carbon b/toolchain/check/testdata/namespace/shadow.carbon index 258cbb6b9b3f..d8029baef49d 100644 --- a/toolchain/check/testdata/namespace/shadow.carbon +++ b/toolchain/check/testdata/namespace/shadow.carbon @@ -35,23 +35,26 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %A.1: %A.type.1 = struct_value () [template] // CHECK:STDOUT: %A.type.2: type = fn_type @A.2 [template] // CHECK:STDOUT: %A.2: %A.type.2 = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] -// CHECK:STDOUT: %.1: bool = bool_literal true [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 0 [template] +// CHECK:STDOUT: %.2: bool = bool_literal true [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -75,14 +78,15 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_15.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] -// CHECK:STDOUT: %.loc18_15.2: type = converted %int.make_type_32.loc18, %.loc18_15.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc18_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%.loc18_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_15.2: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_15.3: type = converted %int.make_type_signed.loc18, %.loc18_15.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -90,36 +94,39 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @A.2(); // CHECK:STDOUT: -// CHECK:STDOUT: fn @B() -> i32 { +// CHECK:STDOUT: fn @B() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %A.ref.loc20: %A.type.2 = name_ref A, file.%A.decl.loc14 [template = constants.%A.2] // CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.ref.loc20() -// CHECK:STDOUT: %.loc21: bool = bool_literal true [template = constants.%.1] +// CHECK:STDOUT: %.loc21: bool = bool_literal true [template = constants.%.2] // CHECK:STDOUT: if %.loc21 br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_12.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] -// CHECK:STDOUT: %.loc22_12.2: type = converted %int.make_type_32.loc22, %.loc22_12.1 [template = i32] -// CHECK:STDOUT: %A.var: ref i32 = var A -// CHECK:STDOUT: %A: ref i32 = bind_name A, %A.var -// CHECK:STDOUT: %.loc22_18: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc22_19.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc22_19.2: = bound_method %.loc22_18, %.loc22_19.1 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc22: init i32 = call %.loc22_19.2(%.loc22_18) [template = constants.%.28] -// CHECK:STDOUT: %.loc22_19.3: init i32 = converted %.loc22_18, %int.convert_checked.loc22 [template = constants.%.28] -// CHECK:STDOUT: assign %A.var, %.loc22_19.3 -// CHECK:STDOUT: %A.ref.loc25: ref i32 = name_ref A, %A -// CHECK:STDOUT: %.loc25: i32 = bind_value %A.ref.loc25 +// CHECK:STDOUT: %.loc22_12.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%.loc22_12.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc22_12.2: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] +// CHECK:STDOUT: %.loc22_12.3: type = converted %int.make_type_signed.loc22, %.loc22_12.2 [template = constants.%i32] +// CHECK:STDOUT: %A.var: ref %i32 = var A +// CHECK:STDOUT: %A: ref %i32 = bind_name A, %A.var +// CHECK:STDOUT: %.loc22_18: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc22_19.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc22_19.2: = bound_method %.loc22_18, %.loc22_19.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc22_19.3: = specific_function %.loc22_19.2, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc22: init %i32 = call %.loc22_19.3(%.loc22_18) [template = constants.%.26] +// CHECK:STDOUT: %.loc22_19.4: init %i32 = converted %.loc22_18, %int.convert_checked.loc22 [template = constants.%.26] +// CHECK:STDOUT: assign %A.var, %.loc22_19.4 +// CHECK:STDOUT: %A.ref.loc25: ref %i32 = name_ref A, %A +// CHECK:STDOUT: %.loc25: %i32 = bind_value %A.ref.loc25 // CHECK:STDOUT: return %.loc25 // CHECK:STDOUT: // CHECK:STDOUT: !if.else: -// CHECK:STDOUT: %.loc27_10: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc27_11.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc27_11.2: = bound_method %.loc27_10, %.loc27_11.1 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc27: init i32 = call %.loc27_11.2(%.loc27_10) [template = constants.%.28] -// CHECK:STDOUT: %.loc27_11.3: i32 = value_of_initializer %int.convert_checked.loc27 [template = constants.%.28] -// CHECK:STDOUT: %.loc27_11.4: i32 = converted %.loc27_10, %.loc27_11.3 [template = constants.%.28] -// CHECK:STDOUT: return %.loc27_11.4 +// CHECK:STDOUT: %.loc27_10: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc27_11.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc27_11.2: = bound_method %.loc27_10, %.loc27_11.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc27_11.3: = specific_function %.loc27_11.2, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %.loc27_11.3(%.loc27_10) [template = constants.%.26] +// CHECK:STDOUT: %.loc27_11.4: %i32 = value_of_initializer %int.convert_checked.loc27 [template = constants.%.26] +// CHECK:STDOUT: %.loc27_11.5: %i32 = converted %.loc27_10, %.loc27_11.4 [template = constants.%.26] +// CHECK:STDOUT: return %.loc27_11.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/assignment.carbon b/toolchain/check/testdata/operators/builtin/assignment.carbon index 43938e15e9b2..ef4e3cdb6893 100644 --- a/toolchain/check/testdata/operators/builtin/assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/assignment.carbon @@ -31,51 +31,61 @@ fn Main() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 12 [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 9 [template] -// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 9 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 12 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 9 [template] +// CHECK:STDOUT: %.27: = bound_method %.26, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 9 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.33: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.34: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.35: i32 = int_value 1 [template] -// CHECK:STDOUT: %.36: = bound_method %.33, %Convert.15 [template] -// CHECK:STDOUT: %.37: i32 = int_value 2 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.35, %.37) [template] -// CHECK:STDOUT: %.38: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.39: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.40: = bound_method %.39, %Convert.15 [template] -// CHECK:STDOUT: %.41: i32 = int_value 3 [template] -// CHECK:STDOUT: %.42: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %.43: = bound_method %.42, %Convert.15 [template] -// CHECK:STDOUT: %.44: i32 = int_value 4 [template] -// CHECK:STDOUT: %.45: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.47: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %struct: %.45 = struct_value (%.35, %.37) [template] -// CHECK:STDOUT: %.48: type = ptr_type i32 [template] -// CHECK:STDOUT: %.49: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %.50: = bound_method %.49, %Convert.15 [template] -// CHECK:STDOUT: %.51: i32 = int_value 5 [template] -// CHECK:STDOUT: %.52: bool = bool_literal true [template] -// CHECK:STDOUT: %.53: Core.IntLiteral = int_value 10 [template] -// CHECK:STDOUT: %.54: = bound_method %.53, %Convert.15 [template] -// CHECK:STDOUT: %.55: i32 = int_value 10 [template] +// CHECK:STDOUT: %.33: = bound_method %.31, %Convert.14 [template] +// CHECK:STDOUT: %.34: = specific_function %.33, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.35: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.36: = bound_method %.32, %Convert.14 [template] +// CHECK:STDOUT: %.37: = specific_function %.36, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.38: %i32 = int_value 2 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.35, %.38) [template] +// CHECK:STDOUT: %.39: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.40: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.41: = bound_method %.40, %Convert.14 [template] +// CHECK:STDOUT: %.42: = specific_function %.41, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.43: %i32 = int_value 3 [template] +// CHECK:STDOUT: %.44: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.45: = bound_method %.44, %Convert.14 [template] +// CHECK:STDOUT: %.46: = specific_function %.45, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.47: %i32 = int_value 4 [template] +// CHECK:STDOUT: %.48: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %.50: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %struct: %.48 = struct_value (%.35, %.38) [template] +// CHECK:STDOUT: %.51: type = ptr_type %i32 [template] +// CHECK:STDOUT: %.52: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.53: = bound_method %.52, %Convert.14 [template] +// CHECK:STDOUT: %.54: = specific_function %.53, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.55: %i32 = int_value 5 [template] +// CHECK:STDOUT: %.56: bool = bool_literal true [template] +// CHECK:STDOUT: %.57: Core.IntLiteral = int_value 10 [template] +// CHECK:STDOUT: %.58: = bound_method %.57, %Convert.14 [template] +// CHECK:STDOUT: %.59: = specific_function %.58, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.60: %i32 = int_value 10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -93,153 +103,171 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %a.var: ref i32 = var a -// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var -// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 12 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_18.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_18.2: = bound_method %.loc12_16, %.loc12_18.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc12: init i32 = call %.loc12_18.2(%.loc12_16) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_18.3: init i32 = converted %.loc12_16, %int.convert_checked.loc12 [template = constants.%.27] -// CHECK:STDOUT: assign %a.var, %.loc12_18.3 -// CHECK:STDOUT: %a.ref.loc13: ref i32 = name_ref a, %a -// CHECK:STDOUT: %.loc13_7: Core.IntLiteral = int_value 9 [template = constants.%.28] -// CHECK:STDOUT: %.loc13_5.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_5.2: = bound_method %.loc13_7, %.loc13_5.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked.loc13: init i32 = call %.loc13_5.2(%.loc13_7) [template = constants.%.30] -// CHECK:STDOUT: %.loc13_5.3: init i32 = converted %.loc13_7, %int.convert_checked.loc13 [template = constants.%.30] -// CHECK:STDOUT: assign %a.ref.loc13, %.loc13_5.3 -// CHECK:STDOUT: %int.make_type_32.loc15_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc15_16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_19.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc15_11, %int.make_type_32.loc15_16) -// CHECK:STDOUT: %.loc15_19.2: type = value_of_initializer %int.make_type_32.loc15_11 [template = i32] -// CHECK:STDOUT: %.loc15_19.3: type = converted %int.make_type_32.loc15_11, %.loc15_19.2 [template = i32] -// CHECK:STDOUT: %.loc15_19.4: type = value_of_initializer %int.make_type_32.loc15_16 [template = i32] -// CHECK:STDOUT: %.loc15_19.5: type = converted %int.make_type_32.loc15_16, %.loc15_19.4 [template = i32] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed.loc12, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %a.var: ref %i32 = var a +// CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var +// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 12 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_18.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_18.2: = bound_method %.loc12_16, %.loc12_18.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_18.3: = specific_function %.loc12_18.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %.loc12_18.3(%.loc12_16) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_18.4: init %i32 = converted %.loc12_16, %int.convert_checked.loc12 [template = constants.%.25] +// CHECK:STDOUT: assign %a.var, %.loc12_18.4 +// CHECK:STDOUT: %a.ref.loc13: ref %i32 = name_ref a, %a +// CHECK:STDOUT: %.loc13_7: Core.IntLiteral = int_value 9 [template = constants.%.26] +// CHECK:STDOUT: %.loc13_5.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_5.2: = bound_method %.loc13_7, %.loc13_5.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc13_5.3: = specific_function %.loc13_5.2, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %.loc13_5.3(%.loc13_7) [template = constants.%.29] +// CHECK:STDOUT: %.loc13_5.4: init %i32 = converted %.loc13_7, %int.convert_checked.loc13 [template = constants.%.29] +// CHECK:STDOUT: assign %a.ref.loc13, %.loc13_5.4 +// CHECK:STDOUT: %.loc15_11: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15_11: init type = call constants.%Int(%.loc15_11) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_16: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15_16: init type = call constants.%Int(%.loc15_16) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_19.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc15_11, %int.make_type_signed.loc15_16) +// CHECK:STDOUT: %.loc15_19.2: type = value_of_initializer %int.make_type_signed.loc15_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_19.3: type = converted %int.make_type_signed.loc15_11, %.loc15_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_19.4: type = value_of_initializer %int.make_type_signed.loc15_16 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_19.5: type = converted %int.make_type_signed.loc15_16, %.loc15_19.4 [template = constants.%i32] // CHECK:STDOUT: %.loc15_19.6: type = converted %.loc15_19.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %b.var: ref %tuple.type.2 = var b // CHECK:STDOUT: %b: ref %tuple.type.2 = bind_name b, %b.var -// CHECK:STDOUT: %.loc15_24: Core.IntLiteral = int_value 1 [template = constants.%.32] -// CHECK:STDOUT: %.loc15_27: Core.IntLiteral = int_value 2 [template = constants.%.33] +// CHECK:STDOUT: %.loc15_24: Core.IntLiteral = int_value 1 [template = constants.%.31] +// CHECK:STDOUT: %.loc15_27: Core.IntLiteral = int_value 2 [template = constants.%.32] // CHECK:STDOUT: %.loc15_28.1: %tuple.type.3 = tuple_literal (%.loc15_24, %.loc15_27) -// CHECK:STDOUT: %.loc15_28.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_28.3: = bound_method %.loc15_24, %.loc15_28.2 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc15_28.1: init i32 = call %.loc15_28.3(%.loc15_24) [template = constants.%.35] -// CHECK:STDOUT: %.loc15_28.4: init i32 = converted %.loc15_24, %int.convert_checked.loc15_28.1 [template = constants.%.35] -// CHECK:STDOUT: %.loc15_28.5: ref i32 = tuple_access %b.var, element0 -// CHECK:STDOUT: %.loc15_28.6: init i32 = initialize_from %.loc15_28.4 to %.loc15_28.5 [template = constants.%.35] -// CHECK:STDOUT: %.loc15_28.7: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc15_28.8: = bound_method %.loc15_27, %.loc15_28.7 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc15_28.2: init i32 = call %.loc15_28.8(%.loc15_27) [template = constants.%.37] -// CHECK:STDOUT: %.loc15_28.9: init i32 = converted %.loc15_27, %int.convert_checked.loc15_28.2 [template = constants.%.37] -// CHECK:STDOUT: %.loc15_28.10: ref i32 = tuple_access %b.var, element1 -// CHECK:STDOUT: %.loc15_28.11: init i32 = initialize_from %.loc15_28.9 to %.loc15_28.10 [template = constants.%.37] -// CHECK:STDOUT: %.loc15_28.12: init %tuple.type.2 = tuple_init (%.loc15_28.6, %.loc15_28.11) to %b.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc15_29: init %tuple.type.2 = converted %.loc15_28.1, %.loc15_28.12 [template = constants.%tuple] +// CHECK:STDOUT: %.loc15_28.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_28.3: = bound_method %.loc15_24, %.loc15_28.2 [template = constants.%.33] +// CHECK:STDOUT: %.loc15_28.4: = specific_function %.loc15_28.3, @Convert.2(constants.%.1) [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked.loc15_28.1: init %i32 = call %.loc15_28.4(%.loc15_24) [template = constants.%.35] +// CHECK:STDOUT: %.loc15_28.5: init %i32 = converted %.loc15_24, %int.convert_checked.loc15_28.1 [template = constants.%.35] +// CHECK:STDOUT: %.loc15_28.6: ref %i32 = tuple_access %b.var, element0 +// CHECK:STDOUT: %.loc15_28.7: init %i32 = initialize_from %.loc15_28.5 to %.loc15_28.6 [template = constants.%.35] +// CHECK:STDOUT: %.loc15_28.8: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc15_28.9: = bound_method %.loc15_27, %.loc15_28.8 [template = constants.%.36] +// CHECK:STDOUT: %.loc15_28.10: = specific_function %.loc15_28.9, @Convert.2(constants.%.1) [template = constants.%.37] +// CHECK:STDOUT: %int.convert_checked.loc15_28.2: init %i32 = call %.loc15_28.10(%.loc15_27) [template = constants.%.38] +// CHECK:STDOUT: %.loc15_28.11: init %i32 = converted %.loc15_27, %int.convert_checked.loc15_28.2 [template = constants.%.38] +// CHECK:STDOUT: %.loc15_28.12: ref %i32 = tuple_access %b.var, element1 +// CHECK:STDOUT: %.loc15_28.13: init %i32 = initialize_from %.loc15_28.11 to %.loc15_28.12 [template = constants.%.38] +// CHECK:STDOUT: %.loc15_28.14: init %tuple.type.2 = tuple_init (%.loc15_28.7, %.loc15_28.13) to %b.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc15_29: init %tuple.type.2 = converted %.loc15_28.1, %.loc15_28.14 [template = constants.%tuple] // CHECK:STDOUT: assign %b.var, %.loc15_29 // CHECK:STDOUT: %b.ref.loc16: ref %tuple.type.2 = name_ref b, %b -// CHECK:STDOUT: %.loc16_5: Core.IntLiteral = int_value 0 [template = constants.%.38] -// CHECK:STDOUT: %.loc16_4: ref i32 = tuple_access %b.ref.loc16, element0 -// CHECK:STDOUT: %.loc16_9: Core.IntLiteral = int_value 3 [template = constants.%.39] -// CHECK:STDOUT: %.loc16_7.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_7.2: = bound_method %.loc16_9, %.loc16_7.1 [template = constants.%.40] -// CHECK:STDOUT: %int.convert_checked.loc16: init i32 = call %.loc16_7.2(%.loc16_9) [template = constants.%.41] -// CHECK:STDOUT: %.loc16_7.3: init i32 = converted %.loc16_9, %int.convert_checked.loc16 [template = constants.%.41] -// CHECK:STDOUT: assign %.loc16_4, %.loc16_7.3 +// CHECK:STDOUT: %.loc16_5: Core.IntLiteral = int_value 0 [template = constants.%.39] +// CHECK:STDOUT: %.loc16_4: ref %i32 = tuple_access %b.ref.loc16, element0 +// CHECK:STDOUT: %.loc16_9: Core.IntLiteral = int_value 3 [template = constants.%.40] +// CHECK:STDOUT: %.loc16_7.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc16_7.2: = bound_method %.loc16_9, %.loc16_7.1 [template = constants.%.41] +// CHECK:STDOUT: %.loc16_7.3: = specific_function %.loc16_7.2, @Convert.2(constants.%.1) [template = constants.%.42] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %.loc16_7.3(%.loc16_9) [template = constants.%.43] +// CHECK:STDOUT: %.loc16_7.4: init %i32 = converted %.loc16_9, %int.convert_checked.loc16 [template = constants.%.43] +// CHECK:STDOUT: assign %.loc16_4, %.loc16_7.4 // CHECK:STDOUT: %b.ref.loc17: ref %tuple.type.2 = name_ref b, %b -// CHECK:STDOUT: %.loc17_5: Core.IntLiteral = int_value 1 [template = constants.%.32] -// CHECK:STDOUT: %.loc17_4: ref i32 = tuple_access %b.ref.loc17, element1 -// CHECK:STDOUT: %.loc17_9: Core.IntLiteral = int_value 4 [template = constants.%.42] -// CHECK:STDOUT: %.loc17_7.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc17_7.2: = bound_method %.loc17_9, %.loc17_7.1 [template = constants.%.43] -// CHECK:STDOUT: %int.convert_checked.loc17: init i32 = call %.loc17_7.2(%.loc17_9) [template = constants.%.44] -// CHECK:STDOUT: %.loc17_7.3: init i32 = converted %.loc17_9, %int.convert_checked.loc17 [template = constants.%.44] -// CHECK:STDOUT: assign %.loc17_4, %.loc17_7.3 -// CHECK:STDOUT: %int.make_type_32.loc19_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_15.1: type = value_of_initializer %int.make_type_32.loc19_15 [template = i32] -// CHECK:STDOUT: %.loc19_15.2: type = converted %int.make_type_32.loc19_15, %.loc19_15.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc19_24: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_24.1: type = value_of_initializer %int.make_type_32.loc19_24 [template = i32] -// CHECK:STDOUT: %.loc19_24.2: type = converted %int.make_type_32.loc19_24, %.loc19_24.1 [template = i32] -// CHECK:STDOUT: %.loc19_27: type = struct_type {.a: i32, .b: i32} [template = constants.%.45] -// CHECK:STDOUT: %c.var: ref %.45 = var c -// CHECK:STDOUT: %c: ref %.45 = bind_name c, %c.var -// CHECK:STDOUT: %.loc19_37: Core.IntLiteral = int_value 1 [template = constants.%.32] -// CHECK:STDOUT: %.loc19_45: Core.IntLiteral = int_value 2 [template = constants.%.33] -// CHECK:STDOUT: %.loc19_46.1: %.47 = struct_literal (%.loc19_37, %.loc19_45) -// CHECK:STDOUT: %.loc19_46.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc19_46.3: = bound_method %.loc19_37, %.loc19_46.2 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc19_46.1: init i32 = call %.loc19_46.3(%.loc19_37) [template = constants.%.35] -// CHECK:STDOUT: %.loc19_46.4: init i32 = converted %.loc19_37, %int.convert_checked.loc19_46.1 [template = constants.%.35] -// CHECK:STDOUT: %.loc19_46.5: ref i32 = struct_access %c.var, element0 -// CHECK:STDOUT: %.loc19_46.6: init i32 = initialize_from %.loc19_46.4 to %.loc19_46.5 [template = constants.%.35] -// CHECK:STDOUT: %.loc19_46.7: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc19_46.8: = bound_method %.loc19_45, %.loc19_46.7 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc19_46.2: init i32 = call %.loc19_46.8(%.loc19_45) [template = constants.%.37] -// CHECK:STDOUT: %.loc19_46.9: init i32 = converted %.loc19_45, %int.convert_checked.loc19_46.2 [template = constants.%.37] -// CHECK:STDOUT: %.loc19_46.10: ref i32 = struct_access %c.var, element1 -// CHECK:STDOUT: %.loc19_46.11: init i32 = initialize_from %.loc19_46.9 to %.loc19_46.10 [template = constants.%.37] -// CHECK:STDOUT: %.loc19_46.12: init %.45 = struct_init (%.loc19_46.6, %.loc19_46.11) to %c.var [template = constants.%struct] -// CHECK:STDOUT: %.loc19_47: init %.45 = converted %.loc19_46.1, %.loc19_46.12 [template = constants.%struct] +// CHECK:STDOUT: %.loc17_5: Core.IntLiteral = int_value 1 [template = constants.%.31] +// CHECK:STDOUT: %.loc17_4: ref %i32 = tuple_access %b.ref.loc17, element1 +// CHECK:STDOUT: %.loc17_9: Core.IntLiteral = int_value 4 [template = constants.%.44] +// CHECK:STDOUT: %.loc17_7.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc17_7.2: = bound_method %.loc17_9, %.loc17_7.1 [template = constants.%.45] +// CHECK:STDOUT: %.loc17_7.3: = specific_function %.loc17_7.2, @Convert.2(constants.%.1) [template = constants.%.46] +// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %.loc17_7.3(%.loc17_9) [template = constants.%.47] +// CHECK:STDOUT: %.loc17_7.4: init %i32 = converted %.loc17_9, %int.convert_checked.loc17 [template = constants.%.47] +// CHECK:STDOUT: assign %.loc17_4, %.loc17_7.4 +// CHECK:STDOUT: %.loc19_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19_15: init type = call constants.%Int(%.loc19_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_15.2: type = value_of_initializer %int.make_type_signed.loc19_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_15.3: type = converted %int.make_type_signed.loc19_15, %.loc19_15.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_24.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19_24: init type = call constants.%Int(%.loc19_24.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_24.2: type = value_of_initializer %int.make_type_signed.loc19_24 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_24.3: type = converted %int.make_type_signed.loc19_24, %.loc19_24.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_27: type = struct_type {.a: %i32, .b: %i32} [template = constants.%.48] +// CHECK:STDOUT: %c.var: ref %.48 = var c +// CHECK:STDOUT: %c: ref %.48 = bind_name c, %c.var +// CHECK:STDOUT: %.loc19_37: Core.IntLiteral = int_value 1 [template = constants.%.31] +// CHECK:STDOUT: %.loc19_45: Core.IntLiteral = int_value 2 [template = constants.%.32] +// CHECK:STDOUT: %.loc19_46.1: %.50 = struct_literal (%.loc19_37, %.loc19_45) +// CHECK:STDOUT: %.loc19_46.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc19_46.3: = bound_method %.loc19_37, %.loc19_46.2 [template = constants.%.33] +// CHECK:STDOUT: %.loc19_46.4: = specific_function %.loc19_46.3, @Convert.2(constants.%.1) [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked.loc19_46.1: init %i32 = call %.loc19_46.4(%.loc19_37) [template = constants.%.35] +// CHECK:STDOUT: %.loc19_46.5: init %i32 = converted %.loc19_37, %int.convert_checked.loc19_46.1 [template = constants.%.35] +// CHECK:STDOUT: %.loc19_46.6: ref %i32 = struct_access %c.var, element0 +// CHECK:STDOUT: %.loc19_46.7: init %i32 = initialize_from %.loc19_46.5 to %.loc19_46.6 [template = constants.%.35] +// CHECK:STDOUT: %.loc19_46.8: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc19_46.9: = bound_method %.loc19_45, %.loc19_46.8 [template = constants.%.36] +// CHECK:STDOUT: %.loc19_46.10: = specific_function %.loc19_46.9, @Convert.2(constants.%.1) [template = constants.%.37] +// CHECK:STDOUT: %int.convert_checked.loc19_46.2: init %i32 = call %.loc19_46.10(%.loc19_45) [template = constants.%.38] +// CHECK:STDOUT: %.loc19_46.11: init %i32 = converted %.loc19_45, %int.convert_checked.loc19_46.2 [template = constants.%.38] +// CHECK:STDOUT: %.loc19_46.12: ref %i32 = struct_access %c.var, element1 +// CHECK:STDOUT: %.loc19_46.13: init %i32 = initialize_from %.loc19_46.11 to %.loc19_46.12 [template = constants.%.38] +// CHECK:STDOUT: %.loc19_46.14: init %.48 = struct_init (%.loc19_46.7, %.loc19_46.13) to %c.var [template = constants.%struct] +// CHECK:STDOUT: %.loc19_47: init %.48 = converted %.loc19_46.1, %.loc19_46.14 [template = constants.%struct] // CHECK:STDOUT: assign %c.var, %.loc19_47 -// CHECK:STDOUT: %c.ref.loc20: ref %.45 = name_ref c, %c -// CHECK:STDOUT: %.loc20_4: ref i32 = struct_access %c.ref.loc20, element0 -// CHECK:STDOUT: %.loc20_9: Core.IntLiteral = int_value 3 [template = constants.%.39] -// CHECK:STDOUT: %.loc20_7.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc20_7.2: = bound_method %.loc20_9, %.loc20_7.1 [template = constants.%.40] -// CHECK:STDOUT: %int.convert_checked.loc20: init i32 = call %.loc20_7.2(%.loc20_9) [template = constants.%.41] -// CHECK:STDOUT: %.loc20_7.3: init i32 = converted %.loc20_9, %int.convert_checked.loc20 [template = constants.%.41] -// CHECK:STDOUT: assign %.loc20_4, %.loc20_7.3 -// CHECK:STDOUT: %c.ref.loc21: ref %.45 = name_ref c, %c -// CHECK:STDOUT: %.loc21_4: ref i32 = struct_access %c.ref.loc21, element1 -// CHECK:STDOUT: %.loc21_9: Core.IntLiteral = int_value 4 [template = constants.%.42] -// CHECK:STDOUT: %.loc21_7.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc21_7.2: = bound_method %.loc21_9, %.loc21_7.1 [template = constants.%.43] -// CHECK:STDOUT: %int.convert_checked.loc21: init i32 = call %.loc21_7.2(%.loc21_9) [template = constants.%.44] -// CHECK:STDOUT: %.loc21_7.3: init i32 = converted %.loc21_9, %int.convert_checked.loc21 [template = constants.%.44] -// CHECK:STDOUT: assign %.loc21_4, %.loc21_7.3 -// CHECK:STDOUT: %int.make_type_32.loc23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_13.1: type = value_of_initializer %int.make_type_32.loc23 [template = i32] -// CHECK:STDOUT: %.loc23_13.2: type = converted %int.make_type_32.loc23, %.loc23_13.1 [template = i32] -// CHECK:STDOUT: %.loc23_13.3: type = ptr_type i32 [template = constants.%.48] -// CHECK:STDOUT: %p.var: ref %.48 = var p -// CHECK:STDOUT: %p: ref %.48 = bind_name p, %p.var -// CHECK:STDOUT: %a.ref.loc23: ref i32 = name_ref a, %a -// CHECK:STDOUT: %.loc23_17: %.48 = addr_of %a.ref.loc23 +// CHECK:STDOUT: %c.ref.loc20: ref %.48 = name_ref c, %c +// CHECK:STDOUT: %.loc20_4: ref %i32 = struct_access %c.ref.loc20, element0 +// CHECK:STDOUT: %.loc20_9: Core.IntLiteral = int_value 3 [template = constants.%.40] +// CHECK:STDOUT: %.loc20_7.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc20_7.2: = bound_method %.loc20_9, %.loc20_7.1 [template = constants.%.41] +// CHECK:STDOUT: %.loc20_7.3: = specific_function %.loc20_7.2, @Convert.2(constants.%.1) [template = constants.%.42] +// CHECK:STDOUT: %int.convert_checked.loc20: init %i32 = call %.loc20_7.3(%.loc20_9) [template = constants.%.43] +// CHECK:STDOUT: %.loc20_7.4: init %i32 = converted %.loc20_9, %int.convert_checked.loc20 [template = constants.%.43] +// CHECK:STDOUT: assign %.loc20_4, %.loc20_7.4 +// CHECK:STDOUT: %c.ref.loc21: ref %.48 = name_ref c, %c +// CHECK:STDOUT: %.loc21_4: ref %i32 = struct_access %c.ref.loc21, element1 +// CHECK:STDOUT: %.loc21_9: Core.IntLiteral = int_value 4 [template = constants.%.44] +// CHECK:STDOUT: %.loc21_7.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc21_7.2: = bound_method %.loc21_9, %.loc21_7.1 [template = constants.%.45] +// CHECK:STDOUT: %.loc21_7.3: = specific_function %.loc21_7.2, @Convert.2(constants.%.1) [template = constants.%.46] +// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %.loc21_7.3(%.loc21_9) [template = constants.%.47] +// CHECK:STDOUT: %.loc21_7.4: init %i32 = converted %.loc21_9, %int.convert_checked.loc21 [template = constants.%.47] +// CHECK:STDOUT: assign %.loc21_4, %.loc21_7.4 +// CHECK:STDOUT: %.loc23_10: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc23: init type = call constants.%Int(%.loc23_10) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_13.1: type = value_of_initializer %int.make_type_signed.loc23 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_13.2: type = converted %int.make_type_signed.loc23, %.loc23_13.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_13.3: type = ptr_type %i32 [template = constants.%.51] +// CHECK:STDOUT: %p.var: ref %.51 = var p +// CHECK:STDOUT: %p: ref %.51 = bind_name p, %p.var +// CHECK:STDOUT: %a.ref.loc23: ref %i32 = name_ref a, %a +// CHECK:STDOUT: %.loc23_17: %.51 = addr_of %a.ref.loc23 // CHECK:STDOUT: assign %p.var, %.loc23_17 -// CHECK:STDOUT: %p.ref.loc24: ref %.48 = name_ref p, %p -// CHECK:STDOUT: %.loc24_4: %.48 = bind_value %p.ref.loc24 -// CHECK:STDOUT: %.loc24_3: ref i32 = deref %.loc24_4 -// CHECK:STDOUT: %.loc24_8: Core.IntLiteral = int_value 5 [template = constants.%.49] -// CHECK:STDOUT: %.loc24_6.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc24_6.2: = bound_method %.loc24_8, %.loc24_6.1 [template = constants.%.50] -// CHECK:STDOUT: %int.convert_checked.loc24: init i32 = call %.loc24_6.2(%.loc24_8) [template = constants.%.51] -// CHECK:STDOUT: %.loc24_6.3: init i32 = converted %.loc24_8, %int.convert_checked.loc24 [template = constants.%.51] -// CHECK:STDOUT: assign %.loc24_3, %.loc24_6.3 -// CHECK:STDOUT: %.loc26_8: bool = bool_literal true [template = constants.%.52] +// CHECK:STDOUT: %p.ref.loc24: ref %.51 = name_ref p, %p +// CHECK:STDOUT: %.loc24_4: %.51 = bind_value %p.ref.loc24 +// CHECK:STDOUT: %.loc24_3: ref %i32 = deref %.loc24_4 +// CHECK:STDOUT: %.loc24_8: Core.IntLiteral = int_value 5 [template = constants.%.52] +// CHECK:STDOUT: %.loc24_6.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc24_6.2: = bound_method %.loc24_8, %.loc24_6.1 [template = constants.%.53] +// CHECK:STDOUT: %.loc24_6.3: = specific_function %.loc24_6.2, @Convert.2(constants.%.1) [template = constants.%.54] +// CHECK:STDOUT: %int.convert_checked.loc24: init %i32 = call %.loc24_6.3(%.loc24_8) [template = constants.%.55] +// CHECK:STDOUT: %.loc24_6.4: init %i32 = converted %.loc24_8, %int.convert_checked.loc24 [template = constants.%.55] +// CHECK:STDOUT: assign %.loc24_3, %.loc24_6.4 +// CHECK:STDOUT: %.loc26_8: bool = bool_literal true [template = constants.%.56] // CHECK:STDOUT: if %.loc26_8 br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: -// CHECK:STDOUT: %p.ref.loc26: ref %.48 = name_ref p, %p -// CHECK:STDOUT: %.loc26_18: %.48 = bind_value %p.ref.loc26 +// CHECK:STDOUT: %p.ref.loc26: ref %.51 = name_ref p, %p +// CHECK:STDOUT: %.loc26_18: %.51 = bind_value %p.ref.loc26 // CHECK:STDOUT: br !if.expr.result(%.loc26_18) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %a.ref.loc26: ref i32 = name_ref a, %a -// CHECK:STDOUT: %.loc26_25: %.48 = addr_of %a.ref.loc26 +// CHECK:STDOUT: %a.ref.loc26: ref %i32 = name_ref a, %a +// CHECK:STDOUT: %.loc26_25: %.51 = addr_of %a.ref.loc26 // CHECK:STDOUT: br !if.expr.result(%.loc26_25) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result: -// CHECK:STDOUT: %.loc26_5: %.48 = block_arg !if.expr.result -// CHECK:STDOUT: %.loc26_3: ref i32 = deref %.loc26_5 -// CHECK:STDOUT: %.loc26_31: Core.IntLiteral = int_value 10 [template = constants.%.53] -// CHECK:STDOUT: %.loc26_29.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc26_29.2: = bound_method %.loc26_31, %.loc26_29.1 [template = constants.%.54] -// CHECK:STDOUT: %int.convert_checked.loc26: init i32 = call %.loc26_29.2(%.loc26_31) [template = constants.%.55] -// CHECK:STDOUT: %.loc26_29.3: init i32 = converted %.loc26_31, %int.convert_checked.loc26 [template = constants.%.55] -// CHECK:STDOUT: assign %.loc26_3, %.loc26_29.3 +// CHECK:STDOUT: %.loc26_5: %.51 = block_arg !if.expr.result +// CHECK:STDOUT: %.loc26_3: ref %i32 = deref %.loc26_5 +// CHECK:STDOUT: %.loc26_31: Core.IntLiteral = int_value 10 [template = constants.%.57] +// CHECK:STDOUT: %.loc26_29.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc26_29.2: = bound_method %.loc26_31, %.loc26_29.1 [template = constants.%.58] +// CHECK:STDOUT: %.loc26_29.3: = specific_function %.loc26_29.2, @Convert.2(constants.%.1) [template = constants.%.59] +// CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %.loc26_29.3(%.loc26_31) [template = constants.%.60] +// CHECK:STDOUT: %.loc26_29.4: init %i32 = converted %.loc26_31, %int.convert_checked.loc26 [template = constants.%.60] +// CHECK:STDOUT: assign %.loc26_3, %.loc26_29.4 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon index f7c3dbe44069..5055e5ad597c 100644 --- a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon @@ -44,20 +44,22 @@ var or_: F(true or true); // CHECK:STDOUT: --- fail_and_or_not_in_function.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] -// CHECK:STDOUT: %.2: bool = bool_literal true [template] +// CHECK:STDOUT: %.3: bool = bool_literal true [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: %.loc42_17: bool = block_arg [template = constants.%.2] -// CHECK:STDOUT: %F.call: init type = call .inst+73.loc42_10(%.loc42_17) +// CHECK:STDOUT: %.loc42_17: bool = block_arg [template = constants.%.3] +// CHECK:STDOUT: %F.call: init type = call .inst+80.loc42_10(%.loc42_17) // CHECK:STDOUT: %.loc42_24.1: type = value_of_initializer %F.call // CHECK:STDOUT: %.loc42_24.2: type = converted %F.call, %.loc42_24.1 // CHECK:STDOUT: %or_.var: ref = var or_ @@ -70,13 +72,14 @@ var or_: F(true or true); // CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_20.2: type = converted %int.make_type_32, %.loc13_20.1 [template = i32] -// CHECK:STDOUT: br !if.expr.result(%.loc13_20.2) +// CHECK:STDOUT: %.loc13_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_20.3: type = converted %int.make_type_signed, %.loc13_20.2 [template = constants.%i32] +// CHECK:STDOUT: br !if.expr.result(%.loc13_20.3) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %.loc13_29: Core.IntLiteral = int_value 64 [template = constants.%.1] +// CHECK:STDOUT: %.loc13_29: Core.IntLiteral = int_value 64 [template = constants.%.2] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc13_29) [template = f64] // CHECK:STDOUT: %.loc13_24.1: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc13_24.2: type = converted %float.make_type, %.loc13_24.1 [template = f64] diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon index 3796f55ef4fc..e6b1a4f475cb 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon @@ -59,47 +59,54 @@ fn Main() { // CHECK:STDOUT: --- fail_assignment_to_non_assignable.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %tuple.1: %tuple.type.1 = tuple_value (%.29, %.30) [template] -// CHECK:STDOUT: %tuple.2: %tuple.type.1 = tuple_value (%.1, %.2) [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 0 [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.36: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.37: i32 = int_value 2 [template] -// CHECK:STDOUT: %tuple.3: %tuple.type.2 = tuple_value (%.28, %.37) [template] -// CHECK:STDOUT: %.38: type = ptr_type i32 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %tuple.1: %tuple.type.1 = tuple_value (%.27, %.28) [template] +// CHECK:STDOUT: %tuple.2: %tuple.type.1 = tuple_value (%.2, %.3) [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.31: = bound_method %.30, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 0 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %.35: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.36: = specific_function %.35, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.37: %i32 = int_value 2 [template] +// CHECK:STDOUT: %tuple.3: %tuple.type.2 = tuple_value (%.26, %.37) [template] +// CHECK:STDOUT: %.38: type = ptr_type %i32 [template] // CHECK:STDOUT: %.39: type = struct_type {.x: Core.IntLiteral, .y: Core.IntLiteral} [template] -// CHECK:STDOUT: %struct.1: %.39 = struct_value (%.29, %.30) [template] -// CHECK:STDOUT: %struct.2: %.39 = struct_value (%.1, %.2) [template] +// CHECK:STDOUT: %struct.1: %.39 = struct_value (%.27, %.28) [template] +// CHECK:STDOUT: %struct.2: %.39 = struct_value (%.2, %.3) [template] // CHECK:STDOUT: %.41: bool = bool_literal true [template] -// CHECK:STDOUT: %.42: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.43: i32 = int_value 3 [template] -// CHECK:STDOUT: %.44: Core.IntLiteral = int_value 10 [template] -// CHECK:STDOUT: %.45: = bound_method %.44, %Convert.15 [template] -// CHECK:STDOUT: %.46: i32 = int_value 10 [template] +// CHECK:STDOUT: %.42: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.43: = specific_function %.42, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.44: %i32 = int_value 3 [template] +// CHECK:STDOUT: %.45: Core.IntLiteral = int_value 10 [template] +// CHECK:STDOUT: %.46: = bound_method %.45, %Convert.14 [template] +// CHECK:STDOUT: %.47: = specific_function %.46, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.48: %i32 = int_value 10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -114,100 +121,108 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32; +// CHECK:STDOUT: fn @F() -> %i32; // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc18_3: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc18_7: Core.IntLiteral = int_value 2 [template = constants.%.2] +// CHECK:STDOUT: %.loc18_3: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc18_7: Core.IntLiteral = int_value 2 [template = constants.%.3] // CHECK:STDOUT: assign %.loc18_3, %.loc18_7 // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %F.call: init i32 = call %F.ref() -// CHECK:STDOUT: %.loc23_9: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc23_7.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc23_7.2: = bound_method %.loc23_9, %.loc23_7.1 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc23: init i32 = call %.loc23_7.2(%.loc23_9) [template = constants.%.28] -// CHECK:STDOUT: %.loc23_7.3: init i32 = converted %.loc23_9, %int.convert_checked.loc23 [template = constants.%.28] -// CHECK:STDOUT: assign %F.call, %.loc23_7.3 -// CHECK:STDOUT: %.loc28_4: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc28_7: Core.IntLiteral = int_value 2 [template = constants.%.2] +// CHECK:STDOUT: %F.call: init %i32 = call %F.ref() +// CHECK:STDOUT: %.loc23_9: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc23_7.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc23_7.2: = bound_method %.loc23_9, %.loc23_7.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc23_7.3: = specific_function %.loc23_7.2, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %.loc23_7.3(%.loc23_9) [template = constants.%.26] +// CHECK:STDOUT: %.loc23_7.4: init %i32 = converted %.loc23_9, %int.convert_checked.loc23 [template = constants.%.26] +// CHECK:STDOUT: assign %F.call, %.loc23_7.4 +// CHECK:STDOUT: %.loc28_4: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc28_7: Core.IntLiteral = int_value 2 [template = constants.%.3] // CHECK:STDOUT: %.loc28_8.1: %tuple.type.1 = tuple_literal (%.loc28_4, %.loc28_7) -// CHECK:STDOUT: %.loc28_13: Core.IntLiteral = int_value 3 [template = constants.%.29] -// CHECK:STDOUT: %.loc28_16: Core.IntLiteral = int_value 4 [template = constants.%.30] +// CHECK:STDOUT: %.loc28_13: Core.IntLiteral = int_value 3 [template = constants.%.27] +// CHECK:STDOUT: %.loc28_16: Core.IntLiteral = int_value 4 [template = constants.%.28] // CHECK:STDOUT: %.loc28_17.1: %tuple.type.1 = tuple_literal (%.loc28_13, %.loc28_16) // CHECK:STDOUT: %.loc28_17.2: Core.IntLiteral = tuple_access %.loc28_8.1, element0 -// CHECK:STDOUT: %.loc28_17.3: init Core.IntLiteral = initialize_from %.loc28_13 to %.loc28_17.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc28_17.3: init Core.IntLiteral = initialize_from %.loc28_13 to %.loc28_17.2 [template = constants.%.27] // CHECK:STDOUT: %.loc28_17.4: Core.IntLiteral = tuple_access %.loc28_8.1, element1 -// CHECK:STDOUT: %.loc28_17.5: init Core.IntLiteral = initialize_from %.loc28_16 to %.loc28_17.4 [template = constants.%.30] +// CHECK:STDOUT: %.loc28_17.5: init Core.IntLiteral = initialize_from %.loc28_16 to %.loc28_17.4 [template = constants.%.28] // CHECK:STDOUT: %.loc28_17.6: init %tuple.type.1 = tuple_init (%.loc28_17.3, %.loc28_17.5) to %.loc28_8.1 [template = constants.%tuple.1] // CHECK:STDOUT: %.loc28_10: init %tuple.type.1 = converted %.loc28_17.1, %.loc28_17.6 [template = constants.%tuple.1] // CHECK:STDOUT: assign %.loc28_8.1, %.loc28_10 // CHECK:STDOUT: %tuple.loc28: %tuple.type.1 = tuple_value (%.loc28_4, %.loc28_7) [template = constants.%tuple.2] // CHECK:STDOUT: %.loc28_8.2: %tuple.type.1 = converted %.loc28_8.1, %tuple.loc28 [template = constants.%tuple.2] -// CHECK:STDOUT: %int.make_type_32.loc29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc29_10.1: type = value_of_initializer %int.make_type_32.loc29 [template = i32] -// CHECK:STDOUT: %.loc29_10.2: type = converted %int.make_type_32.loc29, %.loc29_10.1 [template = i32] -// CHECK:STDOUT: %n.var: ref i32 = var n -// CHECK:STDOUT: %n: ref i32 = bind_name n, %n.var -// CHECK:STDOUT: %.loc29_16: Core.IntLiteral = int_value 0 [template = constants.%.32] -// CHECK:STDOUT: %.loc29_17.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc29_17.2: = bound_method %.loc29_16, %.loc29_17.1 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc29: init i32 = call %.loc29_17.2(%.loc29_16) [template = constants.%.34] -// CHECK:STDOUT: %.loc29_17.3: init i32 = converted %.loc29_16, %int.convert_checked.loc29 [template = constants.%.34] -// CHECK:STDOUT: assign %n.var, %.loc29_17.3 -// CHECK:STDOUT: %n.ref.loc34_4: ref i32 = name_ref n, %n -// CHECK:STDOUT: %n.ref.loc34_7: ref i32 = name_ref n, %n +// CHECK:STDOUT: %.loc29_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc29: init type = call constants.%Int(%.loc29_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc29_10.2: type = value_of_initializer %int.make_type_signed.loc29 [template = constants.%i32] +// CHECK:STDOUT: %.loc29_10.3: type = converted %int.make_type_signed.loc29, %.loc29_10.2 [template = constants.%i32] +// CHECK:STDOUT: %n.var: ref %i32 = var n +// CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var +// CHECK:STDOUT: %.loc29_16: Core.IntLiteral = int_value 0 [template = constants.%.30] +// CHECK:STDOUT: %.loc29_17.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc29_17.2: = bound_method %.loc29_16, %.loc29_17.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc29_17.3: = specific_function %.loc29_17.2, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %.loc29_17.3(%.loc29_16) [template = constants.%.33] +// CHECK:STDOUT: %.loc29_17.4: init %i32 = converted %.loc29_16, %int.convert_checked.loc29 [template = constants.%.33] +// CHECK:STDOUT: assign %n.var, %.loc29_17.4 +// CHECK:STDOUT: %n.ref.loc34_4: ref %i32 = name_ref n, %n +// CHECK:STDOUT: %n.ref.loc34_7: ref %i32 = name_ref n, %n // CHECK:STDOUT: %.loc34_8.1: %tuple.type.2 = tuple_literal (%n.ref.loc34_4, %n.ref.loc34_7) -// CHECK:STDOUT: %.loc34_13: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc34_16: Core.IntLiteral = int_value 2 [template = constants.%.2] +// CHECK:STDOUT: %.loc34_13: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc34_16: Core.IntLiteral = int_value 2 [template = constants.%.3] // CHECK:STDOUT: %.loc34_17.1: %tuple.type.1 = tuple_literal (%.loc34_13, %.loc34_16) -// CHECK:STDOUT: %.loc34_17.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc34_17.3: = bound_method %.loc34_13, %.loc34_17.2 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc34_17.1: init i32 = call %.loc34_17.3(%.loc34_13) [template = constants.%.28] -// CHECK:STDOUT: %.loc34_17.4: init i32 = converted %.loc34_13, %int.convert_checked.loc34_17.1 [template = constants.%.28] -// CHECK:STDOUT: %.loc34_17.5: i32 = tuple_access %.loc34_8.1, element0 -// CHECK:STDOUT: %.loc34_17.6: init i32 = initialize_from %.loc34_17.4 to %.loc34_17.5 [template = constants.%.28] -// CHECK:STDOUT: %.loc34_17.7: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc34_17.8: = bound_method %.loc34_16, %.loc34_17.7 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc34_17.2: init i32 = call %.loc34_17.8(%.loc34_16) [template = constants.%.37] -// CHECK:STDOUT: %.loc34_17.9: init i32 = converted %.loc34_16, %int.convert_checked.loc34_17.2 [template = constants.%.37] -// CHECK:STDOUT: %.loc34_17.10: i32 = tuple_access %.loc34_8.1, element1 -// CHECK:STDOUT: %.loc34_17.11: init i32 = initialize_from %.loc34_17.9 to %.loc34_17.10 [template = constants.%.37] -// CHECK:STDOUT: %.loc34_17.12: init %tuple.type.2 = tuple_init (%.loc34_17.6, %.loc34_17.11) to %.loc34_8.1 [template = constants.%tuple.3] -// CHECK:STDOUT: %.loc34_10: init %tuple.type.2 = converted %.loc34_17.1, %.loc34_17.12 [template = constants.%tuple.3] +// CHECK:STDOUT: %.loc34_17.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc34_17.3: = bound_method %.loc34_13, %.loc34_17.2 [template = constants.%.24] +// CHECK:STDOUT: %.loc34_17.4: = specific_function %.loc34_17.3, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc34_17.1: init %i32 = call %.loc34_17.4(%.loc34_13) [template = constants.%.26] +// CHECK:STDOUT: %.loc34_17.5: init %i32 = converted %.loc34_13, %int.convert_checked.loc34_17.1 [template = constants.%.26] +// CHECK:STDOUT: %.loc34_17.6: %i32 = tuple_access %.loc34_8.1, element0 +// CHECK:STDOUT: %.loc34_17.7: init %i32 = initialize_from %.loc34_17.5 to %.loc34_17.6 [template = constants.%.26] +// CHECK:STDOUT: %.loc34_17.8: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc34_17.9: = bound_method %.loc34_16, %.loc34_17.8 [template = constants.%.35] +// CHECK:STDOUT: %.loc34_17.10: = specific_function %.loc34_17.9, @Convert.2(constants.%.1) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc34_17.2: init %i32 = call %.loc34_17.10(%.loc34_16) [template = constants.%.37] +// CHECK:STDOUT: %.loc34_17.11: init %i32 = converted %.loc34_16, %int.convert_checked.loc34_17.2 [template = constants.%.37] +// CHECK:STDOUT: %.loc34_17.12: %i32 = tuple_access %.loc34_8.1, element1 +// CHECK:STDOUT: %.loc34_17.13: init %i32 = initialize_from %.loc34_17.11 to %.loc34_17.12 [template = constants.%.37] +// CHECK:STDOUT: %.loc34_17.14: init %tuple.type.2 = tuple_init (%.loc34_17.7, %.loc34_17.13) to %.loc34_8.1 [template = constants.%tuple.3] +// CHECK:STDOUT: %.loc34_10: init %tuple.type.2 = converted %.loc34_17.1, %.loc34_17.14 [template = constants.%tuple.3] // CHECK:STDOUT: assign %.loc34_8.1, %.loc34_10 -// CHECK:STDOUT: %.loc34_4: i32 = bind_value %n.ref.loc34_4 -// CHECK:STDOUT: %.loc34_7: i32 = bind_value %n.ref.loc34_7 +// CHECK:STDOUT: %.loc34_4: %i32 = bind_value %n.ref.loc34_4 +// CHECK:STDOUT: %.loc34_7: %i32 = bind_value %n.ref.loc34_7 // CHECK:STDOUT: %tuple.loc34: %tuple.type.2 = tuple_value (%.loc34_4, %.loc34_7) // CHECK:STDOUT: %.loc34_8.2: %tuple.type.2 = converted %.loc34_8.1, %tuple.loc34 -// CHECK:STDOUT: %int.make_type_32.loc39_3: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc39_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc39_12.1: type = value_of_initializer %int.make_type_32.loc39_9 [template = i32] -// CHECK:STDOUT: %.loc39_12.2: type = converted %int.make_type_32.loc39_9, %.loc39_12.1 [template = i32] -// CHECK:STDOUT: %.loc39_12.3: type = ptr_type i32 [template = constants.%.38] -// CHECK:STDOUT: assign %int.make_type_32.loc39_3, %.loc39_12.3 -// CHECK:STDOUT: %.loc44_9: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc44_17: Core.IntLiteral = int_value 2 [template = constants.%.2] +// CHECK:STDOUT: %.loc39_3: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc39_3: init type = call constants.%Int(%.loc39_3) [template = constants.%i32] +// CHECK:STDOUT: %.loc39_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc39_9: init type = call constants.%Int(%.loc39_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc39_12.1: type = value_of_initializer %int.make_type_signed.loc39_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc39_12.2: type = converted %int.make_type_signed.loc39_9, %.loc39_12.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc39_12.3: type = ptr_type %i32 [template = constants.%.38] +// CHECK:STDOUT: assign %int.make_type_signed.loc39_3, %.loc39_12.3 +// CHECK:STDOUT: %.loc44_9: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc44_17: Core.IntLiteral = int_value 2 [template = constants.%.3] // CHECK:STDOUT: %.loc44_18.1: %.39 = struct_literal (%.loc44_9, %.loc44_17) -// CHECK:STDOUT: %.loc44_28: Core.IntLiteral = int_value 3 [template = constants.%.29] -// CHECK:STDOUT: %.loc44_36: Core.IntLiteral = int_value 4 [template = constants.%.30] +// CHECK:STDOUT: %.loc44_28: Core.IntLiteral = int_value 3 [template = constants.%.27] +// CHECK:STDOUT: %.loc44_36: Core.IntLiteral = int_value 4 [template = constants.%.28] // CHECK:STDOUT: %.loc44_37.1: %.39 = struct_literal (%.loc44_28, %.loc44_36) // CHECK:STDOUT: %.loc44_37.2: Core.IntLiteral = struct_access %.loc44_18.1, element0 -// CHECK:STDOUT: %.loc44_37.3: init Core.IntLiteral = initialize_from %.loc44_28 to %.loc44_37.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc44_37.3: init Core.IntLiteral = initialize_from %.loc44_28 to %.loc44_37.2 [template = constants.%.27] // CHECK:STDOUT: %.loc44_37.4: Core.IntLiteral = struct_access %.loc44_18.1, element1 -// CHECK:STDOUT: %.loc44_37.5: init Core.IntLiteral = initialize_from %.loc44_36 to %.loc44_37.4 [template = constants.%.30] +// CHECK:STDOUT: %.loc44_37.5: init Core.IntLiteral = initialize_from %.loc44_36 to %.loc44_37.4 [template = constants.%.28] // CHECK:STDOUT: %.loc44_37.6: init %.39 = struct_init (%.loc44_37.3, %.loc44_37.5) to %.loc44_18.1 [template = constants.%struct.1] // CHECK:STDOUT: %.loc44_20: init %.39 = converted %.loc44_37.1, %.loc44_37.6 [template = constants.%struct.1] // CHECK:STDOUT: assign %.loc44_18.1, %.loc44_20 @@ -217,57 +232,62 @@ fn Main() { // CHECK:STDOUT: if %.loc49_7 br !if.expr.then.loc49 else br !if.expr.else.loc49 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc49: -// CHECK:STDOUT: %.loc49_17: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc49_12.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc49_12.2: = bound_method %.loc49_17, %.loc49_12.1 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc49_12: init i32 = call %.loc49_12.2(%.loc49_17) [template = constants.%.28] -// CHECK:STDOUT: %.loc49_12.3: i32 = value_of_initializer %int.convert_checked.loc49_12 [template = constants.%.28] -// CHECK:STDOUT: %.loc49_12.4: i32 = converted %.loc49_17, %.loc49_12.3 [template = constants.%.28] -// CHECK:STDOUT: br !if.expr.result.loc49(%.loc49_12.4) +// CHECK:STDOUT: %.loc49_17: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc49_12.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc49_12.2: = bound_method %.loc49_17, %.loc49_12.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc49_12.3: = specific_function %.loc49_12.2, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc49_12: init %i32 = call %.loc49_12.3(%.loc49_17) [template = constants.%.26] +// CHECK:STDOUT: %.loc49_12.4: %i32 = value_of_initializer %int.convert_checked.loc49_12 [template = constants.%.26] +// CHECK:STDOUT: %.loc49_12.5: %i32 = converted %.loc49_17, %.loc49_12.4 [template = constants.%.26] +// CHECK:STDOUT: br !if.expr.result.loc49(%.loc49_12.5) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc49: -// CHECK:STDOUT: %.loc49_24: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc49_19.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc49_19.2: = bound_method %.loc49_24, %.loc49_19.1 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc49_19: init i32 = call %.loc49_19.2(%.loc49_24) [template = constants.%.37] -// CHECK:STDOUT: %.loc49_19.3: i32 = value_of_initializer %int.convert_checked.loc49_19 [template = constants.%.37] -// CHECK:STDOUT: %.loc49_19.4: i32 = converted %.loc49_24, %.loc49_19.3 [template = constants.%.37] -// CHECK:STDOUT: br !if.expr.result.loc49(%.loc49_19.4) +// CHECK:STDOUT: %.loc49_24: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc49_19.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc49_19.2: = bound_method %.loc49_24, %.loc49_19.1 [template = constants.%.35] +// CHECK:STDOUT: %.loc49_19.3: = specific_function %.loc49_19.2, @Convert.2(constants.%.1) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc49_19: init %i32 = call %.loc49_19.3(%.loc49_24) [template = constants.%.37] +// CHECK:STDOUT: %.loc49_19.4: %i32 = value_of_initializer %int.convert_checked.loc49_19 [template = constants.%.37] +// CHECK:STDOUT: %.loc49_19.5: %i32 = converted %.loc49_24, %.loc49_19.4 [template = constants.%.37] +// CHECK:STDOUT: br !if.expr.result.loc49(%.loc49_19.5) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc49: -// CHECK:STDOUT: %.loc49_4: i32 = block_arg !if.expr.result.loc49 [template = constants.%.28] -// CHECK:STDOUT: %.loc49_29: Core.IntLiteral = int_value 3 [template = constants.%.29] -// CHECK:STDOUT: %.loc49_27.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %.loc49_4: %i32 = block_arg !if.expr.result.loc49 [template = constants.%.26] +// CHECK:STDOUT: %.loc49_29: Core.IntLiteral = int_value 3 [template = constants.%.27] +// CHECK:STDOUT: %.loc49_27.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] // CHECK:STDOUT: %.loc49_27.2: = bound_method %.loc49_29, %.loc49_27.1 [template = constants.%.42] -// CHECK:STDOUT: %int.convert_checked.loc49_27: init i32 = call %.loc49_27.2(%.loc49_29) [template = constants.%.43] -// CHECK:STDOUT: %.loc49_27.3: init i32 = converted %.loc49_29, %int.convert_checked.loc49_27 [template = constants.%.43] -// CHECK:STDOUT: assign %.loc49_4, %.loc49_27.3 -// CHECK:STDOUT: %int.make_type_32.loc52: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc52_10.1: type = value_of_initializer %int.make_type_32.loc52 [template = i32] -// CHECK:STDOUT: %.loc52_10.2: type = converted %int.make_type_32.loc52, %.loc52_10.1 [template = i32] -// CHECK:STDOUT: %a.var: ref i32 = var a -// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var +// CHECK:STDOUT: %.loc49_27.3: = specific_function %.loc49_27.2, @Convert.2(constants.%.1) [template = constants.%.43] +// CHECK:STDOUT: %int.convert_checked.loc49_27: init %i32 = call %.loc49_27.3(%.loc49_29) [template = constants.%.44] +// CHECK:STDOUT: %.loc49_27.4: init %i32 = converted %.loc49_29, %int.convert_checked.loc49_27 [template = constants.%.44] +// CHECK:STDOUT: assign %.loc49_4, %.loc49_27.4 +// CHECK:STDOUT: %.loc52_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc52: init type = call constants.%Int(%.loc52_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc52_10.2: type = value_of_initializer %int.make_type_signed.loc52 [template = constants.%i32] +// CHECK:STDOUT: %.loc52_10.3: type = converted %int.make_type_signed.loc52, %.loc52_10.2 [template = constants.%i32] +// CHECK:STDOUT: %a.var: ref %i32 = var a +// CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %.loc56_7: bool = bool_literal true [template = constants.%.41] // CHECK:STDOUT: if %.loc56_7 br !if.expr.then.loc56 else br !if.expr.else.loc56 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc56: -// CHECK:STDOUT: %a.ref.loc56_17: ref i32 = name_ref a, %a -// CHECK:STDOUT: %.loc56_17: i32 = bind_value %a.ref.loc56_17 +// CHECK:STDOUT: %a.ref.loc56_17: ref %i32 = name_ref a, %a +// CHECK:STDOUT: %.loc56_17: %i32 = bind_value %a.ref.loc56_17 // CHECK:STDOUT: br !if.expr.result.loc56(%.loc56_17) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc56: -// CHECK:STDOUT: %a.ref.loc56_24: ref i32 = name_ref a, %a -// CHECK:STDOUT: %.loc56_24: i32 = bind_value %a.ref.loc56_24 +// CHECK:STDOUT: %a.ref.loc56_24: ref %i32 = name_ref a, %a +// CHECK:STDOUT: %.loc56_24: %i32 = bind_value %a.ref.loc56_24 // CHECK:STDOUT: br !if.expr.result.loc56(%.loc56_24) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc56: -// CHECK:STDOUT: %.loc56_4: i32 = block_arg !if.expr.result.loc56 -// CHECK:STDOUT: %.loc56_29: Core.IntLiteral = int_value 10 [template = constants.%.44] -// CHECK:STDOUT: %.loc56_27.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc56_27.2: = bound_method %.loc56_29, %.loc56_27.1 [template = constants.%.45] -// CHECK:STDOUT: %int.convert_checked.loc56: init i32 = call %.loc56_27.2(%.loc56_29) [template = constants.%.46] -// CHECK:STDOUT: %.loc56_27.3: init i32 = converted %.loc56_29, %int.convert_checked.loc56 [template = constants.%.46] -// CHECK:STDOUT: assign %.loc56_4, %.loc56_27.3 +// CHECK:STDOUT: %.loc56_4: %i32 = block_arg !if.expr.result.loc56 +// CHECK:STDOUT: %.loc56_29: Core.IntLiteral = int_value 10 [template = constants.%.45] +// CHECK:STDOUT: %.loc56_27.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc56_27.2: = bound_method %.loc56_29, %.loc56_27.1 [template = constants.%.46] +// CHECK:STDOUT: %.loc56_27.3: = specific_function %.loc56_27.2, @Convert.2(constants.%.1) [template = constants.%.47] +// CHECK:STDOUT: %int.convert_checked.loc56: init %i32 = call %.loc56_27.3(%.loc56_29) [template = constants.%.48] +// CHECK:STDOUT: %.loc56_27.4: init %i32 = converted %.loc56_29, %int.convert_checked.loc56 [template = constants.%.48] +// CHECK:STDOUT: assign %.loc56_4, %.loc56_27.4 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon index ca05cd91165b..5cbf6c890ca3 100644 --- a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon @@ -26,27 +26,31 @@ fn Main() { // CHECK:STDOUT: --- fail_redundant_compound_access.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 3 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.27: = bound_method %.26, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -61,51 +65,55 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32 { +// CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_24: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_25.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_25.2: = bound_method %.loc11_24, %.loc11_25.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc11_25.2(%.loc11_24) [template = constants.%.27] -// CHECK:STDOUT: %.loc11_25.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc11_25.4: i32 = converted %.loc11_24, %.loc11_25.3 [template = constants.%.27] -// CHECK:STDOUT: return %.loc11_25.4 +// CHECK:STDOUT: %.loc11_24: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_25.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_25.2: = bound_method %.loc11_24, %.loc11_25.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc11_25.3: = specific_function %.loc11_25.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc11_25.3(%.loc11_24) [template = constants.%.25] +// CHECK:STDOUT: %.loc11_25.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc11_25.5: %i32 = converted %.loc11_24, %.loc11_25.4 [template = constants.%.25] +// CHECK:STDOUT: return %.loc11_25.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_32, %.loc14_10.1 [template = i32] -// CHECK:STDOUT: %a.var: ref i32 = var a -// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var -// CHECK:STDOUT: %.loc14_16: Core.IntLiteral = int_value 3 [template = constants.%.28] -// CHECK:STDOUT: %.loc14_17.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_17.2: = bound_method %.loc14_16, %.loc14_17.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc14_17.2(%.loc14_16) [template = constants.%.30] -// CHECK:STDOUT: %.loc14_17.3: init i32 = converted %.loc14_16, %int.convert_checked [template = constants.%.30] -// CHECK:STDOUT: assign %a.var, %.loc14_17.3 -// CHECK:STDOUT: %a.ref.loc19_3: ref i32 = name_ref a, %a -// CHECK:STDOUT: %a.ref.loc19_7: ref i32 = name_ref a, %a -// CHECK:STDOUT: %a.ref.loc19_10: ref i32 = name_ref a, %a -// CHECK:STDOUT: %.loc19: i32 = bind_value %a.ref.loc19_10 +// CHECK:STDOUT: %.loc14_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_10.3: type = converted %int.make_type_signed, %.loc14_10.2 [template = constants.%i32] +// CHECK:STDOUT: %a.var: ref %i32 = var a +// CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var +// CHECK:STDOUT: %.loc14_16: Core.IntLiteral = int_value 3 [template = constants.%.26] +// CHECK:STDOUT: %.loc14_17.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_17.2: = bound_method %.loc14_16, %.loc14_17.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc14_17.3: = specific_function %.loc14_17.2, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc14_17.3(%.loc14_16) [template = constants.%.29] +// CHECK:STDOUT: %.loc14_17.4: init %i32 = converted %.loc14_16, %int.convert_checked [template = constants.%.29] +// CHECK:STDOUT: assign %a.var, %.loc14_17.4 +// CHECK:STDOUT: %a.ref.loc19_3: ref %i32 = name_ref a, %a +// CHECK:STDOUT: %a.ref.loc19_7: ref %i32 = name_ref a, %a +// CHECK:STDOUT: %a.ref.loc19_10: ref %i32 = name_ref a, %a +// CHECK:STDOUT: %.loc19: %i32 = bind_value %a.ref.loc19_10 // CHECK:STDOUT: assign %a.ref.loc19_3, %.loc19 -// CHECK:STDOUT: %a.ref.loc23_3: ref i32 = name_ref a, %a -// CHECK:STDOUT: %a.ref.loc23_7: ref i32 = name_ref a, %a +// CHECK:STDOUT: %a.ref.loc23_3: ref %i32 = name_ref a, %a +// CHECK:STDOUT: %a.ref.loc23_7: ref %i32 = name_ref a, %a // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %F.call: init i32 = call %F.ref() +// CHECK:STDOUT: %F.call: init %i32 = call %F.ref() // CHECK:STDOUT: assign %a.ref.loc23_3, %F.call // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon index 7fdd6aedf38a..c1638f315777 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -24,21 +24,24 @@ fn Main() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 3 [template] -// CHECK:STDOUT: %.28: f64 = float_literal 5.6000000000000005 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 3 [template] +// CHECK:STDOUT: %.26: f64 = float_literal 5.6000000000000005 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -56,20 +59,22 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %a.var: ref i32 = var a -// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var -// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 3 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_17.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_17.2: = bound_method %.loc12_16, %.loc12_17.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_17.2(%.loc12_16) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_17.3: init i32 = converted %.loc12_16, %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: assign %a.var, %.loc12_17.3 -// CHECK:STDOUT: %a.ref: ref i32 = name_ref a, %a -// CHECK:STDOUT: %.loc19_7: f64 = float_literal 5.6000000000000005 [template = constants.%.28] -// CHECK:STDOUT: %.loc19_5: i32 = converted %.loc19_7, [template = ] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %a.var: ref %i32 = var a +// CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var +// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 3 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_17.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_17.2: = bound_method %.loc12_16, %.loc12_17.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_17.3: = specific_function %.loc12_17.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc12_17.3(%.loc12_16) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_17.4: init %i32 = converted %.loc12_16, %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: assign %a.var, %.loc12_17.4 +// CHECK:STDOUT: %a.ref: ref %i32 = name_ref a, %a +// CHECK:STDOUT: %.loc19_7: f64 = float_literal 5.6000000000000005 [template = constants.%.26] +// CHECK:STDOUT: %.loc19_5: %i32 = converted %.loc19_7, [template = ] // CHECK:STDOUT: assign %a.ref, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon index 3a18a4576954..38846bc248d4 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon @@ -24,17 +24,19 @@ fn Main() -> i32 { // CHECK:STDOUT: --- fail_type_mismatch_once.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %.2: f64 = float_literal 3.4000000000000004 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %.3: f64 = float_literal 3.4000000000000004 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .Add = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -48,22 +50,23 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.3: type = converted %int.make_type_signed, %.loc11_14.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Main() -> i32 { +// CHECK:STDOUT: fn @Main() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc21_10: Core.IntLiteral = int_value 12 [template = constants.%.1] -// CHECK:STDOUT: %.loc21_15: f64 = float_literal 3.4000000000000004 [template = constants.%.2] -// CHECK:STDOUT: %.loc21_21: Core.IntLiteral = int_value 12 [template = constants.%.1] +// CHECK:STDOUT: %.loc21_10: Core.IntLiteral = int_value 12 [template = constants.%.2] +// CHECK:STDOUT: %.loc21_15: f64 = float_literal 3.4000000000000004 [template = constants.%.3] +// CHECK:STDOUT: %.loc21_21: Core.IntLiteral = int_value 12 [template = constants.%.2] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon index bf60b2e2b6c4..01490770a06a 100644 --- a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon @@ -18,17 +18,19 @@ fn Main() -> i32 { // CHECK:STDOUT: --- fail_unimplemented_op.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 34 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 34 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .Add = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -42,21 +44,22 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.3: type = converted %int.make_type_signed, %.loc11_14.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Main() -> i32 { +// CHECK:STDOUT: fn @Main() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15_10: Core.IntLiteral = int_value 12 [template = constants.%.1] -// CHECK:STDOUT: %.loc15_15: Core.IntLiteral = int_value 34 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_10: Core.IntLiteral = int_value 12 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_15: Core.IntLiteral = int_value 34 [template = constants.%.3] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon index 69e91eaacf8f..aa5d6a37bd9a 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -35,24 +35,26 @@ fn Test() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %X: type = class_type @X [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %X, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.n: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %X, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.n: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] // CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%X)> [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(%X) [template] -// CHECK:STDOUT: %.8: = interface_witness (%Convert.2) [template] -// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %.9: = interface_witness (%Convert.2) [template] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %.12: = interface_witness (%Convert.4) [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.4) [template] // CHECK:STDOUT: %Sink_i32.type: type = fn_type @Sink_i32 [template] // CHECK:STDOUT: %Sink_i32: %Sink_i32.type = struct_value () [template] // CHECK:STDOUT: %Sink_X.type: type = fn_type @Sink_X [template] @@ -61,21 +63,21 @@ fn Test() { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Source.type: type = fn_type @Source [template] // CHECK:STDOUT: %Source: %Source.type = struct_value () [template] -// CHECK:STDOUT: %.13: = specific_function %Source, @Source(%T) [symbolic] +// CHECK:STDOUT: %.14: = specific_function %Source, @Source(%T) [symbolic] // CHECK:STDOUT: %Test.type: type = fn_type @Test [template] // CHECK:STDOUT: %Test: %Test.type = struct_value () [template] -// CHECK:STDOUT: %.14: = specific_function %Source, @Source(%X) [template] -// CHECK:STDOUT: %.34: = specific_function %Source, @Source(i32) [template] +// CHECK:STDOUT: %.15: = specific_function %Source, @Source(%X) [template] +// CHECK:STDOUT: %.31: = specific_function %Source, @Source(%i32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+55, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+54, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -90,9 +92,10 @@ fn Test() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} // CHECK:STDOUT: impl_decl @impl.1 [template] {} { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32, %.loc15_6.1 [template = i32] +// CHECK:STDOUT: %.loc15_6.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_6.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_6.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_6.3: type = converted %int.make_type_signed, %.loc15_6.2 [template = constants.%i32] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] @@ -102,20 +105,22 @@ fn Test() { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_26.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc19_26.2: type = converted %int.make_type_32, %.loc19_26.1 [template = i32] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %.loc19_27: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc19_27) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_26.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc19_26.2: type = converted %int.make_type_signed, %.loc19_26.1 [template = constants.%i32] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32)> [template = constants.%ImplicitAs.type.4] // CHECK:STDOUT: } // CHECK:STDOUT: %Sink_i32.decl: %Sink_i32.type = fn_decl @Sink_i32 [template = constants.%Sink_i32] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc25_16.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc25_16.2: type = converted %int.make_type_32, %.loc25_16.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %.loc25_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc25_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc25_16.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc25_16.3: type = converted %int.make_type_signed, %.loc25_16.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: %Sink_X.decl: %Sink_X.type = fn_decl @Sink_X [template = constants.%Sink_X] { // CHECK:STDOUT: %x.patt: %X = binding_pattern x @@ -140,23 +145,24 @@ fn Test() { // CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %.loc15_6.2 as %ImplicitAs.type { +// CHECK:STDOUT: impl @impl.1: %.loc15_6.3 as %ImplicitAs.type { // CHECK:STDOUT: %Convert.decl: %Convert.type.2 = fn_decl @Convert.2 [template = constants.%Convert.2] { -// CHECK:STDOUT: %self.patt: i32 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: i32 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %self.patt: %i32 = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %i32 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %X = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %X = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_20.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_20.2: type = converted %int.make_type_32, %.loc16_20.1 [template = i32] +// CHECK:STDOUT: %.loc16_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc16_20.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc16_20.3: type = converted %int.make_type_signed, %.loc16_20.2 [template = constants.%i32] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %self.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %self: i32 = bind_name self, %self.param +// CHECK:STDOUT: %self.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %self: %i32 = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %X = out_param runtime_param1 // CHECK:STDOUT: %return: ref %X = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15_32: = interface_witness (%Convert.decl) [template = constants.%.8] +// CHECK:STDOUT: %.loc15_32: = interface_witness (%Convert.decl) [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl @@ -167,19 +173,20 @@ fn Test() { // CHECK:STDOUT: %Convert.decl: %Convert.type.4 = fn_decl @Convert.3 [template = constants.%Convert.4] { // CHECK:STDOUT: %self.patt: %X = binding_pattern self // CHECK:STDOUT: %self.param_patt: %X = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc20_28.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc20_28.2: type = converted %int.make_type_32, %.loc20_28.1 [template = i32] +// CHECK:STDOUT: %.loc20_28.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc20_28.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc20_28.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc20_28.3: type = converted %int.make_type_signed, %.loc20_28.2 [template = constants.%i32] // CHECK:STDOUT: %self.param: %X = value_param runtime_param0 // CHECK:STDOUT: %self: %X = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19_32: = interface_witness (%Convert.decl) [template = constants.%.12] +// CHECK:STDOUT: %.loc19_32: = interface_witness (%Convert.decl) [template = constants.%.13] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl @@ -187,38 +194,39 @@ fn Test() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl n, element0 [template] -// CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X // CHECK:STDOUT: .n = %.loc12_8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.2[%self.param_patt: i32]() -> %return: %X { +// CHECK:STDOUT: fn @Convert.2[%self.param_patt: %i32]() -> %return: %X { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: i32 = name_ref self, %self -// CHECK:STDOUT: %.loc16_51.1: %.2 = struct_literal (%self.ref) -// CHECK:STDOUT: %.loc16_51.2: ref i32 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc16_51.3: init i32 = initialize_from %self.ref to %.loc16_51.2 +// CHECK:STDOUT: %self.ref: %i32 = name_ref self, %self +// CHECK:STDOUT: %.loc16_51.1: %.3 = struct_literal (%self.ref) +// CHECK:STDOUT: %.loc16_51.2: ref %i32 = class_element_access %return, element0 +// CHECK:STDOUT: %.loc16_51.3: init %i32 = initialize_from %self.ref to %.loc16_51.2 // CHECK:STDOUT: %.loc16_51.4: init %X = class_init (%.loc16_51.3), %return // CHECK:STDOUT: %.loc16_52: init %X = converted %.loc16_51.1, %.loc16_51.4 // CHECK:STDOUT: return %.loc16_52 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.3[%self.param_patt: %X]() -> i32 { +// CHECK:STDOUT: fn @Convert.3[%self.param_patt: %X]() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %X = name_ref self, %self -// CHECK:STDOUT: %n.ref: %.1 = name_ref n, @X.%.loc12_8 [template = @X.%.loc12_8] -// CHECK:STDOUT: %.loc20_45.1: ref i32 = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc20_45.2: i32 = bind_value %.loc20_45.1 +// CHECK:STDOUT: %n.ref: %.2 = name_ref n, @X.%.loc12_8 [template = @X.%.loc12_8] +// CHECK:STDOUT: %.loc20_45.1: ref %i32 = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc20_45.2: %i32 = bind_value %.loc20_45.1 // CHECK:STDOUT: return %.loc20_45.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sink_i32(%n.param_patt: i32); +// CHECK:STDOUT: fn @Sink_i32(%n.param_patt: %i32); // CHECK:STDOUT: // CHECK:STDOUT: fn @Sink_X(%x.param_patt: %X); // CHECK:STDOUT: @@ -227,13 +235,13 @@ fn Test() { // CHECK:STDOUT: %T.patt.loc27_11.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc27_11.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc27_35.2: = specific_function constants.%Source, @Source(%T.loc27_11.2) [symbolic = %.loc27_35.2 (constants.%.13)] +// CHECK:STDOUT: %.loc27_35.2: = specific_function constants.%Source, @Source(%T.loc27_11.2) [symbolic = %.loc27_35.2 (constants.%.14)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) -> @Source.%T.loc27_11.2 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Source.ref: %Source.type = name_ref Source, file.%Source.decl [template = constants.%Source] // CHECK:STDOUT: %T.ref.loc27_42: type = name_ref T, %T.loc27_11.1 [symbolic = %T.loc27_11.2 (constants.%T)] -// CHECK:STDOUT: %.loc27_35.1: = specific_function %Source.ref, @Source(constants.%T) [symbolic = %.loc27_35.2 (constants.%.13)] +// CHECK:STDOUT: %.loc27_35.1: = specific_function %Source.ref, @Source(constants.%T) [symbolic = %.loc27_35.2 (constants.%.14)] // CHECK:STDOUT: %Source.call: init @Source.%T.loc27_11.2 (%T) = call %.loc27_35.1() // CHECK:STDOUT: %.loc27_44.1: @Source.%T.loc27_11.2 (%T) = value_of_initializer %Source.call // CHECK:STDOUT: %.loc27_44.2: @Source.%T.loc27_11.2 (%T) = converted %Source.call, %.loc27_44.1 @@ -246,29 +254,30 @@ fn Test() { // CHECK:STDOUT: %Sink_i32.ref: %Sink_i32.type = name_ref Sink_i32, file.%Sink_i32.decl [template = constants.%Sink_i32] // CHECK:STDOUT: %Source.ref.loc30: %Source.type = name_ref Source, file.%Source.decl [template = constants.%Source] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %.loc30_12: = specific_function %Source.ref.loc30, @Source(constants.%X) [template = constants.%.14] +// CHECK:STDOUT: %.loc30_12: = specific_function %Source.ref.loc30, @Source(constants.%X) [template = constants.%.15] // CHECK:STDOUT: %.loc30_18.1: ref %X = temporary_storage // CHECK:STDOUT: %Source.call.loc30: init %X = call %.loc30_12() to %.loc30_18.1 -// CHECK:STDOUT: %.loc30_18.2: %Convert.type.5 = interface_witness_access constants.%.12, element0 [template = constants.%Convert.4] +// CHECK:STDOUT: %.loc30_18.2: %Convert.type.5 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.4] // CHECK:STDOUT: %.loc30_18.3: = bound_method %Source.call.loc30, %.loc30_18.2 // CHECK:STDOUT: %.loc30_18.4: ref %X = temporary %.loc30_18.1, %Source.call.loc30 // CHECK:STDOUT: %.loc30_18.5: %X = bind_value %.loc30_18.4 -// CHECK:STDOUT: %Convert.call.loc30: init i32 = call %.loc30_18.3(%.loc30_18.5) -// CHECK:STDOUT: %.loc30_18.6: i32 = value_of_initializer %Convert.call.loc30 -// CHECK:STDOUT: %.loc30_18.7: i32 = converted %Source.call.loc30, %.loc30_18.6 +// CHECK:STDOUT: %Convert.call.loc30: init %i32 = call %.loc30_18.3(%.loc30_18.5) +// CHECK:STDOUT: %.loc30_18.6: %i32 = value_of_initializer %Convert.call.loc30 +// CHECK:STDOUT: %.loc30_18.7: %i32 = converted %Source.call.loc30, %.loc30_18.6 // CHECK:STDOUT: %Sink_i32.call: init %empty_tuple.type = call %Sink_i32.ref(%.loc30_18.7) // CHECK:STDOUT: %Sink_X.ref: %Sink_X.type = name_ref Sink_X, file.%Sink_X.decl [template = constants.%Sink_X] // CHECK:STDOUT: %Source.ref.loc31: %Source.type = name_ref Source, file.%Source.decl [template = constants.%Source] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc31_16.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc31_16.2: type = converted %int.make_type_32, %.loc31_16.1 [template = i32] -// CHECK:STDOUT: %.loc31_10: = specific_function %Source.ref.loc31, @Source(i32) [template = constants.%.34] -// CHECK:STDOUT: %Source.call.loc31: init i32 = call %.loc31_10() -// CHECK:STDOUT: %.loc31_16.3: %Convert.type.3 = interface_witness_access constants.%.8, element0 [template = constants.%Convert.2] +// CHECK:STDOUT: %.loc31_17: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc31_17) [template = constants.%i32] +// CHECK:STDOUT: %.loc31_16.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc31_16.2: type = converted %int.make_type_signed, %.loc31_16.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc31_10: = specific_function %Source.ref.loc31, @Source(constants.%i32) [template = constants.%.31] +// CHECK:STDOUT: %Source.call.loc31: init %i32 = call %.loc31_10() +// CHECK:STDOUT: %.loc31_16.3: %Convert.type.3 = interface_witness_access constants.%.9, element0 [template = constants.%Convert.2] // CHECK:STDOUT: %.loc31_16.4: = bound_method %Source.call.loc31, %.loc31_16.3 // CHECK:STDOUT: %.loc31_16.5: ref %X = temporary_storage -// CHECK:STDOUT: %.loc31_16.6: i32 = value_of_initializer %Source.call.loc31 -// CHECK:STDOUT: %.loc31_16.7: i32 = converted %Source.call.loc31, %.loc31_16.6 +// CHECK:STDOUT: %.loc31_16.6: %i32 = value_of_initializer %Source.call.loc31 +// CHECK:STDOUT: %.loc31_16.7: %i32 = converted %Source.call.loc31, %.loc31_16.6 // CHECK:STDOUT: %Convert.call.loc31: init %X = call %.loc31_16.4(%.loc31_16.7) to %.loc31_16.5 // CHECK:STDOUT: %.loc31_16.8: init %X = converted %Source.call.loc31, %Convert.call.loc31 // CHECK:STDOUT: %.loc31_16.9: ref %X = temporary %.loc31_16.5, %.loc31_16.8 @@ -282,7 +291,7 @@ fn Test() { // CHECK:STDOUT: %T.patt.loc27_11.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc27_35.2 => constants.%.13 +// CHECK:STDOUT: %.loc27_35.2 => constants.%.14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Source(%T.loc27_11.2) { @@ -295,14 +304,14 @@ fn Test() { // CHECK:STDOUT: %T.patt.loc27_11.2 => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc27_35.2 => constants.%.14 +// CHECK:STDOUT: %.loc27_35.2 => constants.%.15 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Source(i32) { -// CHECK:STDOUT: %T.loc27_11.2 => i32 -// CHECK:STDOUT: %T.patt.loc27_11.2 => i32 +// CHECK:STDOUT: specific @Source(constants.%i32) { +// CHECK:STDOUT: %T.loc27_11.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc27_11.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.loc27_35.2 => constants.%.34 +// CHECK:STDOUT: %.loc27_35.2 => constants.%.31 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index 35f46a6b2b3e..4820175b8cf3 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -218,37 +218,42 @@ let x: i32 = c[0]; // CHECK:STDOUT: --- overloaded_builtin.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %IndexWith.type.1: type = generic_interface_type @IndexWith [template] // CHECK:STDOUT: %IndexWith: %IndexWith.type.1 = struct_value () [template] -// CHECK:STDOUT: %IndexWith.type.3: type = facet_type <@IndexWith, @IndexWith(i32, i32)> [template] +// CHECK:STDOUT: %IndexWith.type.3: type = facet_type <@IndexWith, @IndexWith(%i32, %i32)> [template] // CHECK:STDOUT: %At.type.2: type = fn_type @At.2 [template] // CHECK:STDOUT: %At.2: %At.type.2 = struct_value () [template] -// CHECK:STDOUT: %At.type.3: type = fn_type @At.1, @IndexWith(i32, i32) [template] -// CHECK:STDOUT: %.5: = interface_witness (%At.2) [template] -// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.9: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %At.type.3: type = fn_type @At.1, @IndexWith(%i32, %i32) [template] +// CHECK:STDOUT: %.6: = interface_witness (%At.2) [template] +// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.9: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.10: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.33: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.34: = bound_method %.8, %Convert.15 [template] -// CHECK:STDOUT: %.35: i32 = int_value 1 [template] -// CHECK:STDOUT: %.36: = bound_method %.9, %Convert.15 [template] -// CHECK:STDOUT: %.37: i32 = int_value 5 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.35, %.37) [template] -// CHECK:STDOUT: %.38: = bound_method %.7, %Convert.15 [template] -// CHECK:STDOUT: %.39: i32 = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.2(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.30: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.31: = bound_method %.9, %Convert.14 [template] +// CHECK:STDOUT: %.32: = specific_function %.31, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.33: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.34: = bound_method %.10, %Convert.14 [template] +// CHECK:STDOUT: %.35: = specific_function %.34, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.36: %i32 = int_value 5 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.33, %.36) [template] +// CHECK:STDOUT: %.37: = bound_method %.8, %Convert.14 [template] +// CHECK:STDOUT: %.38: = specific_function %.37, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.39: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .IndexWith = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.7 // CHECK:STDOUT: import Core//prelude @@ -265,106 +270,118 @@ let x: i32 = c[0]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: impl_decl @impl.1 [template] {} { -// CHECK:STDOUT: %int.make_type_32.loc4_7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_15.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc4_7, %int.make_type_32.loc4_12) -// CHECK:STDOUT: %.loc4_15.2: type = value_of_initializer %int.make_type_32.loc4_7 [template = i32] -// CHECK:STDOUT: %.loc4_15.3: type = converted %int.make_type_32.loc4_7, %.loc4_15.2 [template = i32] -// CHECK:STDOUT: %.loc4_15.4: type = value_of_initializer %int.make_type_32.loc4_12 [template = i32] -// CHECK:STDOUT: %.loc4_15.5: type = converted %int.make_type_32.loc4_12, %.loc4_15.4 [template = i32] +// CHECK:STDOUT: %.loc4_7: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_7: init type = call constants.%Int(%.loc4_7) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_12: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_12: init type = call constants.%Int(%.loc4_12) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_15.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc4_7, %int.make_type_signed.loc4_12) +// CHECK:STDOUT: %.loc4_15.2: type = value_of_initializer %int.make_type_signed.loc4_7 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_15.3: type = converted %int.make_type_signed.loc4_7, %.loc4_15.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_15.4: type = value_of_initializer %int.make_type_signed.loc4_12 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_15.5: type = converted %int.make_type_signed.loc4_12, %.loc4_15.4 [template = constants.%i32] // CHECK:STDOUT: %.loc4_15.6: type = converted %.loc4_15.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %IndexWith.ref: %IndexWith.type.1 = name_ref IndexWith, imports.%import_ref.2 [template = constants.%IndexWith] -// CHECK:STDOUT: %int.make_type_32.loc4_35: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc4_40: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_34.1: type = value_of_initializer %int.make_type_32.loc4_35 [template = i32] -// CHECK:STDOUT: %.loc4_34.2: type = converted %int.make_type_32.loc4_35, %.loc4_34.1 [template = i32] -// CHECK:STDOUT: %.loc4_34.3: type = value_of_initializer %int.make_type_32.loc4_40 [template = i32] -// CHECK:STDOUT: %.loc4_34.4: type = converted %int.make_type_32.loc4_40, %.loc4_34.3 [template = i32] -// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(i32, i32)> [template = constants.%IndexWith.type.3] +// CHECK:STDOUT: %.loc4_35: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_35: init type = call constants.%Int(%.loc4_35) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_40: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4_40: init type = call constants.%Int(%.loc4_40) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_34.1: type = value_of_initializer %int.make_type_signed.loc4_35 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_34.2: type = converted %int.make_type_signed.loc4_35, %.loc4_34.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_34.3: type = value_of_initializer %int.make_type_signed.loc4_40 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_34.4: type = converted %int.make_type_signed.loc4_40, %.loc4_34.3 [template = constants.%i32] +// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%i32, constants.%i32)> [template = constants.%IndexWith.type.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc10_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc10_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_17.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc10_9, %int.make_type_32.loc10_14) -// CHECK:STDOUT: %.loc10_17.2: type = value_of_initializer %int.make_type_32.loc10_9 [template = i32] -// CHECK:STDOUT: %.loc10_17.3: type = converted %int.make_type_32.loc10_9, %.loc10_17.2 [template = i32] -// CHECK:STDOUT: %.loc10_17.4: type = value_of_initializer %int.make_type_32.loc10_14 [template = i32] -// CHECK:STDOUT: %.loc10_17.5: type = converted %int.make_type_32.loc10_14, %.loc10_17.4 [template = i32] +// CHECK:STDOUT: %.loc10_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc10_9: init type = call constants.%Int(%.loc10_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc10_14: init type = call constants.%Int(%.loc10_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc10_9, %int.make_type_signed.loc10_14) +// CHECK:STDOUT: %.loc10_17.2: type = value_of_initializer %int.make_type_signed.loc10_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_17.3: type = converted %int.make_type_signed.loc10_9, %.loc10_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_17.4: type = value_of_initializer %int.make_type_signed.loc10_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc10_17.5: type = converted %int.make_type_signed.loc10_14, %.loc10_17.4 [template = constants.%i32] // CHECK:STDOUT: %.loc10_17.6: type = converted %.loc10_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_32.loc11, %.loc11_8.1 [template = i32] +// CHECK:STDOUT: %.loc11_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_8.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_8.3: type = converted %int.make_type_signed.loc11, %.loc11_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %.loc4_15.6 as %IndexWith.type { // CHECK:STDOUT: %At.decl: %At.type.2 = fn_decl @At.2 [template = constants.%At.2] { // CHECK:STDOUT: %self.patt: %tuple.type.2 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %tuple.type.2 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %subscript.patt: i32 = binding_pattern subscript -// CHECK:STDOUT: %subscript.param_patt: i32 = value_param_pattern %subscript.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %subscript.patt: %i32 = binding_pattern subscript +// CHECK:STDOUT: %subscript.param_patt: %i32 = value_param_pattern %subscript.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.1.%.loc4_15.6 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %int.make_type_32.loc5_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_32.1: type = value_of_initializer %int.make_type_32.loc5_32 [template = i32] -// CHECK:STDOUT: %.loc5_32.2: type = converted %int.make_type_32.loc5_32, %.loc5_32.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_40: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_40.1: type = value_of_initializer %int.make_type_32.loc5_40 [template = i32] -// CHECK:STDOUT: %.loc5_40.2: type = converted %int.make_type_32.loc5_40, %.loc5_40.1 [template = i32] +// CHECK:STDOUT: %.loc5_32.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_32: init type = call constants.%Int(%.loc5_32.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_32.2: type = value_of_initializer %int.make_type_signed.loc5_32 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_32.3: type = converted %int.make_type_signed.loc5_32, %.loc5_32.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_40.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_40: init type = call constants.%Int(%.loc5_40.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_40.2: type = value_of_initializer %int.make_type_signed.loc5_40 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_40.3: type = converted %int.make_type_signed.loc5_40, %.loc5_40.2 [template = constants.%i32] // CHECK:STDOUT: %self.param: %tuple.type.2 = value_param runtime_param0 // CHECK:STDOUT: %self: %tuple.type.2 = bind_name self, %self.param -// CHECK:STDOUT: %subscript.param: i32 = value_param runtime_param1 -// CHECK:STDOUT: %subscript: i32 = bind_name subscript, %subscript.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %subscript.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %subscript: %i32 = bind_name subscript, %subscript.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc4_45: = interface_witness (%At.decl) [template = constants.%.5] +// CHECK:STDOUT: %.loc4_45: = interface_witness (%At.decl) [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .At = %At.decl // CHECK:STDOUT: witness = %.loc4_45 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @At.2[%self.param_patt: %tuple.type.2](%subscript.param_patt: i32) -> i32 { +// CHECK:STDOUT: fn @At.2[%self.param_patt: %tuple.type.2](%subscript.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %tuple.type.2 = name_ref self, %self -// CHECK:STDOUT: %.loc6_17: Core.IntLiteral = int_value 0 [template = constants.%.7] -// CHECK:STDOUT: %.loc6_16: i32 = tuple_access %self.ref, element0 +// CHECK:STDOUT: %.loc6_17: Core.IntLiteral = int_value 0 [template = constants.%.8] +// CHECK:STDOUT: %.loc6_16: %i32 = tuple_access %self.ref, element0 // CHECK:STDOUT: return %.loc6_16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc10_22: Core.IntLiteral = int_value 1 [template = constants.%.8] -// CHECK:STDOUT: %.loc10_25: Core.IntLiteral = int_value 5 [template = constants.%.9] +// CHECK:STDOUT: %.loc10_22: Core.IntLiteral = int_value 1 [template = constants.%.9] +// CHECK:STDOUT: %.loc10_25: Core.IntLiteral = int_value 5 [template = constants.%.10] // CHECK:STDOUT: %.loc10_26.1: %tuple.type.3 = tuple_literal (%.loc10_22, %.loc10_25) -// CHECK:STDOUT: %.loc10_26.2: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_26.3: = bound_method %.loc10_22, %.loc10_26.2 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc10_26.1: init i32 = call %.loc10_26.3(%.loc10_22) [template = constants.%.35] -// CHECK:STDOUT: %.loc10_26.4: i32 = value_of_initializer %int.convert_checked.loc10_26.1 [template = constants.%.35] -// CHECK:STDOUT: %.loc10_26.5: i32 = converted %.loc10_22, %.loc10_26.4 [template = constants.%.35] -// CHECK:STDOUT: %.loc10_26.6: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_26.7: = bound_method %.loc10_25, %.loc10_26.6 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc10_26.2: init i32 = call %.loc10_26.7(%.loc10_25) [template = constants.%.37] -// CHECK:STDOUT: %.loc10_26.8: i32 = value_of_initializer %int.convert_checked.loc10_26.2 [template = constants.%.37] -// CHECK:STDOUT: %.loc10_26.9: i32 = converted %.loc10_25, %.loc10_26.8 [template = constants.%.37] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.loc10_26.5, %.loc10_26.9) [template = constants.%tuple] +// CHECK:STDOUT: %.loc10_26.2: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_26.3: = bound_method %.loc10_22, %.loc10_26.2 [template = constants.%.31] +// CHECK:STDOUT: %.loc10_26.4: = specific_function %.loc10_26.3, @Convert.2(constants.%.1) [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc10_26.1: init %i32 = call %.loc10_26.4(%.loc10_22) [template = constants.%.33] +// CHECK:STDOUT: %.loc10_26.5: %i32 = value_of_initializer %int.convert_checked.loc10_26.1 [template = constants.%.33] +// CHECK:STDOUT: %.loc10_26.6: %i32 = converted %.loc10_22, %.loc10_26.5 [template = constants.%.33] +// CHECK:STDOUT: %.loc10_26.7: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_26.8: = bound_method %.loc10_25, %.loc10_26.7 [template = constants.%.34] +// CHECK:STDOUT: %.loc10_26.9: = specific_function %.loc10_26.8, @Convert.2(constants.%.1) [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc10_26.2: init %i32 = call %.loc10_26.9(%.loc10_25) [template = constants.%.36] +// CHECK:STDOUT: %.loc10_26.10: %i32 = value_of_initializer %int.convert_checked.loc10_26.2 [template = constants.%.36] +// CHECK:STDOUT: %.loc10_26.11: %i32 = converted %.loc10_25, %.loc10_26.10 [template = constants.%.36] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.loc10_26.6, %.loc10_26.11) [template = constants.%tuple] // CHECK:STDOUT: %.loc10_27: %tuple.type.2 = converted %.loc10_26.1, %tuple [template = constants.%tuple] // CHECK:STDOUT: %s: %tuple.type.2 = bind_name s, %.loc10_27 // CHECK:STDOUT: %s.ref: %tuple.type.2 = name_ref s, %s -// CHECK:STDOUT: %.loc11_16: Core.IntLiteral = int_value 0 [template = constants.%.7] -// CHECK:STDOUT: %.loc11_17.1: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_17.2: = bound_method %.loc11_16, %.loc11_17.1 [template = constants.%.38] -// CHECK:STDOUT: %int.convert_checked.loc11: init i32 = call %.loc11_17.2(%.loc11_16) [template = constants.%.39] -// CHECK:STDOUT: %.loc11_17.3: i32 = value_of_initializer %int.convert_checked.loc11 [template = constants.%.39] -// CHECK:STDOUT: %.loc11_17.4: i32 = converted %.loc11_16, %.loc11_17.3 [template = constants.%.39] -// CHECK:STDOUT: %.loc11_17.5: %At.type.3 = interface_witness_access constants.%.5, element0 [template = constants.%At.2] -// CHECK:STDOUT: %.loc11_17.6: = bound_method %s.ref, %.loc11_17.5 -// CHECK:STDOUT: %At.call: init i32 = call %.loc11_17.6(%s.ref, %.loc11_17.4) -// CHECK:STDOUT: %.loc11_18.1: i32 = value_of_initializer %At.call -// CHECK:STDOUT: %.loc11_18.2: i32 = converted %At.call, %.loc11_18.1 -// CHECK:STDOUT: %e: i32 = bind_name e, %.loc11_18.2 +// CHECK:STDOUT: %.loc11_16: Core.IntLiteral = int_value 0 [template = constants.%.8] +// CHECK:STDOUT: %.loc11_17.1: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_17.2: = bound_method %.loc11_16, %.loc11_17.1 [template = constants.%.37] +// CHECK:STDOUT: %.loc11_17.3: = specific_function %.loc11_17.2, @Convert.2(constants.%.1) [template = constants.%.38] +// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %.loc11_17.3(%.loc11_16) [template = constants.%.39] +// CHECK:STDOUT: %.loc11_17.4: %i32 = value_of_initializer %int.convert_checked.loc11 [template = constants.%.39] +// CHECK:STDOUT: %.loc11_17.5: %i32 = converted %.loc11_16, %.loc11_17.4 [template = constants.%.39] +// CHECK:STDOUT: %.loc11_17.6: %At.type.3 = interface_witness_access constants.%.6, element0 [template = constants.%At.2] +// CHECK:STDOUT: %.loc11_17.7: = bound_method %s.ref, %.loc11_17.6 +// CHECK:STDOUT: %At.call: init %i32 = call %.loc11_17.7(%s.ref, %.loc11_17.5) +// CHECK:STDOUT: %.loc11_18.1: %i32 = value_of_initializer %At.call +// CHECK:STDOUT: %.loc11_18.2: %i32 = converted %At.call, %.loc11_18.1 +// CHECK:STDOUT: %e: %i32 = bind_name e, %.loc11_18.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -507,14 +524,16 @@ let x: i32 = c[0]; // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.4 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .IndexWith = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -531,9 +550,10 @@ let x: i32 = c[0]; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_32, %.loc10_8.1 [template = i32] +// CHECK:STDOUT: %.loc10_8.1: Core.IntLiteral = int_value 32 [template = constants.%.4] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc10_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc10_8.3: type = converted %int.make_type_signed, %.loc10_8.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -553,8 +573,8 @@ let x: i32 = c[0]; // CHECK:STDOUT: %.loc6_14.2: %C = bind_value %.loc6_14.1 // CHECK:STDOUT: %c: %C = bind_name c, %.loc6_14.2 // CHECK:STDOUT: %c.ref: %C = name_ref c, %c -// CHECK:STDOUT: %.loc10: Core.IntLiteral = int_value 0 [template = constants.%.4] -// CHECK:STDOUT: %x: i32 = bind_name x, +// CHECK:STDOUT: %.loc10: Core.IntLiteral = int_value 0 [template = constants.%.5] +// CHECK:STDOUT: %x: %i32 = bind_name x, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/package_expr/fail_not_found.carbon b/toolchain/check/testdata/package_expr/fail_not_found.carbon index 8e1991d155ca..18253a9b4282 100644 --- a/toolchain/check/testdata/package_expr/fail_not_found.carbon +++ b/toolchain/check/testdata/package_expr/fail_not_found.carbon @@ -20,13 +20,15 @@ fn Main() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -43,11 +45,12 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_10.2: type = converted %int.make_type_32, %.loc15_10.1 [template = i32] -// CHECK:STDOUT: %y.var: ref i32 = var y -// CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var +// CHECK:STDOUT: %.loc15_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_10.3: type = converted %int.make_type_signed, %.loc15_10.2 [template = constants.%i32] +// CHECK:STDOUT: %y.var: ref %i32 = var y +// CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: %package.ref: = name_ref package, package [template = package] // CHECK:STDOUT: %x.ref: = name_ref x, [template = ] // CHECK:STDOUT: assign %y.var, diff --git a/toolchain/check/testdata/package_expr/syntax.carbon b/toolchain/check/testdata/package_expr/syntax.carbon index d6d68e18ac0d..6ed1a4ae8000 100644 --- a/toolchain/check/testdata/package_expr/syntax.carbon +++ b/toolchain/check/testdata/package_expr/syntax.carbon @@ -44,20 +44,23 @@ fn Main() { // CHECK:STDOUT: --- global.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -71,29 +74,32 @@ fn Main() { // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_8.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_8.2: type = converted %int.make_type_32.loc4, %.loc4_8.1 [template = i32] -// CHECK:STDOUT: %x.var: ref i32 = var x -// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_8.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_8.2: type = converted %int.make_type_32.loc5, %.loc5_8.1 [template = i32] -// CHECK:STDOUT: %y.var: ref i32 = var y -// CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var +// CHECK:STDOUT: %.loc4_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_8.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_8.3: type = converted %int.make_type_signed.loc4, %.loc4_8.2 [template = constants.%i32] +// CHECK:STDOUT: %x.var: ref %i32 = var x +// CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var +// CHECK:STDOUT: %.loc5_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_8.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_8.3: type = converted %int.make_type_signed.loc5, %.loc5_8.2 [template = constants.%i32] +// CHECK:STDOUT: %y.var: ref %i32 = var y +// CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc4_14: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_15.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_15.2: = bound_method %.loc4_14, %.loc4_15.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc4_15.2(%.loc4_14) [template = constants.%.27] -// CHECK:STDOUT: %.loc4_15.3: init i32 = converted %.loc4_14, %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: assign file.%x.var, %.loc4_15.3 +// CHECK:STDOUT: %.loc4_14: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_15.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_15.2: = bound_method %.loc4_14, %.loc4_15.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc4_15.3: = specific_function %.loc4_15.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc4_15.3(%.loc4_14) [template = constants.%.25] +// CHECK:STDOUT: %.loc4_15.4: init %i32 = converted %.loc4_14, %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: assign file.%x.var, %.loc4_15.4 // CHECK:STDOUT: %package.ref: = name_ref package, package [template = package] -// CHECK:STDOUT: %x.ref: ref i32 = name_ref x, file.%x -// CHECK:STDOUT: %.loc5: i32 = bind_value %x.ref +// CHECK:STDOUT: %x.ref: ref %i32 = name_ref x, file.%x +// CHECK:STDOUT: %.loc5: %i32 = bind_value %x.ref // CHECK:STDOUT: assign file.%y.var, %.loc5 // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -101,25 +107,29 @@ fn Main() { // CHECK:STDOUT: --- inside_fn.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.30: i32 = int_value 1 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.27: = bound_method %.26, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -133,47 +143,52 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_8.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_8.2: type = converted %int.make_type_32, %.loc4_8.1 [template = i32] -// CHECK:STDOUT: %x.var: ref i32 = var x -// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var +// CHECK:STDOUT: %.loc4_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_8.3: type = converted %int.make_type_signed, %.loc4_8.2 [template = constants.%i32] +// CHECK:STDOUT: %x.var: ref %i32 = var x +// CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_10.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_10.2: type = converted %int.make_type_32.loc7, %.loc7_10.1 [template = i32] -// CHECK:STDOUT: %x.var: ref i32 = var x -// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var -// CHECK:STDOUT: %.loc7_16: Core.IntLiteral = int_value 1 [template = constants.%.28] -// CHECK:STDOUT: %.loc7_17.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc7_17.2: = bound_method %.loc7_16, %.loc7_17.1 [template = constants.%.29] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc7_17.2(%.loc7_16) [template = constants.%.30] -// CHECK:STDOUT: %.loc7_17.3: init i32 = converted %.loc7_16, %int.convert_checked [template = constants.%.30] -// CHECK:STDOUT: assign %x.var, %.loc7_17.3 -// CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_10.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] -// CHECK:STDOUT: %.loc9_10.2: type = converted %int.make_type_32.loc9, %.loc9_10.1 [template = i32] -// CHECK:STDOUT: %y.var: ref i32 = var y -// CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var +// CHECK:STDOUT: %.loc7_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%.loc7_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_10.2: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_10.3: type = converted %int.make_type_signed.loc7, %.loc7_10.2 [template = constants.%i32] +// CHECK:STDOUT: %x.var: ref %i32 = var x +// CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var +// CHECK:STDOUT: %.loc7_16: Core.IntLiteral = int_value 1 [template = constants.%.26] +// CHECK:STDOUT: %.loc7_17.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc7_17.2: = bound_method %.loc7_16, %.loc7_17.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc7_17.3: = specific_function %.loc7_17.2, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc7_17.3(%.loc7_16) [template = constants.%.29] +// CHECK:STDOUT: %.loc7_17.4: init %i32 = converted %.loc7_16, %int.convert_checked [template = constants.%.29] +// CHECK:STDOUT: assign %x.var, %.loc7_17.4 +// CHECK:STDOUT: %.loc9_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%.loc9_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_10.2: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_10.3: type = converted %int.make_type_signed.loc9, %.loc9_10.2 [template = constants.%i32] +// CHECK:STDOUT: %y.var: ref %i32 = var y +// CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: %package.ref: = name_ref package, package [template = package] -// CHECK:STDOUT: %x.ref: ref i32 = name_ref x, file.%x -// CHECK:STDOUT: %.loc9_23: i32 = bind_value %x.ref +// CHECK:STDOUT: %x.ref: ref %i32 = name_ref x, file.%x +// CHECK:STDOUT: %.loc9_23: %i32 = bind_value %x.ref // CHECK:STDOUT: assign %y.var, %.loc9_23 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc4_14: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_15.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_15.2: = bound_method %.loc4_14, %.loc4_15.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc4_15.2(%.loc4_14) [template = constants.%.27] -// CHECK:STDOUT: %.loc4_15.3: init i32 = converted %.loc4_14, %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: assign file.%x.var, %.loc4_15.3 +// CHECK:STDOUT: %.loc4_14: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_15.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_15.2: = bound_method %.loc4_14, %.loc4_15.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc4_15.3: = specific_function %.loc4_15.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc4_15.3(%.loc4_14) [template = constants.%.25] +// CHECK:STDOUT: %.loc4_15.4: init %i32 = converted %.loc4_14, %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: assign file.%x.var, %.loc4_15.4 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon index d70b0d8bacdb..e99b181bc1cd 100644 --- a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon +++ b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon @@ -63,13 +63,15 @@ import library "var"; // CHECK:STDOUT: --- var.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -81,11 +83,12 @@ import library "var"; // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_10.2: type = converted %int.make_type_32, %.loc4_10.1 [template = i32] -// CHECK:STDOUT: %Foo.var: ref i32 = var Foo -// CHECK:STDOUT: %Foo: ref i32 = bind_name Foo, %Foo.var +// CHECK:STDOUT: %.loc4_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_10.3: type = converted %int.make_type_signed, %.loc4_10.2 [template = constants.%i32] +// CHECK:STDOUT: %Foo.var: ref %i32 = var Foo +// CHECK:STDOUT: %Foo: ref %i32 = bind_name Foo, %Foo.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_conflict.carbon diff --git a/toolchain/check/testdata/packages/fail_import_type_error.carbon b/toolchain/check/testdata/packages/fail_import_type_error.carbon index 8f7f680d4928..c563a6d6a5f6 100644 --- a/toolchain/check/testdata/packages/fail_import_type_error.carbon +++ b/toolchain/check/testdata/packages/fail_import_type_error.carbon @@ -81,8 +81,10 @@ var d: i32 = d_ref; // CHECK:STDOUT: --- implicit.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -91,7 +93,7 @@ var d: i32 = d_ref; // CHECK:STDOUT: %import_ref.3: ref = import_ref Implicit//default, inst+13, loaded // CHECK:STDOUT: %import_ref.4: ref = import_ref Implicit//default, inst+17, loaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.5 +// CHECK:STDOUT: .Int = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -112,26 +114,30 @@ var d: i32 = d_ref; // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] -// CHECK:STDOUT: %a.var: ref i32 = var a -// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] -// CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_32.loc8, %.loc8_8.1 [template = i32] -// CHECK:STDOUT: %c.var: ref i32 = var c -// CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var -// CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] -// CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_32.loc9, %.loc9_8.1 [template = i32] -// CHECK:STDOUT: %d.var: ref i32 = var d -// CHECK:STDOUT: %d: ref i32 = bind_name d, %d.var +// CHECK:STDOUT: %.loc6_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%.loc6_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] +// CHECK:STDOUT: %.loc6_8.3: type = converted %int.make_type_signed.loc6, %.loc6_8.2 [template = constants.%i32] +// CHECK:STDOUT: %a.var: ref %i32 = var a +// CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var +// CHECK:STDOUT: %.loc7_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%.loc7_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.2: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_8.3: type = converted %int.make_type_signed.loc7, %.loc7_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc8_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%.loc8_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_8.3: type = converted %int.make_type_signed.loc8, %.loc8_8.2 [template = constants.%i32] +// CHECK:STDOUT: %c.var: ref %i32 = var c +// CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var +// CHECK:STDOUT: %.loc9_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%.loc9_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_8.2: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] +// CHECK:STDOUT: %.loc9_8.3: type = converted %int.make_type_signed.loc9, %.loc9_8.2 [template = constants.%i32] +// CHECK:STDOUT: %d.var: ref %i32 = var d +// CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon index 53a489cf4c4b..d22c528ff876 100644 --- a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon +++ b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon @@ -25,20 +25,23 @@ var b: i32 = a; // CHECK:STDOUT: --- lib.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -51,150 +54,132 @@ var b: i32 = a; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_8.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_8.2: type = converted %int.make_type_32, %.loc4_8.1 [template = i32] -// CHECK:STDOUT: %a.var: ref i32 = var a -// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var +// CHECK:STDOUT: %.loc4_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_8.3: type = converted %int.make_type_signed, %.loc4_8.2 [template = constants.%i32] +// CHECK:STDOUT: %a.var: ref %i32 = var a +// CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc4_14: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_15.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_15.2: = bound_method %.loc4_14, %.loc4_15.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc4_15.2(%.loc4_14) [template = constants.%.27] -// CHECK:STDOUT: %.loc4_15.3: init i32 = converted %.loc4_14, %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: assign file.%a.var, %.loc4_15.3 +// CHECK:STDOUT: %.loc4_14: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_15.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_15.2: = bound_method %.loc4_14, %.loc4_15.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc4_15.3: = specific_function %.loc4_15.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc4_15.3(%.loc4_14) [template = constants.%.25] +// CHECK:STDOUT: %.loc4_15.4: init %i32 = converted %.loc4_14, %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: assign file.%a.var, %.loc4_15.4 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- lib.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, imports.%import_ref.8 [symbolic] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.9 [template] -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %.5: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%.5)> [symbolic] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: = interface_witness (%Convert.2) [symbolic] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.3, @impl.2(%N) [symbolic] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic] -// CHECK:STDOUT: %.6: = interface_witness (%Convert.3) [symbolic] -// CHECK:STDOUT: %.7: type = int_type unsigned, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %.4: = interface_witness (%Convert.3) [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.4, @impl.3(%N) [symbolic] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] -// CHECK:STDOUT: %.8: = interface_witness (%Convert.4) [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %.5: = interface_witness (%Convert.4) [symbolic] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.5 [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.19 [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.5, %Convert.type.5 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.15 [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.5, @impl.4(%N) [symbolic] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] -// CHECK:STDOUT: %.11: = interface_witness (%Convert.6) [symbolic] -// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] -// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] -// CHECK:STDOUT: %.12: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %.8: = interface_witness (%Convert.6) [symbolic] // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] // CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%iN)> [symbolic] // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.9: type = assoc_entity_type %As.type.2, %Convert.type.7 [symbolic] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.25 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.7, @impl.5(%N) [symbolic] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] -// CHECK:STDOUT: %.13: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] -// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.32 [symbolic] -// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] -// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] -// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.33 [template] -// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.5)> [symbolic] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.8) [symbolic] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.8, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.9) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.9, @impl.7(%N) [symbolic] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] -// CHECK:STDOUT: %.17: = interface_witness (%Convert.10) [symbolic] -// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] -// CHECK:STDOUT: %.18: = interface_witness (%Convert.11) [symbolic] -// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] -// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] -// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.43 [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] -// CHECK:STDOUT: %.21: = interface_witness (%Convert.13) [symbolic] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] -// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %.14: type = assoc_entity_type %As.type.5, %Convert.type.11 [template] +// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.32 [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.12) [symbolic] +// CHECK:STDOUT: %.17: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.17 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: ref i32 = import_ref Main//lib, inst+15, loaded +// CHECK:STDOUT: %import_ref.1: ref %i32 = import_ref Main//lib, inst+22, loaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.50 +// CHECK:STDOUT: .Int = %import_ref.36 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2 = import_ref Main//lib, inst+30, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//lib, inst+31, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//lib, inst+32, unloaded -// CHECK:STDOUT: %import_ref.5: type = import_ref Main//lib, inst+66, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.6: type = import_ref Main//lib, inst+67, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//lib, inst+68, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//lib, inst+47, unloaded -// CHECK:STDOUT: %import_ref.10: type = import_ref Main//lib, inst+78, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.11: type = import_ref Main//lib, inst+79, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] -// CHECK:STDOUT: %import_ref.12 = import_ref Main//lib, inst+80, unloaded -// CHECK:STDOUT: %import_ref.13: type = import_ref Main//lib, inst+108, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.14: type = import_ref Main//lib, inst+109, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.5)] -// CHECK:STDOUT: %import_ref.15 = import_ref Main//lib, inst+110, unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref Main//lib, inst+133, loaded [template = i32] -// CHECK:STDOUT: %import_ref.17: type = import_ref Main//lib, inst+134, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.18 = import_ref Main//lib, inst+135, unloaded -// CHECK:STDOUT: %import_ref.20: type = import_ref Main//lib, inst+146, loaded [symbolic = @impl.5.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.21: type = import_ref Main//lib, inst+147, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.22 = import_ref Main//lib, inst+148, unloaded -// CHECK:STDOUT: %import_ref.23: type = import_ref Main//lib, inst+173, loaded [symbolic = @impl.6.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.24: type = import_ref Main//lib, inst+174, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.25 = import_ref Main//lib, inst+175, unloaded -// CHECK:STDOUT: %import_ref.26 = import_ref Main//lib, inst+205, unloaded -// CHECK:STDOUT: %import_ref.27 = import_ref Main//lib, inst+206, unloaded -// CHECK:STDOUT: %import_ref.28 = import_ref Main//lib, inst+207, unloaded -// CHECK:STDOUT: %import_ref.29: type = import_ref Main//lib, inst+209, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.30: type = import_ref Main//lib, inst+210, loaded [template = constants.%As.type.3] -// CHECK:STDOUT: %import_ref.31 = import_ref Main//lib, inst+211, unloaded -// CHECK:STDOUT: %import_ref.32 = import_ref Main//lib, inst+226, unloaded -// CHECK:STDOUT: %import_ref.34: type = import_ref Main//lib, inst+248, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.35: type = import_ref Main//lib, inst+249, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] -// CHECK:STDOUT: %import_ref.36 = import_ref Main//lib, inst+250, unloaded -// CHECK:STDOUT: %import_ref.37: type = import_ref Main//lib, inst+277, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.38: type = import_ref Main//lib, inst+278, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] -// CHECK:STDOUT: %import_ref.39 = import_ref Main//lib, inst+279, unloaded -// CHECK:STDOUT: %import_ref.40: type = import_ref Main//lib, inst+302, loaded [template = i32] -// CHECK:STDOUT: %import_ref.41: type = import_ref Main//lib, inst+303, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.42 = import_ref Main//lib, inst+304, unloaded -// CHECK:STDOUT: %import_ref.44: type = import_ref Main//lib, inst+315, loaded [symbolic = @impl.11.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.45: type = import_ref Main//lib, inst+316, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.46 = import_ref Main//lib, inst+317, unloaded -// CHECK:STDOUT: %import_ref.47: type = import_ref Main//lib, inst+342, loaded [symbolic = @impl.12.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.48: type = import_ref Main//lib, inst+343, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.49 = import_ref Main//lib, inst+344, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//lib, inst+37, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//lib, inst+38, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//lib, inst+39, unloaded +// CHECK:STDOUT: %import_ref.5: type = import_ref Main//lib, inst+81, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.6: type = import_ref Main//lib, inst+82, loaded [symbolic = @impl.1.%ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//lib, inst+83, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//lib, inst+54, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref Main//lib, inst+111, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.10: type = import_ref Main//lib, inst+112, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//lib, inst+113, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Main//lib, inst+140, loaded [symbolic = @impl.3.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.13: type = import_ref Main//lib, inst+141, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.14 = import_ref Main//lib, inst+142, unloaded +// CHECK:STDOUT: %import_ref.16: type = import_ref Main//lib, inst+172, loaded [symbolic = @impl.4.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.17: type = import_ref Main//lib, inst+173, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.18 = import_ref Main//lib, inst+174, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//lib, inst+204, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//lib, inst+205, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//lib, inst+206, unloaded +// CHECK:STDOUT: %import_ref.22: type = import_ref Main//lib, inst+212, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.23: type = import_ref Main//lib, inst+213, loaded [symbolic = @impl.5.%As.type (constants.%As.type.3)] +// CHECK:STDOUT: %import_ref.24 = import_ref Main//lib, inst+214, unloaded +// CHECK:STDOUT: %import_ref.25 = import_ref Main//lib, inst+229, unloaded +// CHECK:STDOUT: %import_ref.26: type = import_ref Main//lib, inst+266, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.27: type = import_ref Main//lib, inst+267, loaded [symbolic = @impl.6.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.28 = import_ref Main//lib, inst+268, unloaded +// CHECK:STDOUT: %import_ref.29: type = import_ref Main//lib, inst+295, loaded [symbolic = @impl.7.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.30: type = import_ref Main//lib, inst+296, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.31 = import_ref Main//lib, inst+297, unloaded +// CHECK:STDOUT: %import_ref.33: type = import_ref Main//lib, inst+327, loaded [symbolic = @impl.8.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.34: type = import_ref Main//lib, inst+328, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.35 = import_ref Main//lib, inst+329, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -206,11 +191,12 @@ var b: i32 = a; // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_8.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_8.2: type = converted %int.make_type_32, %.loc4_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc4_8.1: Core.IntLiteral = int_value 32 [template = constants.%.17] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_8.3: type = converted %int.make_type_signed, %.loc4_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { @@ -240,168 +226,148 @@ var b: i32 = a; // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] -// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.13)] -// CHECK:STDOUT: %.2: @As.%.1 (%.13) = assoc_entity element0, imports.%import_ref.32 [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.7) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %.2: @As.%.1 (%.9) = assoc_entity element0, imports.%import_ref.25 [symbolic = %.2 (constants.%.10)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.26 -// CHECK:STDOUT: .Convert = imports.%import_ref.27 -// CHECK:STDOUT: witness = (imports.%import_ref.28) +// CHECK:STDOUT: .Self = imports.%import_ref.19 +// CHECK:STDOUT: .Convert = imports.%import_ref.20 +// CHECK:STDOUT: witness = (imports.%import_ref.21) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.5 as imports.%import_ref.6 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.7 +// CHECK:STDOUT: generic impl @impl.1(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.1(%N) [symbolic = %Convert.type (constants.%Convert.type.2)] +// CHECK:STDOUT: %Convert: @impl.1.%Convert.type (%Convert.type.2) = struct_value () [symbolic = %Convert (constants.%Convert.2)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.5 as imports.%import_ref.6 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.7 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] // CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.10 as imports.%import_ref.11 { +// CHECK:STDOUT: impl: imports.%import_ref.9 as imports.%import_ref.10 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.12 +// CHECK:STDOUT: witness = imports.%import_ref.11 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] // CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.13 as imports.%import_ref.14 { +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.15 +// CHECK:STDOUT: witness = imports.%import_ref.14 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.16 as imports.%import_ref.17 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.18 +// CHECK:STDOUT: generic impl @impl.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.4(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.4.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.16 as imports.%import_ref.17 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.18 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%iN)> [symbolic = %As.type (constants.%As.type.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] -// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.20 as imports.%import_ref.21 { +// CHECK:STDOUT: impl: imports.%import_ref.22 as imports.%import_ref.23 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.22 +// CHECK:STDOUT: witness = imports.%import_ref.24 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%uN)> [symbolic = %As.type (constants.%As.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] -// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.9)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.23 as imports.%import_ref.24 { +// CHECK:STDOUT: impl: imports.%import_ref.26 as imports.%import_ref.27 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.25 +// CHECK:STDOUT: witness = imports.%import_ref.28 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.7: imports.%import_ref.29 as imports.%import_ref.30 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.31 +// CHECK:STDOUT: generic impl @impl.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.7(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.7.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.29 as imports.%import_ref.30 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.31 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] -// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.12)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.12) = struct_value () [symbolic = %Convert (constants.%Convert.12)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.34 as imports.%import_ref.35 { +// CHECK:STDOUT: impl: imports.%import_ref.33 as imports.%import_ref.34 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.36 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] -// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.37 as imports.%import_ref.38 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.39 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.10: imports.%import_ref.40 as imports.%import_ref.41 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.42 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] -// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.44 as imports.%import_ref.45 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.46 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] -// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.47 as imports.%import_ref.48 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.49 +// CHECK:STDOUT: witness = imports.%import_ref.35 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -415,38 +381,38 @@ var b: i32 = a; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { @@ -459,44 +425,44 @@ var b: i32 = a; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: ref i32 = name_ref a, imports.%import_ref.1 -// CHECK:STDOUT: %.loc4: i32 = bind_value %a.ref +// CHECK:STDOUT: %a.ref: ref %i32 = name_ref a, imports.%import_ref.1 +// CHECK:STDOUT: %.loc4: %i32 = bind_value %a.ref // CHECK:STDOUT: assign file.%b.var, %.loc4 // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -506,17 +472,9 @@ var b: i32 = a; // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 -// CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 -// CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.1 => constants.%.3 -// CHECK:STDOUT: %.2 => constants.%.4 +// CHECK:STDOUT: specific @ImplicitAs(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(%Dest) { @@ -524,6 +482,25 @@ var b: i32 = a; // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.1.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -535,62 +512,38 @@ var b: i32 = a; // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @ImplicitAs(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { @@ -598,46 +551,46 @@ var b: i32 = a; // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5 // CHECK:STDOUT: %Convert => constants.%Convert.5 -// CHECK:STDOUT: %.1 => constants.%.9 -// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: specific @impl.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: specific @impl.3(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: specific @impl.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(%N) { +// CHECK:STDOUT: specific @impl.4(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.5(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%Dest) { @@ -645,17 +598,9 @@ var b: i32 = a; // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.3 -// CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 -// CHECK:STDOUT: %Convert => constants.%Convert.9 -// CHECK:STDOUT: %.1 => constants.%.15 -// CHECK:STDOUT: %.2 => constants.%.16 +// CHECK:STDOUT: specific @As(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(%Dest) { @@ -663,6 +608,25 @@ var b: i32 = a; // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.5.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @As(@Convert.6.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -674,62 +638,38 @@ var b: i32 = a; // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.8.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.9.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(@impl.6.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: specific @impl.6(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(%N) { +// CHECK:STDOUT: specific @impl.6(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(Core.IntLiteral) { @@ -737,45 +677,45 @@ var b: i32 = a; // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %As.type => constants.%As.type.5 // CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 -// CHECK:STDOUT: %Convert => constants.%Convert.12 -// CHECK:STDOUT: %.1 => constants.%.19 -// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.11 +// CHECK:STDOUT: %Convert => constants.%Convert.11 +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.2 => constants.%.15 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: specific @impl.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(%N) { +// CHECK:STDOUT: specific @impl.7(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.9(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: specific @impl.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(%N) { +// CHECK:STDOUT: specific @impl.8(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.10(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon index cc685418a5dc..ec93f8534dc8 100644 --- a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon +++ b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon @@ -28,7 +28,7 @@ library "[[@TEST_NAME]]"; import Core library "prelude_empty"; -// CHECK:STDERR: fail_missing_prelude_member.carbon:[[@LINE+4]]:8: error: name `Core.Int32` implicitly referenced here, but not found [CoreNameNotFound] +// CHECK:STDERR: fail_missing_prelude_member.carbon:[[@LINE+4]]:8: error: name `Core.Int` implicitly referenced here, but not found [CoreNameNotFound] // CHECK:STDERR: var n: i32; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -38,7 +38,7 @@ var n: i32; package Core library "[[@TEST_NAME]]"; -fn Int32() -> {} { return {}; } +fn Int[T:! type](N:! T) -> {} { return {}; } // --- use_fake_int.carbon @@ -56,7 +56,7 @@ package Core library "[[@TEST_NAME]]"; // Note that we are intentionally using a different type here from other cases // to test that this function is called, not the one from prelude_fake_int. -fn Int32() -> () { return (); } +fn Int[T:! type](N:! T) -> () { return (); } var n: () = i32; @@ -67,7 +67,7 @@ library "[[@TEST_NAME]]"; // TODO: Decide whether we want to accept this. namespace Core; -fn Core.Int32() -> {} { return {}; } +fn Core.Int[T:! type](N:! T) -> {} { return {}; } var n: {} = i32; @@ -77,7 +77,7 @@ library "[[@TEST_NAME]]"; // TODO: Decide whether we want to accept this. class Core { - fn Int32() -> {} { return {}; } + fn Int[T:! type](N:! T) -> {} { return {}; } } // CHECK:STDERR: fail_prelude_as_class.carbon:[[@LINE+3]]:13: error: package `Core` implicitly referenced here, but not found [CoreNotFound] @@ -87,10 +87,15 @@ var n: {} = i32; // CHECK:STDOUT: --- fail_missing_prelude.carbon // CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc8: Core.IntLiteral = int_value 32 [template = constants.%.1] // CHECK:STDOUT: %n.var: ref = var n // CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } @@ -103,6 +108,10 @@ var n: {} = i32; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_missing_prelude_member.carbon // CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude_empty @@ -115,6 +124,7 @@ var n: {} = i32; // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %.loc10: Core.IntLiteral = int_value 32 [template = constants.%.1] // CHECK:STDOUT: %n.var: ref = var n // CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } @@ -122,46 +132,82 @@ var n: {} = i32; // CHECK:STDOUT: --- prelude_fake_int.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %N: %T = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt: %T = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %struct: %.1 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int32 = %Int32.decl +// CHECK:STDOUT: .Int = %Int.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] { +// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] { +// CHECK:STDOUT: %T.patt.loc4_8.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_8.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_8.1, runtime_param [symbolic = %T.patt.loc4_8.2 (constants.%T.patt)] +// CHECK:STDOUT: %N.patt.loc4_18.1: @Int.%T.loc4_8.2 (%T) = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_18.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: @Int.%T.loc4_8.2 (%T) = value_param_pattern %N.patt.loc4_18.1, runtime_param [symbolic = %N.patt.loc4_18.2 (constants.%N.patt)] // CHECK:STDOUT: %return.patt: %.1 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %.1 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc4_16.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc4_16.2: type = converted %.loc4_16.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_8.1 [symbolic = %T.loc4_8.2 (constants.%T)] +// CHECK:STDOUT: %.loc4_29.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc4_29.2: type = converted %.loc4_29.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc4_8.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_8.2 (constants.%T)] +// CHECK:STDOUT: %N.param: @Int.%T.loc4_8.2 (%T) = value_param runtime_param +// CHECK:STDOUT: %N.loc4_18.1: @Int.%T.loc4_8.2 (%T) = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_18.2 (constants.%N)] // CHECK:STDOUT: %return.param: ref %.1 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %.1 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32() -> %.1 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc4_28: %.1 = struct_literal () -// CHECK:STDOUT: %struct: %.1 = struct_value () [template = constants.%struct] -// CHECK:STDOUT: %.loc4_29: %.1 = converted %.loc4_28, %struct [template = constants.%struct] -// CHECK:STDOUT: return %.loc4_29 +// CHECK:STDOUT: generic fn @Int(%T.loc4_8.1: type, %N.loc4_18.1: @Int.%T.loc4_8.2 (%T)) { +// CHECK:STDOUT: %T.loc4_8.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_8.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_8.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_8.2 (constants.%T.patt)] +// CHECK:STDOUT: %N.loc4_18.2: %T = bind_symbolic_name N, 1 [symbolic = %N.loc4_18.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc4_18.2: %T = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_18.2 (constants.%N.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%T.param_patt: type](%N.param_patt: @Int.%T.loc4_8.2 (%T)) -> %.1 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %.loc4_41: %.1 = struct_literal () +// CHECK:STDOUT: %struct: %.1 = struct_value () [template = constants.%struct] +// CHECK:STDOUT: %.loc4_42: %.1 = converted %.loc4_41, %struct [template = constants.%struct] +// CHECK:STDOUT: return %.loc4_42 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Int(constants.%T, constants.%N) { +// CHECK:STDOUT: %T.loc4_8.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_8.2 => constants.%T +// CHECK:STDOUT: %N.loc4_18.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc4_18.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_fake_int.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %N.1: @Int.%T (%T) = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %N.2: %T = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt.2: %T = symbolic_binding_pattern N, 1 [symbolic] +// CHECK:STDOUT: %.3: = specific_function %Int, @Int(Core.IntLiteral, %.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude_fake_int // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -178,35 +224,77 @@ var n: {} = i32; // CHECK:STDOUT: %n: ref %.1 = bind_name n, %n.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32() -> %.1; +// CHECK:STDOUT: generic fn @Int(constants.%T: type, constants.%N.1: @Int.%T (%T)) { +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] +// CHECK:STDOUT: %N: %T = bind_symbolic_name N, 1 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: %T = symbolic_binding_pattern N, 1 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%T.param_patt: type](%N.param_patt: @Int.%T (%T)) -> %.1; +// CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Int32.call: init %.1 = call constants.%Int32() -// CHECK:STDOUT: assign file.%n.var, %Int32.call +// CHECK:STDOUT: %.loc6: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %.1: = specific_function constants.%Int, @Int(Core.IntLiteral, constants.%.2) [template = constants.%.3] +// CHECK:STDOUT: %Int.call: init %.1 = call %.1() +// CHECK:STDOUT: assign file.%n.var, %Int.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Int(constants.%T, constants.%N.1) { +// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T.patt => constants.%T +// CHECK:STDOUT: %N => constants.%N.1 +// CHECK:STDOUT: %N.patt => constants.%N.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Int(Core.IntLiteral, constants.%.2) { +// CHECK:STDOUT: %T => Core.IntLiteral +// CHECK:STDOUT: %T.patt => Core.IntLiteral +// CHECK:STDOUT: %N => constants.%.2 +// CHECK:STDOUT: %N.patt => constants.%.2 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- prelude_use_in_prelude.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %N: %T = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt: %T = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %.2: = specific_function %Int, @Int(Core.IntLiteral, %.1) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int32 = %Int32.decl +// CHECK:STDOUT: .Int = %Int.decl // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } -// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] { +// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] { +// CHECK:STDOUT: %T.patt.loc8_8.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc8_8.1, runtime_param [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)] +// CHECK:STDOUT: %N.patt.loc8_18.1: @Int.%T.loc8_8.2 (%T) = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc8_18.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: @Int.%T.loc8_8.2 (%T) = value_param_pattern %N.patt.loc8_18.1, runtime_param [symbolic = %N.patt.loc8_18.2 (constants.%N.patt)] // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc8_16.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc8_16.2: type = converted %.loc8_16.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_8.1 [symbolic = %T.loc8_8.2 (constants.%T)] +// CHECK:STDOUT: %.loc8_29.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc8_29.2: type = converted %.loc8_29.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc8_8.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_8.2 (constants.%T)] +// CHECK:STDOUT: %N.param: @Int.%T.loc8_8.2 (%T) = value_param runtime_param +// CHECK:STDOUT: %N.loc8_18.1: @Int.%T.loc8_8.2 (%T) = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc8_18.2 (constants.%N)] // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param0 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param // CHECK:STDOUT: } @@ -216,28 +304,61 @@ var n: {} = i32; // CHECK:STDOUT: %n: ref %empty_tuple.type = bind_name n, %n.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32() -> %empty_tuple.type { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc8_28: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_29: %empty_tuple.type = converted %.loc8_28, %empty_tuple [template = constants.%empty_tuple] -// CHECK:STDOUT: return %.loc8_29 +// CHECK:STDOUT: generic fn @Int(%T.loc8_8.1: type, %N.loc8_18.1: @Int.%T.loc8_8.2 (%T)) { +// CHECK:STDOUT: %T.loc8_8.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_8.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_8.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)] +// CHECK:STDOUT: %N.loc8_18.2: %T = bind_symbolic_name N, 1 [symbolic = %N.loc8_18.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc8_18.2: %T = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc8_18.2 (constants.%N.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%T.param_patt: type](%N.param_patt: @Int.%T.loc8_8.2 (%T)) -> %empty_tuple.type { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %.loc8_41: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_42: %empty_tuple.type = converted %.loc8_41, %empty_tuple [template = constants.%empty_tuple] +// CHECK:STDOUT: return %.loc8_42 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Int32.call: init %empty_tuple.type = call constants.%Int32() -// CHECK:STDOUT: assign file.%n.var, %Int32.call +// CHECK:STDOUT: %.loc10: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %.1: = specific_function constants.%Int, @Int(Core.IntLiteral, constants.%.1) [template = constants.%.2] +// CHECK:STDOUT: %Int.call: init %empty_tuple.type = call %.1() +// CHECK:STDOUT: assign file.%n.var, %Int.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Int(constants.%T, constants.%N) { +// CHECK:STDOUT: %T.loc8_8.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_8.2 => constants.%T +// CHECK:STDOUT: %N.loc8_18.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc8_18.2 => constants.%N +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Int(Core.IntLiteral, constants.%.1) { +// CHECK:STDOUT: %T.loc8_8.2 => Core.IntLiteral +// CHECK:STDOUT: %T.patt.loc8_8.2 => Core.IntLiteral +// CHECK:STDOUT: %N.loc8_18.2 => constants.%.1 +// CHECK:STDOUT: %N.patt.loc8_18.2 => constants.%.1 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- prelude_as_namespace.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %N: %T = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt: %T = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %struct: %.1 = struct_value () [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %.3: = specific_function %Int, @Int(Core.IntLiteral, %.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -246,14 +367,23 @@ var n: {} = i32; // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] { -// CHECK:STDOUT: .Int32 = %Int32.decl +// CHECK:STDOUT: .Int = %Int.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] { +// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] { +// CHECK:STDOUT: %T.patt.loc7_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc7_13.1, runtime_param [symbolic = %T.patt.loc7_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %N.patt.loc7_23.1: @Int.%T.loc7_13.2 (%T) = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc7_23.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: @Int.%T.loc7_13.2 (%T) = value_param_pattern %N.patt.loc7_23.1, runtime_param [symbolic = %N.patt.loc7_23.2 (constants.%N.patt)] // CHECK:STDOUT: %return.patt: %.1 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %.1 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc7_21.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc7_21.2: type = converted %.loc7_21.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc7_13.1 [symbolic = %T.loc7_13.2 (constants.%T)] +// CHECK:STDOUT: %.loc7_34.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc7_34.2: type = converted %.loc7_34.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc7_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc7_13.2 (constants.%T)] +// CHECK:STDOUT: %N.param: @Int.%T.loc7_13.2 (%T) = value_param runtime_param +// CHECK:STDOUT: %N.loc7_23.1: @Int.%T.loc7_13.2 (%T) = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc7_23.2 (constants.%N)] // CHECK:STDOUT: %return.param: ref %.1 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %.1 = return_slot %return.param // CHECK:STDOUT: } @@ -263,30 +393,62 @@ var n: {} = i32; // CHECK:STDOUT: %n: ref %.1 = bind_name n, %n.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32() -> %.1 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc7_33: %.1 = struct_literal () -// CHECK:STDOUT: %struct: %.1 = struct_value () [template = constants.%struct] -// CHECK:STDOUT: %.loc7_34: %.1 = converted %.loc7_33, %struct [template = constants.%struct] -// CHECK:STDOUT: return %.loc7_34 +// CHECK:STDOUT: generic fn @Int(%T.loc7_13.1: type, %N.loc7_23.1: @Int.%T.loc7_13.2 (%T)) { +// CHECK:STDOUT: %T.loc7_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc7_13.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc7_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %N.loc7_23.2: %T = bind_symbolic_name N, 1 [symbolic = %N.loc7_23.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc7_23.2: %T = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc7_23.2 (constants.%N.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%T.param_patt: type](%N.param_patt: @Int.%T.loc7_13.2 (%T)) -> %.1 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %.loc7_46: %.1 = struct_literal () +// CHECK:STDOUT: %struct: %.1 = struct_value () [template = constants.%struct] +// CHECK:STDOUT: %.loc7_47: %.1 = converted %.loc7_46, %struct [template = constants.%struct] +// CHECK:STDOUT: return %.loc7_47 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Int32.call: init %.1 = call constants.%Int32() -// CHECK:STDOUT: assign file.%n.var, %Int32.call +// CHECK:STDOUT: %.loc9: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %.1: = specific_function constants.%Int, @Int(Core.IntLiteral, constants.%.2) [template = constants.%.3] +// CHECK:STDOUT: %Int.call: init %.1 = call %.1() +// CHECK:STDOUT: assign file.%n.var, %Int.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Int(constants.%T, constants.%N) { +// CHECK:STDOUT: %T.loc7_13.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc7_13.2 => constants.%T +// CHECK:STDOUT: %N.loc7_23.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc7_23.2 => constants.%N +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Int(Core.IntLiteral, constants.%.2) { +// CHECK:STDOUT: %T.loc7_13.2 => Core.IntLiteral +// CHECK:STDOUT: %T.patt.loc7_13.2 => Core.IntLiteral +// CHECK:STDOUT: %N.loc7_23.2 => constants.%.2 +// CHECK:STDOUT: %N.patt.loc7_23.2 => constants.%.2 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_prelude_as_class.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Core: type = class_type @Core [template] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %N: %T = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt: %T = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %struct: %.1 = struct_value () [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -302,12 +464,21 @@ var n: {} = i32; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Core { -// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] { +// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] { +// CHECK:STDOUT: %T.patt.loc6_10.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_10.1 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc6_10.2, runtime_param [symbolic = %T.patt.loc6_10.1 (constants.%T.patt)] +// CHECK:STDOUT: %N.patt.loc6_20.2: @Int.%T.loc6_10.1 (%T) = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc6_20.1 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: @Int.%T.loc6_10.1 (%T) = value_param_pattern %N.patt.loc6_20.2, runtime_param [symbolic = %N.patt.loc6_20.1 (constants.%N.patt)] // CHECK:STDOUT: %return.patt: %.1 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %.1 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc6_18.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc6_18.2: type = converted %.loc6_18.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_10.2 [symbolic = %T.loc6_10.1 (constants.%T)] +// CHECK:STDOUT: %.loc6_31.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc6_31.2: type = converted %.loc6_31.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc6_10.2: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_10.1 (constants.%T)] +// CHECK:STDOUT: %N.param: @Int.%T.loc6_10.1 (%T) = value_param runtime_param +// CHECK:STDOUT: %N.loc6_20.2: @Int.%T.loc6_10.1 (%T) = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc6_20.1 (constants.%N)] // CHECK:STDOUT: %return.param: ref %.1 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %.1 = return_slot %return.param // CHECK:STDOUT: } @@ -315,20 +486,37 @@ var n: {} = i32; // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Core -// CHECK:STDOUT: .Int32 = %Int32.decl +// CHECK:STDOUT: .Int = %Int.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32() -> %.1 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc6_30: %.1 = struct_literal () -// CHECK:STDOUT: %struct: %.1 = struct_value () [template = constants.%struct] -// CHECK:STDOUT: %.loc6_31: %.1 = converted %.loc6_30, %struct [template = constants.%struct] -// CHECK:STDOUT: return %.loc6_31 +// CHECK:STDOUT: generic fn @Int(%T.loc6_10.2: type, %N.loc6_20.2: @Int.%T.loc6_10.1 (%T)) { +// CHECK:STDOUT: %T.loc6_10.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_10.1 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc6_10.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_10.1 (constants.%T.patt)] +// CHECK:STDOUT: %N.loc6_20.1: %T = bind_symbolic_name N, 1 [symbolic = %N.loc6_20.1 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc6_20.1: %T = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc6_20.1 (constants.%N.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%T.param_patt: type](%N.param_patt: @Int.%T.loc6_10.1 (%T)) -> %.1 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %.loc6_43: %.1 = struct_literal () +// CHECK:STDOUT: %struct: %.1 = struct_value () [template = constants.%struct] +// CHECK:STDOUT: %.loc6_44: %.1 = converted %.loc6_43, %struct [template = constants.%struct] +// CHECK:STDOUT: return %.loc6_44 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %.loc12: Core.IntLiteral = int_value 32 [template = constants.%.3] // CHECK:STDOUT: assign file.%n.var, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Int(constants.%T, constants.%N) { +// CHECK:STDOUT: %T.loc6_10.1 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_10.1 => constants.%T +// CHECK:STDOUT: %N.loc6_20.1 => constants.%N +// CHECK:STDOUT: %N.patt.loc6_20.1 => constants.%N +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/address_of_deref.carbon b/toolchain/check/testdata/pointer/address_of_deref.carbon index c30c84b30235..9003aca5b5af 100644 --- a/toolchain/check/testdata/pointer/address_of_deref.carbon +++ b/toolchain/check/testdata/pointer/address_of_deref.carbon @@ -16,23 +16,26 @@ fn F() -> i32 { // CHECK:STDOUT: --- address_of_deref.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] -// CHECK:STDOUT: %.28: type = ptr_type i32 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.26: type = ptr_type %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -46,36 +49,39 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed.loc11, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32 { +// CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %n.var: ref i32 = var n -// CHECK:STDOUT: %n: ref i32 = bind_name n, %n.var -// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_17.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_17.2: = bound_method %.loc12_16, %.loc12_17.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_17.2(%.loc12_16) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_17.3: init i32 = converted %.loc12_16, %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: assign %n.var, %.loc12_17.3 -// CHECK:STDOUT: %n.ref: ref i32 = name_ref n, %n -// CHECK:STDOUT: %.loc13_13: %.28 = addr_of %n.ref -// CHECK:STDOUT: %.loc13_12: ref i32 = deref %.loc13_13 -// CHECK:STDOUT: %.loc13_11: %.28 = addr_of %.loc13_12 -// CHECK:STDOUT: %.loc13_10.1: ref i32 = deref %.loc13_11 -// CHECK:STDOUT: %.loc13_10.2: i32 = bind_value %.loc13_10.1 +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed.loc12, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %n.var: ref %i32 = var n +// CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var +// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_17.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_17.2: = bound_method %.loc12_16, %.loc12_17.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_17.3: = specific_function %.loc12_17.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc12_17.3(%.loc12_16) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_17.4: init %i32 = converted %.loc12_16, %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: assign %n.var, %.loc12_17.4 +// CHECK:STDOUT: %n.ref: ref %i32 = name_ref n, %n +// CHECK:STDOUT: %.loc13_13: %.26 = addr_of %n.ref +// CHECK:STDOUT: %.loc13_12: ref %i32 = deref %.loc13_13 +// CHECK:STDOUT: %.loc13_11: %.26 = addr_of %.loc13_12 +// CHECK:STDOUT: %.loc13_10.1: ref %i32 = deref %.loc13_11 +// CHECK:STDOUT: %.loc13_10.2: %i32 = bind_value %.loc13_10.1 // CHECK:STDOUT: return %.loc13_10.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index 2eca427d6cb3..e3cf2dc17350 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -25,33 +25,37 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.2: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.5: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 2 [template] -// CHECK:STDOUT: %struct: %.1 = struct_value (%.31, %.33) [template] -// CHECK:STDOUT: %.34: type = ptr_type i32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.6: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 2 [template] +// CHECK:STDOUT: %struct: %.2 = struct_value (%.29, %.32) [template] +// CHECK:STDOUT: %.33: type = ptr_type %i32 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.31, %.33) [template] -// CHECK:STDOUT: %.36: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.29, %.32) [template] +// CHECK:STDOUT: %.35: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -69,115 +73,129 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc12_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_15.1: type = value_of_initializer %int.make_type_32.loc12_15 [template = i32] -// CHECK:STDOUT: %.loc12_15.2: type = converted %int.make_type_32.loc12_15, %.loc12_15.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc12_24: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_24.1: type = value_of_initializer %int.make_type_32.loc12_24 [template = i32] -// CHECK:STDOUT: %.loc12_24.2: type = converted %int.make_type_32.loc12_24, %.loc12_24.1 [template = i32] -// CHECK:STDOUT: %.loc12_27: type = struct_type {.a: i32, .b: i32} [template = constants.%.1] -// CHECK:STDOUT: %s.var: ref %.1 = var s -// CHECK:STDOUT: %s: ref %.1 = bind_name s, %s.var -// CHECK:STDOUT: %.loc12_37: Core.IntLiteral = int_value 1 [template = constants.%.3] -// CHECK:STDOUT: %.loc12_45: Core.IntLiteral = int_value 2 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_46.1: %.5 = struct_literal (%.loc12_37, %.loc12_45) -// CHECK:STDOUT: %.loc12_46.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_46.3: = bound_method %.loc12_37, %.loc12_46.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc12_46.1: init i32 = call %.loc12_46.3(%.loc12_37) [template = constants.%.31] -// CHECK:STDOUT: %.loc12_46.4: init i32 = converted %.loc12_37, %int.convert_checked.loc12_46.1 [template = constants.%.31] -// CHECK:STDOUT: %.loc12_46.5: ref i32 = struct_access %s.var, element0 -// CHECK:STDOUT: %.loc12_46.6: init i32 = initialize_from %.loc12_46.4 to %.loc12_46.5 [template = constants.%.31] -// CHECK:STDOUT: %.loc12_46.7: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_46.8: = bound_method %.loc12_45, %.loc12_46.7 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc12_46.2: init i32 = call %.loc12_46.8(%.loc12_45) [template = constants.%.33] -// CHECK:STDOUT: %.loc12_46.9: init i32 = converted %.loc12_45, %int.convert_checked.loc12_46.2 [template = constants.%.33] -// CHECK:STDOUT: %.loc12_46.10: ref i32 = struct_access %s.var, element1 -// CHECK:STDOUT: %.loc12_46.11: init i32 = initialize_from %.loc12_46.9 to %.loc12_46.10 [template = constants.%.33] -// CHECK:STDOUT: %.loc12_46.12: init %.1 = struct_init (%.loc12_46.6, %.loc12_46.11) to %s.var [template = constants.%struct] -// CHECK:STDOUT: %.loc12_47: init %.1 = converted %.loc12_46.1, %.loc12_46.12 [template = constants.%struct] +// CHECK:STDOUT: %.loc12_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_15: init type = call constants.%Int(%.loc12_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_15.2: type = value_of_initializer %int.make_type_signed.loc12_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_15.3: type = converted %int.make_type_signed.loc12_15, %.loc12_15.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_24.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_24: init type = call constants.%Int(%.loc12_24.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_24.2: type = value_of_initializer %int.make_type_signed.loc12_24 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_24.3: type = converted %int.make_type_signed.loc12_24, %.loc12_24.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_27: type = struct_type {.a: %i32, .b: %i32} [template = constants.%.2] +// CHECK:STDOUT: %s.var: ref %.2 = var s +// CHECK:STDOUT: %s: ref %.2 = bind_name s, %s.var +// CHECK:STDOUT: %.loc12_37: Core.IntLiteral = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_45: Core.IntLiteral = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc12_46.1: %.6 = struct_literal (%.loc12_37, %.loc12_45) +// CHECK:STDOUT: %.loc12_46.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_46.3: = bound_method %.loc12_37, %.loc12_46.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_46.4: = specific_function %.loc12_46.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc12_46.1: init %i32 = call %.loc12_46.4(%.loc12_37) [template = constants.%.29] +// CHECK:STDOUT: %.loc12_46.5: init %i32 = converted %.loc12_37, %int.convert_checked.loc12_46.1 [template = constants.%.29] +// CHECK:STDOUT: %.loc12_46.6: ref %i32 = struct_access %s.var, element0 +// CHECK:STDOUT: %.loc12_46.7: init %i32 = initialize_from %.loc12_46.5 to %.loc12_46.6 [template = constants.%.29] +// CHECK:STDOUT: %.loc12_46.8: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_46.9: = bound_method %.loc12_45, %.loc12_46.8 [template = constants.%.30] +// CHECK:STDOUT: %.loc12_46.10: = specific_function %.loc12_46.9, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc12_46.2: init %i32 = call %.loc12_46.10(%.loc12_45) [template = constants.%.32] +// CHECK:STDOUT: %.loc12_46.11: init %i32 = converted %.loc12_45, %int.convert_checked.loc12_46.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc12_46.12: ref %i32 = struct_access %s.var, element1 +// CHECK:STDOUT: %.loc12_46.13: init %i32 = initialize_from %.loc12_46.11 to %.loc12_46.12 [template = constants.%.32] +// CHECK:STDOUT: %.loc12_46.14: init %.2 = struct_init (%.loc12_46.7, %.loc12_46.13) to %s.var [template = constants.%struct] +// CHECK:STDOUT: %.loc12_47: init %.2 = converted %.loc12_46.1, %.loc12_46.14 [template = constants.%struct] // CHECK:STDOUT: assign %s.var, %.loc12_47 -// CHECK:STDOUT: %int.make_type_32.loc14_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_15.1: type = value_of_initializer %int.make_type_32.loc14_15 [template = i32] -// CHECK:STDOUT: %.loc14_15.2: type = converted %int.make_type_32.loc14_15, %.loc14_15.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_24: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_24.1: type = value_of_initializer %int.make_type_32.loc14_24 [template = i32] -// CHECK:STDOUT: %.loc14_24.2: type = converted %int.make_type_32.loc14_24, %.loc14_24.1 [template = i32] -// CHECK:STDOUT: %.loc14_27: type = struct_type {.a: i32, .b: i32} [template = constants.%.1] -// CHECK:STDOUT: %.loc14_28: type = ptr_type %.1 [template = constants.%.2] -// CHECK:STDOUT: %p.var: ref %.2 = var p -// CHECK:STDOUT: %p: ref %.2 = bind_name p, %p.var -// CHECK:STDOUT: %s.ref.loc14: ref %.1 = name_ref s, %s -// CHECK:STDOUT: %.loc14_32: %.2 = addr_of %s.ref.loc14 +// CHECK:STDOUT: %.loc14_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_15: init type = call constants.%Int(%.loc14_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_15.2: type = value_of_initializer %int.make_type_signed.loc14_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_15.3: type = converted %int.make_type_signed.loc14_15, %.loc14_15.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_24: init type = call constants.%Int(%.loc14_24.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.2: type = value_of_initializer %int.make_type_signed.loc14_24 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.3: type = converted %int.make_type_signed.loc14_24, %.loc14_24.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_27: type = struct_type {.a: %i32, .b: %i32} [template = constants.%.2] +// CHECK:STDOUT: %.loc14_28: type = ptr_type %.2 [template = constants.%.3] +// CHECK:STDOUT: %p.var: ref %.3 = var p +// CHECK:STDOUT: %p: ref %.3 = bind_name p, %p.var +// CHECK:STDOUT: %s.ref.loc14: ref %.2 = name_ref s, %s +// CHECK:STDOUT: %.loc14_32: %.3 = addr_of %s.ref.loc14 // CHECK:STDOUT: assign %p.var, %.loc14_32 -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_13.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_13.2: type = converted %int.make_type_32.loc15, %.loc15_13.1 [template = i32] -// CHECK:STDOUT: %.loc15_13.3: type = ptr_type i32 [template = constants.%.34] -// CHECK:STDOUT: %q.var: ref %.34 = var q -// CHECK:STDOUT: %q: ref %.34 = bind_name q, %q.var -// CHECK:STDOUT: %s.ref.loc15: ref %.1 = name_ref s, %s -// CHECK:STDOUT: %.loc15_19: ref i32 = struct_access %s.ref.loc15, element0 -// CHECK:STDOUT: %.loc15_17: %.34 = addr_of %.loc15_19 +// CHECK:STDOUT: %.loc15_10: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_10) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_13.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_13.2: type = converted %int.make_type_signed.loc15, %.loc15_13.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_13.3: type = ptr_type %i32 [template = constants.%.33] +// CHECK:STDOUT: %q.var: ref %.33 = var q +// CHECK:STDOUT: %q: ref %.33 = bind_name q, %q.var +// CHECK:STDOUT: %s.ref.loc15: ref %.2 = name_ref s, %s +// CHECK:STDOUT: %.loc15_19: ref %i32 = struct_access %s.ref.loc15, element0 +// CHECK:STDOUT: %.loc15_17: %.33 = addr_of %.loc15_19 // CHECK:STDOUT: assign %q.var, %.loc15_17 -// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] -// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_32.loc16, %.loc16_13.1 [template = i32] -// CHECK:STDOUT: %.loc16_13.3: type = ptr_type i32 [template = constants.%.34] -// CHECK:STDOUT: %r.var: ref %.34 = var r -// CHECK:STDOUT: %r: ref %.34 = bind_name r, %r.var -// CHECK:STDOUT: %s.ref.loc16: ref %.1 = name_ref s, %s -// CHECK:STDOUT: %.loc16_19: ref i32 = struct_access %s.ref.loc16, element1 -// CHECK:STDOUT: %.loc16_17: %.34 = addr_of %.loc16_19 +// CHECK:STDOUT: %.loc16_10: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%.loc16_10) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_signed.loc16, %.loc16_13.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_13.3: type = ptr_type %i32 [template = constants.%.33] +// CHECK:STDOUT: %r.var: ref %.33 = var r +// CHECK:STDOUT: %r: ref %.33 = bind_name r, %r.var +// CHECK:STDOUT: %s.ref.loc16: ref %.2 = name_ref s, %s +// CHECK:STDOUT: %.loc16_19: ref %i32 = struct_access %s.ref.loc16, element1 +// CHECK:STDOUT: %.loc16_17: %.33 = addr_of %.loc16_19 // CHECK:STDOUT: assign %r.var, %.loc16_17 -// CHECK:STDOUT: %int.make_type_32.loc18_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc18_16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_19.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc18_11, %int.make_type_32.loc18_16) -// CHECK:STDOUT: %.loc18_19.2: type = value_of_initializer %int.make_type_32.loc18_11 [template = i32] -// CHECK:STDOUT: %.loc18_19.3: type = converted %int.make_type_32.loc18_11, %.loc18_19.2 [template = i32] -// CHECK:STDOUT: %.loc18_19.4: type = value_of_initializer %int.make_type_32.loc18_16 [template = i32] -// CHECK:STDOUT: %.loc18_19.5: type = converted %int.make_type_32.loc18_16, %.loc18_19.4 [template = i32] +// CHECK:STDOUT: %.loc18_11: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18_11: init type = call constants.%Int(%.loc18_11) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_16: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18_16: init type = call constants.%Int(%.loc18_16) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_19.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc18_11, %int.make_type_signed.loc18_16) +// CHECK:STDOUT: %.loc18_19.2: type = value_of_initializer %int.make_type_signed.loc18_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_19.3: type = converted %int.make_type_signed.loc18_11, %.loc18_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_19.4: type = value_of_initializer %int.make_type_signed.loc18_16 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_19.5: type = converted %int.make_type_signed.loc18_16, %.loc18_19.4 [template = constants.%i32] // CHECK:STDOUT: %.loc18_19.6: type = converted %.loc18_19.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %t.var: ref %tuple.type.2 = var t // CHECK:STDOUT: %t: ref %tuple.type.2 = bind_name t, %t.var -// CHECK:STDOUT: %.loc18_24: Core.IntLiteral = int_value 1 [template = constants.%.3] -// CHECK:STDOUT: %.loc18_27: Core.IntLiteral = int_value 2 [template = constants.%.4] +// CHECK:STDOUT: %.loc18_24: Core.IntLiteral = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc18_27: Core.IntLiteral = int_value 2 [template = constants.%.5] // CHECK:STDOUT: %.loc18_28.1: %tuple.type.3 = tuple_literal (%.loc18_24, %.loc18_27) -// CHECK:STDOUT: %.loc18_28.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_28.3: = bound_method %.loc18_24, %.loc18_28.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc18_28.1: init i32 = call %.loc18_28.3(%.loc18_24) [template = constants.%.31] -// CHECK:STDOUT: %.loc18_28.4: init i32 = converted %.loc18_24, %int.convert_checked.loc18_28.1 [template = constants.%.31] -// CHECK:STDOUT: %.loc18_28.5: ref i32 = tuple_access %t.var, element0 -// CHECK:STDOUT: %.loc18_28.6: init i32 = initialize_from %.loc18_28.4 to %.loc18_28.5 [template = constants.%.31] -// CHECK:STDOUT: %.loc18_28.7: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_28.8: = bound_method %.loc18_27, %.loc18_28.7 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc18_28.2: init i32 = call %.loc18_28.8(%.loc18_27) [template = constants.%.33] -// CHECK:STDOUT: %.loc18_28.9: init i32 = converted %.loc18_27, %int.convert_checked.loc18_28.2 [template = constants.%.33] -// CHECK:STDOUT: %.loc18_28.10: ref i32 = tuple_access %t.var, element1 -// CHECK:STDOUT: %.loc18_28.11: init i32 = initialize_from %.loc18_28.9 to %.loc18_28.10 [template = constants.%.33] -// CHECK:STDOUT: %.loc18_28.12: init %tuple.type.2 = tuple_init (%.loc18_28.6, %.loc18_28.11) to %t.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc18_29: init %tuple.type.2 = converted %.loc18_28.1, %.loc18_28.12 [template = constants.%tuple] +// CHECK:STDOUT: %.loc18_28.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_28.3: = bound_method %.loc18_24, %.loc18_28.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc18_28.4: = specific_function %.loc18_28.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc18_28.1: init %i32 = call %.loc18_28.4(%.loc18_24) [template = constants.%.29] +// CHECK:STDOUT: %.loc18_28.5: init %i32 = converted %.loc18_24, %int.convert_checked.loc18_28.1 [template = constants.%.29] +// CHECK:STDOUT: %.loc18_28.6: ref %i32 = tuple_access %t.var, element0 +// CHECK:STDOUT: %.loc18_28.7: init %i32 = initialize_from %.loc18_28.5 to %.loc18_28.6 [template = constants.%.29] +// CHECK:STDOUT: %.loc18_28.8: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_28.9: = bound_method %.loc18_27, %.loc18_28.8 [template = constants.%.30] +// CHECK:STDOUT: %.loc18_28.10: = specific_function %.loc18_28.9, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc18_28.2: init %i32 = call %.loc18_28.10(%.loc18_27) [template = constants.%.32] +// CHECK:STDOUT: %.loc18_28.11: init %i32 = converted %.loc18_27, %int.convert_checked.loc18_28.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc18_28.12: ref %i32 = tuple_access %t.var, element1 +// CHECK:STDOUT: %.loc18_28.13: init %i32 = initialize_from %.loc18_28.11 to %.loc18_28.12 [template = constants.%.32] +// CHECK:STDOUT: %.loc18_28.14: init %tuple.type.2 = tuple_init (%.loc18_28.7, %.loc18_28.13) to %t.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc18_29: init %tuple.type.2 = converted %.loc18_28.1, %.loc18_28.14 [template = constants.%tuple] // CHECK:STDOUT: assign %t.var, %.loc18_29 -// CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_14.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] -// CHECK:STDOUT: %.loc19_14.2: type = converted %int.make_type_32.loc19, %.loc19_14.1 [template = i32] -// CHECK:STDOUT: %.loc19_14.3: type = ptr_type i32 [template = constants.%.34] -// CHECK:STDOUT: %t0.var: ref %.34 = var t0 -// CHECK:STDOUT: %t0: ref %.34 = bind_name t0, %t0.var +// CHECK:STDOUT: %.loc19_11: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19: init type = call constants.%Int(%.loc19_11) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_14.1: type = value_of_initializer %int.make_type_signed.loc19 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_14.2: type = converted %int.make_type_signed.loc19, %.loc19_14.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_14.3: type = ptr_type %i32 [template = constants.%.33] +// CHECK:STDOUT: %t0.var: ref %.33 = var t0 +// CHECK:STDOUT: %t0: ref %.33 = bind_name t0, %t0.var // CHECK:STDOUT: %t.ref.loc19: ref %tuple.type.2 = name_ref t, %t -// CHECK:STDOUT: %.loc19_21: Core.IntLiteral = int_value 0 [template = constants.%.36] -// CHECK:STDOUT: %.loc19_20: ref i32 = tuple_access %t.ref.loc19, element0 -// CHECK:STDOUT: %.loc19_18: %.34 = addr_of %.loc19_20 +// CHECK:STDOUT: %.loc19_21: Core.IntLiteral = int_value 0 [template = constants.%.35] +// CHECK:STDOUT: %.loc19_20: ref %i32 = tuple_access %t.ref.loc19, element0 +// CHECK:STDOUT: %.loc19_18: %.33 = addr_of %.loc19_20 // CHECK:STDOUT: assign %t0.var, %.loc19_18 -// CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc20_14.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32] -// CHECK:STDOUT: %.loc20_14.2: type = converted %int.make_type_32.loc20, %.loc20_14.1 [template = i32] -// CHECK:STDOUT: %.loc20_14.3: type = ptr_type i32 [template = constants.%.34] -// CHECK:STDOUT: %t1.var: ref %.34 = var t1 -// CHECK:STDOUT: %t1: ref %.34 = bind_name t1, %t1.var +// CHECK:STDOUT: %.loc20_11: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%.loc20_11) [template = constants.%i32] +// CHECK:STDOUT: %.loc20_14.1: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] +// CHECK:STDOUT: %.loc20_14.2: type = converted %int.make_type_signed.loc20, %.loc20_14.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc20_14.3: type = ptr_type %i32 [template = constants.%.33] +// CHECK:STDOUT: %t1.var: ref %.33 = var t1 +// CHECK:STDOUT: %t1: ref %.33 = bind_name t1, %t1.var // CHECK:STDOUT: %t.ref.loc20: ref %tuple.type.2 = name_ref t, %t -// CHECK:STDOUT: %.loc20_21: Core.IntLiteral = int_value 1 [template = constants.%.3] -// CHECK:STDOUT: %.loc20_20: ref i32 = tuple_access %t.ref.loc20, element1 -// CHECK:STDOUT: %.loc20_18: %.34 = addr_of %.loc20_20 +// CHECK:STDOUT: %.loc20_21: Core.IntLiteral = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc20_20: ref %i32 = tuple_access %t.ref.loc20, element1 +// CHECK:STDOUT: %.loc20_18: %.33 = addr_of %.loc20_20 // CHECK:STDOUT: assign %t1.var, %.loc20_18 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/basic.carbon b/toolchain/check/testdata/pointer/basic.carbon index 2e4ba05d23e1..59d36b496fc4 100644 --- a/toolchain/check/testdata/pointer/basic.carbon +++ b/toolchain/check/testdata/pointer/basic.carbon @@ -18,23 +18,26 @@ fn F() -> i32 { // CHECK:STDOUT: --- basic.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] -// CHECK:STDOUT: %.28: type = ptr_type i32 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.26: type = ptr_type %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -48,43 +51,47 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed.loc11, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32 { +// CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %n.var: ref i32 = var n -// CHECK:STDOUT: %n: ref i32 = bind_name n, %n.var -// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_17.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_17.2: = bound_method %.loc12_16, %.loc12_17.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_17.2(%.loc12_16) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_17.3: init i32 = converted %.loc12_16, %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: assign %n.var, %.loc12_17.3 -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32.loc13, %.loc13_13.1 [template = i32] -// CHECK:STDOUT: %.loc13_13.3: type = ptr_type i32 [template = constants.%.28] -// CHECK:STDOUT: %p.var: ref %.28 = var p -// CHECK:STDOUT: %p: ref %.28 = bind_name p, %p.var -// CHECK:STDOUT: %n.ref: ref i32 = name_ref n, %n -// CHECK:STDOUT: %.loc13_17: %.28 = addr_of %n.ref +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed.loc12, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %n.var: ref %i32 = var n +// CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var +// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_17.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_17.2: = bound_method %.loc12_16, %.loc12_17.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_17.3: = specific_function %.loc12_17.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc12_17.3(%.loc12_16) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_17.4: init %i32 = converted %.loc12_16, %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: assign %n.var, %.loc12_17.4 +// CHECK:STDOUT: %.loc13_10: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_10) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_signed.loc13, %.loc13_13.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_13.3: type = ptr_type %i32 [template = constants.%.26] +// CHECK:STDOUT: %p.var: ref %.26 = var p +// CHECK:STDOUT: %p: ref %.26 = bind_name p, %p.var +// CHECK:STDOUT: %n.ref: ref %i32 = name_ref n, %n +// CHECK:STDOUT: %.loc13_17: %.26 = addr_of %n.ref // CHECK:STDOUT: assign %p.var, %.loc13_17 -// CHECK:STDOUT: %p.ref: ref %.28 = name_ref p, %p -// CHECK:STDOUT: %.loc15_11: %.28 = bind_value %p.ref -// CHECK:STDOUT: %.loc15_10.1: ref i32 = deref %.loc15_11 -// CHECK:STDOUT: %.loc15_10.2: i32 = bind_value %.loc15_10.1 +// CHECK:STDOUT: %p.ref: ref %.26 = name_ref p, %p +// CHECK:STDOUT: %.loc15_11: %.26 = bind_value %p.ref +// CHECK:STDOUT: %.loc15_10.1: ref %i32 = deref %.loc15_11 +// CHECK:STDOUT: %.loc15_10.2: %i32 = bind_value %.loc15_10.1 // CHECK:STDOUT: return %.loc15_10.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/fail_address_of_value.carbon b/toolchain/check/testdata/pointer/fail_address_of_value.carbon index b806cdb5a547..473fe860d925 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_value.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_value.carbon @@ -102,51 +102,53 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: --- fail_address_of_value.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: i32} [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] // CHECK:STDOUT: %AddressOfLiteral.type: type = fn_type @AddressOfLiteral [template] // CHECK:STDOUT: %AddressOfLiteral: %AddressOfLiteral.type = struct_value () [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.3: type = ptr_type Core.IntLiteral [template] -// CHECK:STDOUT: %.4: bool = bool_literal true [template] -// CHECK:STDOUT: %.5: type = ptr_type bool [template] -// CHECK:STDOUT: %.6: f64 = float_literal 1 [template] -// CHECK:STDOUT: %.7: type = ptr_type f64 [template] -// CHECK:STDOUT: %.8: type = ptr_type String [template] -// CHECK:STDOUT: %.9: String = string_literal "Hello" [template] -// CHECK:STDOUT: %.10: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.11: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.4: type = ptr_type Core.IntLiteral [template] +// CHECK:STDOUT: %.5: bool = bool_literal true [template] +// CHECK:STDOUT: %.6: type = ptr_type bool [template] +// CHECK:STDOUT: %.7: f64 = float_literal 1 [template] +// CHECK:STDOUT: %.8: type = ptr_type f64 [template] +// CHECK:STDOUT: %.9: type = ptr_type String [template] +// CHECK:STDOUT: %.10: String = string_literal "Hello" [template] +// CHECK:STDOUT: %.11: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.12: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.12: type = ptr_type %tuple.type [template] -// CHECK:STDOUT: %.13: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %.14: type = struct_type {.a: Core.IntLiteral} [template] -// CHECK:STDOUT: %.15: type = ptr_type %.14 [template] +// CHECK:STDOUT: %.13: type = ptr_type %tuple.type [template] +// CHECK:STDOUT: %.14: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.15: type = struct_type {.a: Core.IntLiteral} [template] +// CHECK:STDOUT: %.16: type = ptr_type %.15 [template] // CHECK:STDOUT: %AddressOfOperator.type: type = fn_type @AddressOfOperator [template] // CHECK:STDOUT: %AddressOfOperator: %AddressOfOperator.type = struct_value () [template] -// CHECK:STDOUT: %.16: bool = bool_literal false [template] -// CHECK:STDOUT: %.17: type = ptr_type i32 [template] +// CHECK:STDOUT: %.17: bool = bool_literal false [template] +// CHECK:STDOUT: %.18: type = ptr_type %i32 [template] // CHECK:STDOUT: %AddressOfCall.type: type = fn_type @AddressOfCall [template] // CHECK:STDOUT: %AddressOfCall: %AddressOfCall.type = struct_value () [template] // CHECK:STDOUT: %AddressOfType.type: type = fn_type @AddressOfType [template] // CHECK:STDOUT: %AddressOfType: %AddressOfType.type = struct_value () [template] -// CHECK:STDOUT: %.18: type = ptr_type type [template] -// CHECK:STDOUT: %.19: type = const_type i32 [template] -// CHECK:STDOUT: %.20: type = ptr_type %.19 [template] +// CHECK:STDOUT: %.19: type = ptr_type type [template] +// CHECK:STDOUT: %.20: type = const_type %i32 [template] +// CHECK:STDOUT: %.21: type = ptr_type %.20 [template] // CHECK:STDOUT: %AddressOfTupleElementValue.type: type = fn_type @AddressOfTupleElementValue [template] // CHECK:STDOUT: %AddressOfTupleElementValue: %AddressOfTupleElementValue.type = struct_value () [template] -// CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%.10, %.11) [template] +// CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%.11, %.12) [template] // CHECK:STDOUT: %AddressOfParam.type: type = fn_type @AddressOfParam [template] // CHECK:STDOUT: %AddressOfParam: %AddressOfParam.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -166,25 +168,27 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] { -// CHECK:STDOUT: %return.patt: %.1 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.1 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_16.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_16.2: type = converted %int.make_type_32, %.loc13_16.1 [template = i32] -// CHECK:STDOUT: %.loc13_19: type = struct_type {.a: i32} [template = constants.%.1] -// CHECK:STDOUT: %return.param: ref %.1 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref %.1 = return_slot %return.param +// CHECK:STDOUT: %.loc13_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_16.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_16.3: type = converted %int.make_type_signed, %.loc13_16.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_19: type = struct_type {.a: %i32} [template = constants.%.2] +// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %AddressOfLiteral.decl: %AddressOfLiteral.type = fn_decl @AddressOfLiteral [template = constants.%AddressOfLiteral] {} {} // CHECK:STDOUT: %AddressOfOperator.decl: %AddressOfOperator.type = fn_decl @AddressOfOperator [template = constants.%AddressOfOperator] {} {} @@ -192,110 +196,114 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: %AddressOfType.decl: %AddressOfType.type = fn_decl @AddressOfType [template = constants.%AddressOfType] {} {} // CHECK:STDOUT: %AddressOfTupleElementValue.decl: %AddressOfTupleElementValue.type = fn_decl @AddressOfTupleElementValue [template = constants.%AddressOfTupleElementValue] {} {} // CHECK:STDOUT: %AddressOfParam.decl: %AddressOfParam.type = fn_decl @AddressOfParam [template = constants.%AddressOfParam] { -// CHECK:STDOUT: %param.patt: i32 = binding_pattern param -// CHECK:STDOUT: %param.param_patt: i32 = value_param_pattern %param.patt, runtime_param0 +// CHECK:STDOUT: %param.patt: %i32 = binding_pattern param +// CHECK:STDOUT: %param.param_patt: %i32 = value_param_pattern %param.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc95: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc95_26.1: type = value_of_initializer %int.make_type_32.loc95 [template = i32] -// CHECK:STDOUT: %.loc95_26.2: type = converted %int.make_type_32.loc95, %.loc95_26.1 [template = i32] -// CHECK:STDOUT: %param.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %param: i32 = bind_name param, %param.param +// CHECK:STDOUT: %.loc95_26.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc95: init type = call constants.%Int(%.loc95_26.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc95_26.2: type = value_of_initializer %int.make_type_signed.loc95 [template = constants.%i32] +// CHECK:STDOUT: %.loc95_26.3: type = converted %int.make_type_signed.loc95, %.loc95_26.2 [template = constants.%i32] +// CHECK:STDOUT: %param.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %param: %i32 = bind_name param, %param.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> i32; +// CHECK:STDOUT: fn @G() -> %i32; // CHECK:STDOUT: -// CHECK:STDOUT: fn @H() -> %.1; +// CHECK:STDOUT: fn @H() -> %.2; // CHECK:STDOUT: // CHECK:STDOUT: fn @AddressOfLiteral() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc20_4: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc20_3: %.3 = addr_of [template = ] -// CHECK:STDOUT: %.loc25_4: bool = bool_literal true [template = constants.%.4] -// CHECK:STDOUT: %.loc25_3: %.5 = addr_of [template = ] -// CHECK:STDOUT: %.loc30_4: f64 = float_literal 1 [template = constants.%.6] -// CHECK:STDOUT: %.loc30_3: %.7 = addr_of [template = ] -// CHECK:STDOUT: %.loc35_4: String = string_literal "Hello" [template = constants.%.9] -// CHECK:STDOUT: %.loc35_3: %.8 = addr_of [template = ] -// CHECK:STDOUT: %.loc40_5: Core.IntLiteral = int_value 1 [template = constants.%.10] -// CHECK:STDOUT: %.loc40_8: Core.IntLiteral = int_value 2 [template = constants.%.11] +// CHECK:STDOUT: %.loc20_4: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc20_3: %.4 = addr_of [template = ] +// CHECK:STDOUT: %.loc25_4: bool = bool_literal true [template = constants.%.5] +// CHECK:STDOUT: %.loc25_3: %.6 = addr_of [template = ] +// CHECK:STDOUT: %.loc30_4: f64 = float_literal 1 [template = constants.%.7] +// CHECK:STDOUT: %.loc30_3: %.8 = addr_of [template = ] +// CHECK:STDOUT: %.loc35_4: String = string_literal "Hello" [template = constants.%.10] +// CHECK:STDOUT: %.loc35_3: %.9 = addr_of [template = ] +// CHECK:STDOUT: %.loc40_5: Core.IntLiteral = int_value 1 [template = constants.%.11] +// CHECK:STDOUT: %.loc40_8: Core.IntLiteral = int_value 2 [template = constants.%.12] // CHECK:STDOUT: %.loc40_9: %tuple.type = tuple_literal (%.loc40_5, %.loc40_8) -// CHECK:STDOUT: %.loc40_3: %.12 = addr_of [template = ] -// CHECK:STDOUT: %.loc45_10: Core.IntLiteral = int_value 5 [template = constants.%.13] -// CHECK:STDOUT: %.loc45_11: %.14 = struct_literal (%.loc45_10) -// CHECK:STDOUT: %.loc45_3: %.15 = addr_of [template = ] +// CHECK:STDOUT: %.loc40_3: %.13 = addr_of [template = ] +// CHECK:STDOUT: %.loc45_10: Core.IntLiteral = int_value 5 [template = constants.%.14] +// CHECK:STDOUT: %.loc45_11: %.15 = struct_literal (%.loc45_10) +// CHECK:STDOUT: %.loc45_3: %.16 = addr_of [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @AddressOfOperator() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc53_5: bool = bool_literal true [template = constants.%.4] -// CHECK:STDOUT: %.loc53_10.1: bool = bool_literal false [template = constants.%.16] +// CHECK:STDOUT: %.loc53_5: bool = bool_literal true [template = constants.%.5] +// CHECK:STDOUT: %.loc53_10.1: bool = bool_literal false [template = constants.%.17] // CHECK:STDOUT: if %.loc53_5 br !and.rhs else br !and.result(%.loc53_10.1) // CHECK:STDOUT: // CHECK:STDOUT: !and.rhs: -// CHECK:STDOUT: %.loc53_14: bool = bool_literal false [template = constants.%.16] +// CHECK:STDOUT: %.loc53_14: bool = bool_literal false [template = constants.%.17] // CHECK:STDOUT: br !and.result(%.loc53_14) // CHECK:STDOUT: // CHECK:STDOUT: !and.result: -// CHECK:STDOUT: %.loc53_10.2: bool = block_arg !and.result [template = constants.%.16] -// CHECK:STDOUT: %.loc53_3: %.5 = addr_of [template = ] +// CHECK:STDOUT: %.loc53_10.2: bool = block_arg !and.result [template = constants.%.17] +// CHECK:STDOUT: %.loc53_3: %.6 = addr_of [template = ] // CHECK:STDOUT: %H.ref: %H.type = name_ref H, file.%H.decl [template = constants.%H] -// CHECK:STDOUT: %H.call: init %.1 = call %H.ref() -// CHECK:STDOUT: %.loc58_5.1: ref %.1 = temporary_storage -// CHECK:STDOUT: %.loc58_5.2: ref %.1 = temporary %.loc58_5.1, %H.call -// CHECK:STDOUT: %.loc58_7: ref i32 = struct_access %.loc58_5.2, element0 -// CHECK:STDOUT: %.loc58_3: %.17 = addr_of [template = ] -// CHECK:STDOUT: %.loc63_9: bool = bool_literal true [template = constants.%.4] -// CHECK:STDOUT: %.loc63_5: bool = not %.loc63_9 [template = constants.%.16] -// CHECK:STDOUT: %.loc63_3: %.5 = addr_of [template = ] +// CHECK:STDOUT: %H.call: init %.2 = call %H.ref() +// CHECK:STDOUT: %.loc58_5.1: ref %.2 = temporary_storage +// CHECK:STDOUT: %.loc58_5.2: ref %.2 = temporary %.loc58_5.1, %H.call +// CHECK:STDOUT: %.loc58_7: ref %i32 = struct_access %.loc58_5.2, element0 +// CHECK:STDOUT: %.loc58_3: %.18 = addr_of [template = ] +// CHECK:STDOUT: %.loc63_9: bool = bool_literal true [template = constants.%.5] +// CHECK:STDOUT: %.loc63_5: bool = not %.loc63_9 [template = constants.%.17] +// CHECK:STDOUT: %.loc63_3: %.6 = addr_of [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @AddressOfCall() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [template = constants.%G] -// CHECK:STDOUT: %G.call: init i32 = call %G.ref() -// CHECK:STDOUT: %.loc71: %.17 = addr_of [template = ] +// CHECK:STDOUT: %G.call: init %i32 = call %G.ref() +// CHECK:STDOUT: %.loc71: %.18 = addr_of [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @AddressOfType() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc79: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc79: %.18 = addr_of [template = ] -// CHECK:STDOUT: %int.make_type_32.loc84: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc84_5.1: type = value_of_initializer %int.make_type_32.loc84 [template = i32] -// CHECK:STDOUT: %.loc84_5.2: type = converted %int.make_type_32.loc84, %.loc84_5.1 [template = i32] -// CHECK:STDOUT: %.loc84_5.3: type = const_type i32 [template = constants.%.19] -// CHECK:STDOUT: %.loc84_14: type = ptr_type %.19 [template = constants.%.20] -// CHECK:STDOUT: %.loc84_3: %.18 = addr_of [template = ] +// CHECK:STDOUT: %.loc79_4: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc79: init type = call constants.%Int(%.loc79_4) [template = constants.%i32] +// CHECK:STDOUT: %.loc79_3: %.19 = addr_of [template = ] +// CHECK:STDOUT: %.loc84_11: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc84: init type = call constants.%Int(%.loc84_11) [template = constants.%i32] +// CHECK:STDOUT: %.loc84_5.1: type = value_of_initializer %int.make_type_signed.loc84 [template = constants.%i32] +// CHECK:STDOUT: %.loc84_5.2: type = converted %int.make_type_signed.loc84, %.loc84_5.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc84_5.3: type = const_type %i32 [template = constants.%.20] +// CHECK:STDOUT: %.loc84_14: type = ptr_type %.20 [template = constants.%.21] +// CHECK:STDOUT: %.loc84_3: %.19 = addr_of [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @AddressOfTupleElementValue() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc92_6: Core.IntLiteral = int_value 1 [template = constants.%.10] -// CHECK:STDOUT: %.loc92_9: Core.IntLiteral = int_value 2 [template = constants.%.11] +// CHECK:STDOUT: %.loc92_6: Core.IntLiteral = int_value 1 [template = constants.%.11] +// CHECK:STDOUT: %.loc92_9: Core.IntLiteral = int_value 2 [template = constants.%.12] // CHECK:STDOUT: %.loc92_10.1: %tuple.type = tuple_literal (%.loc92_6, %.loc92_9) -// CHECK:STDOUT: %.loc92_12: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc92_12: Core.IntLiteral = int_value 0 [template = constants.%.3] // CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%.loc92_6, %.loc92_9) [template = constants.%tuple] // CHECK:STDOUT: %.loc92_10.2: %tuple.type = converted %.loc92_10.1, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %.loc92_11: Core.IntLiteral = tuple_access %.loc92_10.2, element0 [template = constants.%.10] -// CHECK:STDOUT: %.loc92_3: %.3 = addr_of [template = ] +// CHECK:STDOUT: %.loc92_11: Core.IntLiteral = tuple_access %.loc92_10.2, element0 [template = constants.%.11] +// CHECK:STDOUT: %.loc92_3: %.4 = addr_of [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AddressOfParam(%param.param_patt: i32) { +// CHECK:STDOUT: fn @AddressOfParam(%param.param_patt: %i32) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc99: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc99_22.1: type = value_of_initializer %int.make_type_32.loc99 [template = i32] -// CHECK:STDOUT: %.loc99_22.2: type = converted %int.make_type_32.loc99, %.loc99_22.1 [template = i32] -// CHECK:STDOUT: %.loc99_22.3: type = ptr_type i32 [template = constants.%.17] -// CHECK:STDOUT: %param_addr.var: ref %.17 = var param_addr -// CHECK:STDOUT: %param_addr: ref %.17 = bind_name param_addr, %param_addr.var -// CHECK:STDOUT: %param.ref: i32 = name_ref param, %param -// CHECK:STDOUT: %.loc99_26: %.17 = addr_of [template = ] +// CHECK:STDOUT: %.loc99_19: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc99: init type = call constants.%Int(%.loc99_19) [template = constants.%i32] +// CHECK:STDOUT: %.loc99_22.1: type = value_of_initializer %int.make_type_signed.loc99 [template = constants.%i32] +// CHECK:STDOUT: %.loc99_22.2: type = converted %int.make_type_signed.loc99, %.loc99_22.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc99_22.3: type = ptr_type %i32 [template = constants.%.18] +// CHECK:STDOUT: %param_addr.var: ref %.18 = var param_addr +// CHECK:STDOUT: %param_addr: ref %.18 = bind_name param_addr, %param_addr.var +// CHECK:STDOUT: %param.ref: %i32 = name_ref param, %param +// CHECK:STDOUT: %.loc99_26: %.18 = addr_of [template = ] // CHECK:STDOUT: assign %param_addr.var, %.loc99_26 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/fail_deref_error.carbon b/toolchain/check/testdata/pointer/fail_deref_error.carbon index f418207acc39..544b50b72617 100644 --- a/toolchain/check/testdata/pointer/fail_deref_error.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_error.carbon @@ -21,13 +21,15 @@ let n2: i32 = undeclared->foo; // CHECK:STDOUT: --- fail_deref_error.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -40,23 +42,25 @@ let n2: i32 = undeclared->foo; // CHECK:STDOUT: .n2 = @__global_init.%n2 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc19_9.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] -// CHECK:STDOUT: %.loc19_9.2: type = converted %int.make_type_32.loc19, %.loc19_9.1 [template = i32] +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed.loc15, %.loc15_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc19: init type = call constants.%Int(%.loc19_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc19_9.2: type = value_of_initializer %int.make_type_signed.loc19 [template = constants.%i32] +// CHECK:STDOUT: %.loc19_9.3: type = converted %int.make_type_signed.loc19, %.loc19_9.2 [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %undeclared.ref.loc15: = name_ref undeclared, [template = ] // CHECK:STDOUT: %.loc15: ref = deref -// CHECK:STDOUT: %n: i32 = bind_name n, +// CHECK:STDOUT: %n: %i32 = bind_name n, // CHECK:STDOUT: %undeclared.ref.loc19: = name_ref undeclared, [template = ] // CHECK:STDOUT: %.loc19: ref = deref // CHECK:STDOUT: %foo.ref: = name_ref foo, [template = ] -// CHECK:STDOUT: %n2: i32 = bind_name n2, +// CHECK:STDOUT: %n2: %i32 = bind_name n2, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon index a3149384f683..964ee7ddb702 100644 --- a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon @@ -43,19 +43,21 @@ fn Deref(n: i32) { // CHECK:STDOUT: --- fail_deref_not_pointer.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Deref.type: type = fn_type @Deref [template] // CHECK:STDOUT: %Deref: %Deref.type = struct_value () [template] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %struct: %.1 = struct_value () [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %struct: %.2 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -68,22 +70,23 @@ fn Deref(n: i32) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Deref.decl: %Deref.type = fn_decl @Deref [template = constants.%Deref] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32, %.loc11_13.1 [template = i32] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %.loc11_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.3: type = converted %int.make_type_signed, %.loc11_13.2 [template = constants.%i32] +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Deref(%n.param_patt: i32) { +// CHECK:STDOUT: fn @Deref(%n.param_patt: %i32) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref.loc16: i32 = name_ref n, %n +// CHECK:STDOUT: %n.ref.loc16: %i32 = name_ref n, %n // CHECK:STDOUT: %.loc16: ref = deref %n.ref.loc16 -// CHECK:STDOUT: %n.ref.loc21: i32 = name_ref n, %n +// CHECK:STDOUT: %n.ref.loc21: %i32 = name_ref n, %n // CHECK:STDOUT: %.loc21: ref = deref %n.ref.loc21 // CHECK:STDOUT: %foo.ref.loc21: = name_ref foo, [template = ] // CHECK:STDOUT: %.loc26_5.1: %empty_tuple.type = tuple_literal () @@ -95,13 +98,13 @@ fn Deref(n: i32) { // CHECK:STDOUT: %.loc31_4.2: %empty_tuple.type = converted %.loc31_4.1, %empty_tuple.loc31 [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc31_5: ref = deref %.loc31_4.2 // CHECK:STDOUT: %foo.ref.loc31: = name_ref foo, [template = ] -// CHECK:STDOUT: %.loc36_5.1: %.1 = struct_literal () -// CHECK:STDOUT: %struct.loc36: %.1 = struct_value () [template = constants.%struct] -// CHECK:STDOUT: %.loc36_5.2: %.1 = converted %.loc36_5.1, %struct.loc36 [template = constants.%struct] +// CHECK:STDOUT: %.loc36_5.1: %.2 = struct_literal () +// CHECK:STDOUT: %struct.loc36: %.2 = struct_value () [template = constants.%struct] +// CHECK:STDOUT: %.loc36_5.2: %.2 = converted %.loc36_5.1, %struct.loc36 [template = constants.%struct] // CHECK:STDOUT: %.loc36_3: ref = deref %.loc36_5.2 -// CHECK:STDOUT: %.loc40_4.1: %.1 = struct_literal () -// CHECK:STDOUT: %struct.loc40: %.1 = struct_value () [template = constants.%struct] -// CHECK:STDOUT: %.loc40_4.2: %.1 = converted %.loc40_4.1, %struct.loc40 [template = constants.%struct] +// CHECK:STDOUT: %.loc40_4.1: %.2 = struct_literal () +// CHECK:STDOUT: %struct.loc40: %.2 = struct_value () [template = constants.%struct] +// CHECK:STDOUT: %.loc40_4.2: %.2 = converted %.loc40_4.1, %struct.loc40 [template = constants.%struct] // CHECK:STDOUT: %.loc40_5: ref = deref %.loc40_4.2 // CHECK:STDOUT: %foo.ref.loc40: = name_ref foo, [template = ] // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/pointer/fail_deref_type.carbon b/toolchain/check/testdata/pointer/fail_deref_type.carbon index 18ea0b8e564f..df630fdeaaae 100644 --- a/toolchain/check/testdata/pointer/fail_deref_type.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_type.carbon @@ -24,13 +24,15 @@ var p2: i32->foo; // CHECK:STDOUT: --- fail_deref_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -43,16 +45,18 @@ var p2: i32->foo; // CHECK:STDOUT: .p2 = %p2 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_9.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] -// CHECK:STDOUT: %.loc18_9.2: type = converted %int.make_type_32.loc18, %.loc18_9.1 [template = i32] -// CHECK:STDOUT: %.loc18_8: ref = deref %.loc18_9.2 +// CHECK:STDOUT: %.loc18_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%.loc18_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_9.2: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_9.3: type = converted %int.make_type_signed.loc18, %.loc18_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_8: ref = deref %.loc18_9.3 // CHECK:STDOUT: %p.var: ref = var p // CHECK:STDOUT: %p: ref = bind_name p, %p.var -// CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_9.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] -// CHECK:STDOUT: %.loc22_9.2: type = converted %int.make_type_32.loc22, %.loc22_9.1 [template = i32] -// CHECK:STDOUT: %.loc22_12: ref = deref %.loc22_9.2 +// CHECK:STDOUT: %.loc22_9.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%.loc22_9.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc22_9.2: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] +// CHECK:STDOUT: %.loc22_9.3: type = converted %int.make_type_signed.loc22, %.loc22_9.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc22_12: ref = deref %.loc22_9.3 // CHECK:STDOUT: %foo.ref: = name_ref foo, [template = ] // CHECK:STDOUT: %p2.var: ref = var p2 // CHECK:STDOUT: %p2: ref = bind_name p2, %p2.var diff --git a/toolchain/check/testdata/pointer/import.carbon b/toolchain/check/testdata/pointer/import.carbon index 9fae4f0875cf..771233b156f9 100644 --- a/toolchain/check/testdata/pointer/import.carbon +++ b/toolchain/check/testdata/pointer/import.carbon @@ -24,21 +24,24 @@ var a: i32* = a_ref; // CHECK:STDOUT: --- implicit.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] -// CHECK:STDOUT: %.28: type = ptr_type i32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.26: type = ptr_type %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -52,29 +55,32 @@ var a: i32* = a_ref; // CHECK:STDOUT: .a_ref = %a_ref // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_32.loc4, %.loc4_13.1 [template = i32] -// CHECK:STDOUT: %a_orig.var: ref i32 = var a_orig -// CHECK:STDOUT: %a_orig: ref i32 = bind_name a_orig, %a_orig.var -// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_15.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] -// CHECK:STDOUT: %.loc5_15.2: type = converted %int.make_type_32.loc5, %.loc5_15.1 [template = i32] -// CHECK:STDOUT: %.loc5_15.3: type = ptr_type i32 [template = constants.%.28] -// CHECK:STDOUT: %a_ref.var: ref %.28 = var a_ref -// CHECK:STDOUT: %a_ref: ref %.28 = bind_name a_ref, %a_ref.var +// CHECK:STDOUT: %.loc4_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_13.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_13.3: type = converted %int.make_type_signed.loc4, %.loc4_13.2 [template = constants.%i32] +// CHECK:STDOUT: %a_orig.var: ref %i32 = var a_orig +// CHECK:STDOUT: %a_orig: ref %i32 = bind_name a_orig, %a_orig.var +// CHECK:STDOUT: %.loc5_12: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_12) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_15.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_15.2: type = converted %int.make_type_signed.loc5, %.loc5_15.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_15.3: type = ptr_type %i32 [template = constants.%.26] +// CHECK:STDOUT: %a_ref.var: ref %.26 = var a_ref +// CHECK:STDOUT: %a_ref: ref %.26 = bind_name a_ref, %a_ref.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc4_19: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc4_20.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_20.2: = bound_method %.loc4_19, %.loc4_20.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc4_20.2(%.loc4_19) [template = constants.%.27] -// CHECK:STDOUT: %.loc4_20.3: init i32 = converted %.loc4_19, %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: assign file.%a_orig.var, %.loc4_20.3 -// CHECK:STDOUT: %a_orig.ref: ref i32 = name_ref a_orig, file.%a_orig -// CHECK:STDOUT: %.loc5: %.28 = addr_of %a_orig.ref +// CHECK:STDOUT: %.loc4_19: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc4_20.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_20.2: = bound_method %.loc4_19, %.loc4_20.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc4_20.3: = specific_function %.loc4_20.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc4_20.3(%.loc4_19) [template = constants.%.25] +// CHECK:STDOUT: %.loc4_20.4: init %i32 = converted %.loc4_19, %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: assign file.%a_orig.var, %.loc4_20.4 +// CHECK:STDOUT: %a_orig.ref: ref %i32 = name_ref a_orig, file.%a_orig +// CHECK:STDOUT: %.loc5: %.26 = addr_of %a_orig.ref // CHECK:STDOUT: assign file.%a_ref.var, %.loc5 // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -82,131 +88,111 @@ var a: i32* = a_ref; // CHECK:STDOUT: --- implicit.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, imports.%import_ref.9 [symbolic] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.10 [template] -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %.5: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%.5)> [symbolic] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: = interface_witness (%Convert.2) [symbolic] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.3, @impl.2(%N) [symbolic] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic] -// CHECK:STDOUT: %.6: = interface_witness (%Convert.3) [symbolic] -// CHECK:STDOUT: %.7: type = int_type unsigned, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %.4: = interface_witness (%Convert.3) [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.4, @impl.3(%N) [symbolic] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] -// CHECK:STDOUT: %.8: = interface_witness (%Convert.4) [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %.5: = interface_witness (%Convert.4) [symbolic] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.5 [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.20 [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.5, %Convert.type.5 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.16 [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.5, @impl.4(%N) [symbolic] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] -// CHECK:STDOUT: %.11: = interface_witness (%Convert.6) [symbolic] -// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] -// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] -// CHECK:STDOUT: %.12: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %.8: = interface_witness (%Convert.6) [symbolic] // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] // CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%iN)> [symbolic] // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.9: type = assoc_entity_type %As.type.2, %Convert.type.7 [symbolic] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.26 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.7, @impl.5(%N) [symbolic] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] -// CHECK:STDOUT: %.13: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] -// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.33 [symbolic] -// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] -// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] -// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.34 [template] -// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.5)> [symbolic] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.8) [symbolic] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.8, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.9) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.9, @impl.7(%N) [symbolic] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] -// CHECK:STDOUT: %.17: = interface_witness (%Convert.10) [symbolic] -// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] -// CHECK:STDOUT: %.18: = interface_witness (%Convert.11) [symbolic] -// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] -// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] -// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.44 [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] -// CHECK:STDOUT: %.21: = interface_witness (%Convert.13) [symbolic] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] -// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.23: type = ptr_type i32 [template] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %.14: type = assoc_entity_type %As.type.5, %Convert.type.11 [template] +// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.33 [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.12) [symbolic] +// CHECK:STDOUT: %.17: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.17 [template] +// CHECK:STDOUT: %.18: type = ptr_type %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+15, unloaded -// CHECK:STDOUT: %import_ref.2: ref %.23 = import_ref Implicit//default, inst+388, loaded +// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+22, unloaded +// CHECK:STDOUT: %import_ref.2: ref %.18 = import_ref Implicit//default, inst+368, loaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.51 +// CHECK:STDOUT: .Int = %import_ref.37 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref Implicit//default, inst+30, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Implicit//default, inst+31, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+32, unloaded -// CHECK:STDOUT: %import_ref.6: type = import_ref Implicit//default, inst+66, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.7: type = import_ref Implicit//default, inst+67, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.8 = import_ref Implicit//default, inst+68, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Implicit//default, inst+47, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Implicit//default, inst+78, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.12: type = import_ref Implicit//default, inst+79, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] -// CHECK:STDOUT: %import_ref.13 = import_ref Implicit//default, inst+80, unloaded -// CHECK:STDOUT: %import_ref.14: type = import_ref Implicit//default, inst+108, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.15: type = import_ref Implicit//default, inst+109, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.5)] -// CHECK:STDOUT: %import_ref.16 = import_ref Implicit//default, inst+110, unloaded -// CHECK:STDOUT: %import_ref.17: type = import_ref Implicit//default, inst+133, loaded [template = i32] -// CHECK:STDOUT: %import_ref.18: type = import_ref Implicit//default, inst+134, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.19 = import_ref Implicit//default, inst+135, unloaded -// CHECK:STDOUT: %import_ref.21: type = import_ref Implicit//default, inst+146, loaded [symbolic = @impl.5.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.22: type = import_ref Implicit//default, inst+147, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.23 = import_ref Implicit//default, inst+148, unloaded -// CHECK:STDOUT: %import_ref.24: type = import_ref Implicit//default, inst+173, loaded [symbolic = @impl.6.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.25: type = import_ref Implicit//default, inst+174, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.26 = import_ref Implicit//default, inst+175, unloaded -// CHECK:STDOUT: %import_ref.27 = import_ref Implicit//default, inst+205, unloaded -// CHECK:STDOUT: %import_ref.28 = import_ref Implicit//default, inst+206, unloaded -// CHECK:STDOUT: %import_ref.29 = import_ref Implicit//default, inst+207, unloaded -// CHECK:STDOUT: %import_ref.30: type = import_ref Implicit//default, inst+209, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.31: type = import_ref Implicit//default, inst+210, loaded [template = constants.%As.type.3] -// CHECK:STDOUT: %import_ref.32 = import_ref Implicit//default, inst+211, unloaded -// CHECK:STDOUT: %import_ref.33 = import_ref Implicit//default, inst+226, unloaded -// CHECK:STDOUT: %import_ref.35: type = import_ref Implicit//default, inst+248, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.36: type = import_ref Implicit//default, inst+249, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] -// CHECK:STDOUT: %import_ref.37 = import_ref Implicit//default, inst+250, unloaded -// CHECK:STDOUT: %import_ref.38: type = import_ref Implicit//default, inst+277, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.39: type = import_ref Implicit//default, inst+278, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] -// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst+279, unloaded -// CHECK:STDOUT: %import_ref.41: type = import_ref Implicit//default, inst+302, loaded [template = i32] -// CHECK:STDOUT: %import_ref.42: type = import_ref Implicit//default, inst+303, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.43 = import_ref Implicit//default, inst+304, unloaded -// CHECK:STDOUT: %import_ref.45: type = import_ref Implicit//default, inst+315, loaded [symbolic = @impl.11.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.46: type = import_ref Implicit//default, inst+316, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.47 = import_ref Implicit//default, inst+317, unloaded -// CHECK:STDOUT: %import_ref.48: type = import_ref Implicit//default, inst+342, loaded [symbolic = @impl.12.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.49: type = import_ref Implicit//default, inst+343, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.50 = import_ref Implicit//default, inst+344, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Implicit//default, inst+37, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Implicit//default, inst+38, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+39, unloaded +// CHECK:STDOUT: %import_ref.6: type = import_ref Implicit//default, inst+81, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.7: type = import_ref Implicit//default, inst+82, loaded [symbolic = @impl.1.%ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: %import_ref.8 = import_ref Implicit//default, inst+83, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Implicit//default, inst+54, unloaded +// CHECK:STDOUT: %import_ref.10: type = import_ref Implicit//default, inst+111, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.11: type = import_ref Implicit//default, inst+112, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %import_ref.12 = import_ref Implicit//default, inst+113, unloaded +// CHECK:STDOUT: %import_ref.13: type = import_ref Implicit//default, inst+140, loaded [symbolic = @impl.3.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.14: type = import_ref Implicit//default, inst+141, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.15 = import_ref Implicit//default, inst+142, unloaded +// CHECK:STDOUT: %import_ref.17: type = import_ref Implicit//default, inst+172, loaded [symbolic = @impl.4.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.18: type = import_ref Implicit//default, inst+173, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.19 = import_ref Implicit//default, inst+174, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Implicit//default, inst+204, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Implicit//default, inst+205, unloaded +// CHECK:STDOUT: %import_ref.22 = import_ref Implicit//default, inst+206, unloaded +// CHECK:STDOUT: %import_ref.23: type = import_ref Implicit//default, inst+212, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.24: type = import_ref Implicit//default, inst+213, loaded [symbolic = @impl.5.%As.type (constants.%As.type.3)] +// CHECK:STDOUT: %import_ref.25 = import_ref Implicit//default, inst+214, unloaded +// CHECK:STDOUT: %import_ref.26 = import_ref Implicit//default, inst+229, unloaded +// CHECK:STDOUT: %import_ref.27: type = import_ref Implicit//default, inst+266, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.28: type = import_ref Implicit//default, inst+267, loaded [symbolic = @impl.6.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.29 = import_ref Implicit//default, inst+268, unloaded +// CHECK:STDOUT: %import_ref.30: type = import_ref Implicit//default, inst+295, loaded [symbolic = @impl.7.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.31: type = import_ref Implicit//default, inst+296, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.32 = import_ref Implicit//default, inst+297, unloaded +// CHECK:STDOUT: %import_ref.34: type = import_ref Implicit//default, inst+327, loaded [symbolic = @impl.8.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.35: type = import_ref Implicit//default, inst+328, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.36 = import_ref Implicit//default, inst+329, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -219,12 +205,13 @@ var a: i32* = a_ref; // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32, %.loc4_11.1 [template = i32] -// CHECK:STDOUT: %.loc4_11.3: type = ptr_type i32 [template = constants.%.23] -// CHECK:STDOUT: %a.var: ref %.23 = var a -// CHECK:STDOUT: %a: ref %.23 = bind_name a, %a.var +// CHECK:STDOUT: %.loc4_8: Core.IntLiteral = int_value 32 [template = constants.%.17] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_8) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.3: type = ptr_type %i32 [template = constants.%.18] +// CHECK:STDOUT: %a.var: ref %.18 = var a +// CHECK:STDOUT: %a: ref %.18 = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { @@ -254,168 +241,148 @@ var a: i32* = a_ref; // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] -// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.13)] -// CHECK:STDOUT: %.2: @As.%.1 (%.13) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.7) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %.2: @As.%.1 (%.9) = assoc_entity element0, imports.%import_ref.26 [symbolic = %.2 (constants.%.10)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.27 -// CHECK:STDOUT: .Convert = imports.%import_ref.28 -// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: .Self = imports.%import_ref.20 +// CHECK:STDOUT: .Convert = imports.%import_ref.21 +// CHECK:STDOUT: witness = (imports.%import_ref.22) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.6 as imports.%import_ref.7 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.8 +// CHECK:STDOUT: generic impl @impl.1(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.1(%N) [symbolic = %Convert.type (constants.%Convert.type.2)] +// CHECK:STDOUT: %Convert: @impl.1.%Convert.type (%Convert.type.2) = struct_value () [symbolic = %Convert (constants.%Convert.2)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.6 as imports.%import_ref.7 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.8 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] // CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.11 as imports.%import_ref.12 { +// CHECK:STDOUT: impl: imports.%import_ref.10 as imports.%import_ref.11 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: witness = imports.%import_ref.12 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] // CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.14 as imports.%import_ref.15 { +// CHECK:STDOUT: impl: imports.%import_ref.13 as imports.%import_ref.14 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.16 +// CHECK:STDOUT: witness = imports.%import_ref.15 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.17 as imports.%import_ref.18 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.19 +// CHECK:STDOUT: generic impl @impl.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.4(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.4.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.17 as imports.%import_ref.18 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.19 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%iN)> [symbolic = %As.type (constants.%As.type.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] -// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: impl: imports.%import_ref.23 as imports.%import_ref.24 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: witness = imports.%import_ref.25 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%uN)> [symbolic = %As.type (constants.%As.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] -// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.9)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: impl: imports.%import_ref.27 as imports.%import_ref.28 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: witness = imports.%import_ref.29 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.7: imports.%import_ref.30 as imports.%import_ref.31 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: generic impl @impl.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.7(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.7.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] -// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.12)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.12) = struct_value () [symbolic = %Convert (constants.%Convert.12)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: impl: imports.%import_ref.34 as imports.%import_ref.35 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.37 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] -// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.40 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.10: imports.%import_ref.41 as imports.%import_ref.42 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.43 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] -// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.45 as imports.%import_ref.46 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.47 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] -// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.48 as imports.%import_ref.49 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.50 +// CHECK:STDOUT: witness = imports.%import_ref.36 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -429,38 +396,38 @@ var a: i32* = a_ref; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { @@ -473,44 +440,44 @@ var a: i32* = a_ref; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a_ref.ref: ref %.23 = name_ref a_ref, imports.%import_ref.2 -// CHECK:STDOUT: %.loc4: %.23 = bind_value %a_ref.ref +// CHECK:STDOUT: %a_ref.ref: ref %.18 = name_ref a_ref, imports.%import_ref.2 +// CHECK:STDOUT: %.loc4: %.18 = bind_value %a_ref.ref // CHECK:STDOUT: assign file.%a.var, %.loc4 // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -520,17 +487,9 @@ var a: i32* = a_ref; // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 -// CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 -// CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.1 => constants.%.3 -// CHECK:STDOUT: %.2 => constants.%.4 +// CHECK:STDOUT: specific @ImplicitAs(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(%Dest) { @@ -538,6 +497,25 @@ var a: i32* = a_ref; // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.1.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -549,62 +527,38 @@ var a: i32* = a_ref; // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @ImplicitAs(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { @@ -612,46 +566,46 @@ var a: i32* = a_ref; // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5 // CHECK:STDOUT: %Convert => constants.%Convert.5 -// CHECK:STDOUT: %.1 => constants.%.9 -// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: specific @impl.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: specific @impl.3(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: specific @impl.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(%N) { +// CHECK:STDOUT: specific @impl.4(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.5(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%Dest) { @@ -659,17 +613,9 @@ var a: i32* = a_ref; // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.3 -// CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 -// CHECK:STDOUT: %Convert => constants.%Convert.9 -// CHECK:STDOUT: %.1 => constants.%.15 -// CHECK:STDOUT: %.2 => constants.%.16 +// CHECK:STDOUT: specific @As(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(%Dest) { @@ -677,6 +623,25 @@ var a: i32* = a_ref; // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.5.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @As(@Convert.6.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -688,62 +653,38 @@ var a: i32* = a_ref; // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.8.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.9.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(@impl.6.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: specific @impl.6(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(%N) { +// CHECK:STDOUT: specific @impl.6(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(Core.IntLiteral) { @@ -751,45 +692,45 @@ var a: i32* = a_ref; // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %As.type => constants.%As.type.5 // CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 -// CHECK:STDOUT: %Convert => constants.%Convert.12 -// CHECK:STDOUT: %.1 => constants.%.19 -// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.11 +// CHECK:STDOUT: %Convert => constants.%Convert.11 +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.2 => constants.%.15 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: specific @impl.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(%N) { +// CHECK:STDOUT: specific @impl.7(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.9(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: specific @impl.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(%N) { +// CHECK:STDOUT: specific @impl.8(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.10(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/nested_const.carbon b/toolchain/check/testdata/pointer/nested_const.carbon index 5fc43207f24b..3810f9ce527e 100644 --- a/toolchain/check/testdata/pointer/nested_const.carbon +++ b/toolchain/check/testdata/pointer/nested_const.carbon @@ -16,20 +16,22 @@ fn F(p: const (const (const i32*)*)) -> const i32 { // CHECK:STDOUT: --- nested_const.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = const_type i32 [template] -// CHECK:STDOUT: %.2: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.3: type = const_type %.2 [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: type = const_type %.4 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = const_type %i32 [template] +// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.4: type = const_type %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.6: type = const_type %.5 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -42,37 +44,39 @@ fn F(p: const (const (const i32*)*)) -> const i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %p.patt: %.5 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.5 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.1 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.1 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.6 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.6 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc12_29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_23.1: type = value_of_initializer %int.make_type_32.loc12_29 [template = i32] -// CHECK:STDOUT: %.loc12_23.2: type = converted %int.make_type_32.loc12_29, %.loc12_23.1 [template = i32] -// CHECK:STDOUT: %.loc12_23.3: type = const_type i32 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_32: type = ptr_type %.1 [template = constants.%.2] -// CHECK:STDOUT: %.loc12_16: type = const_type %.2 [template = constants.%.3] -// CHECK:STDOUT: %.loc12_34: type = ptr_type %.3 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_9: type = const_type %.4 [template = constants.%.5] -// CHECK:STDOUT: %int.make_type_32.loc12_47: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_41.1: type = value_of_initializer %int.make_type_32.loc12_47 [template = i32] -// CHECK:STDOUT: %.loc12_41.2: type = converted %int.make_type_32.loc12_47, %.loc12_41.1 [template = i32] -// CHECK:STDOUT: %.loc12_41.3: type = const_type i32 [template = constants.%.1] -// CHECK:STDOUT: %p.param: %.5 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.5 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.1 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.1 = return_slot %return.param +// CHECK:STDOUT: %.loc12_29: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_29: init type = call constants.%Int(%.loc12_29) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_23.1: type = value_of_initializer %int.make_type_signed.loc12_29 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_23.2: type = converted %int.make_type_signed.loc12_29, %.loc12_23.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_23.3: type = const_type %i32 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_32: type = ptr_type %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_16: type = const_type %.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_34: type = ptr_type %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc12_9: type = const_type %.5 [template = constants.%.6] +// CHECK:STDOUT: %.loc12_47: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_47: init type = call constants.%Int(%.loc12_47) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_41.1: type = value_of_initializer %int.make_type_signed.loc12_47 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_41.2: type = converted %int.make_type_signed.loc12_47, %.loc12_41.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_41.3: type = const_type %i32 [template = constants.%.2] +// CHECK:STDOUT: %p.param: %.6 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.6 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%p.param_patt: %.5) -> %.1 { +// CHECK:STDOUT: fn @F(%p.param_patt: %.6) -> %.2 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.5 = name_ref p, %p -// CHECK:STDOUT: %.loc13_11.1: ref %.3 = deref %p.ref -// CHECK:STDOUT: %.loc13_11.2: %.3 = bind_value %.loc13_11.1 -// CHECK:STDOUT: %.loc13_10.1: ref %.1 = deref %.loc13_11.2 -// CHECK:STDOUT: %.loc13_10.2: %.1 = bind_value %.loc13_10.1 +// CHECK:STDOUT: %p.ref: %.6 = name_ref p, %p +// CHECK:STDOUT: %.loc13_11.1: ref %.4 = deref %p.ref +// CHECK:STDOUT: %.loc13_11.2: %.4 = bind_value %.loc13_11.1 +// CHECK:STDOUT: %.loc13_10.1: ref %.2 = deref %.loc13_11.2 +// CHECK:STDOUT: %.loc13_10.2: %.2 = bind_value %.loc13_10.1 // CHECK:STDOUT: return %.loc13_10.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/types.carbon b/toolchain/check/testdata/pointer/types.carbon index c38221d61f4d..3d84ce847eac 100644 --- a/toolchain/check/testdata/pointer/types.carbon +++ b/toolchain/check/testdata/pointer/types.carbon @@ -19,20 +19,22 @@ fn ConstPtr(p: const i32*) -> (const i32)* { // CHECK:STDOUT: --- types.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = ptr_type i32 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = ptr_type %i32 [template] // CHECK:STDOUT: %Ptr.type: type = fn_type @Ptr [template] // CHECK:STDOUT: %Ptr: %Ptr.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = const_type i32 [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: type = const_type %i32 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] // CHECK:STDOUT: %ConstPtr.type: type = fn_type @ConstPtr [template] // CHECK:STDOUT: %ConstPtr: %ConstPtr.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -46,56 +48,60 @@ fn ConstPtr(p: const i32*) -> (const i32)* { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Ptr.decl: %Ptr.type = fn_decl @Ptr [template = constants.%Ptr] { -// CHECK:STDOUT: %p.patt: %.1 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.1 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.1 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.1 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.2 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.2 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32.loc11_11, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: %.loc11_14.3: type = ptr_type i32 [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32.loc11_20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_23.1: type = value_of_initializer %int.make_type_32.loc11_20 [template = i32] -// CHECK:STDOUT: %.loc11_23.2: type = converted %int.make_type_32.loc11_20, %.loc11_23.1 [template = i32] -// CHECK:STDOUT: %.loc11_23.3: type = ptr_type i32 [template = constants.%.1] -// CHECK:STDOUT: %p.param: %.1 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.1 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.1 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.1 = return_slot %return.param +// CHECK:STDOUT: %.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%.loc11_11) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_signed.loc11_11, %.loc11_14.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.3: type = ptr_type %i32 [template = constants.%.2] +// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_20: init type = call constants.%Int(%.loc11_20) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_23.1: type = value_of_initializer %int.make_type_signed.loc11_20 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_23.2: type = converted %int.make_type_signed.loc11_20, %.loc11_23.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_23.3: type = ptr_type %i32 [template = constants.%.2] +// CHECK:STDOUT: %p.param: %.2 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.2 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %ConstPtr.decl: %ConstPtr.type = fn_decl @ConstPtr [template = constants.%ConstPtr] { -// CHECK:STDOUT: %p.patt: %.3 = binding_pattern p -// CHECK:STDOUT: %p.param_patt: %.3 = value_param_pattern %p.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %.3 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.3 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %p.patt: %.4 = binding_pattern p +// CHECK:STDOUT: %p.param_patt: %.4 = value_param_pattern %p.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.4 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.4 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc15_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_16.1: type = value_of_initializer %int.make_type_32.loc15_22 [template = i32] -// CHECK:STDOUT: %.loc15_16.2: type = converted %int.make_type_32.loc15_22, %.loc15_16.1 [template = i32] -// CHECK:STDOUT: %.loc15_16.3: type = const_type i32 [template = constants.%.2] -// CHECK:STDOUT: %.loc15_25: type = ptr_type %.2 [template = constants.%.3] -// CHECK:STDOUT: %int.make_type_32.loc15_38: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_32.1: type = value_of_initializer %int.make_type_32.loc15_38 [template = i32] -// CHECK:STDOUT: %.loc15_32.2: type = converted %int.make_type_32.loc15_38, %.loc15_32.1 [template = i32] -// CHECK:STDOUT: %.loc15_32.3: type = const_type i32 [template = constants.%.2] -// CHECK:STDOUT: %.loc15_42: type = ptr_type %.2 [template = constants.%.3] -// CHECK:STDOUT: %p.param: %.3 = value_param runtime_param0 -// CHECK:STDOUT: %p: %.3 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %.3 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %.3 = return_slot %return.param +// CHECK:STDOUT: %.loc15_22: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15_22: init type = call constants.%Int(%.loc15_22) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_16.1: type = value_of_initializer %int.make_type_signed.loc15_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_16.2: type = converted %int.make_type_signed.loc15_22, %.loc15_16.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_16.3: type = const_type %i32 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_25: type = ptr_type %.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc15_38: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15_38: init type = call constants.%Int(%.loc15_38) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_32.1: type = value_of_initializer %int.make_type_signed.loc15_38 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_32.2: type = converted %int.make_type_signed.loc15_38, %.loc15_32.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_32.3: type = const_type %i32 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_42: type = ptr_type %.3 [template = constants.%.4] +// CHECK:STDOUT: %p.param: %.4 = value_param runtime_param0 +// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param +// CHECK:STDOUT: %return.param: ref %.4 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %.4 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Ptr(%p.param_patt: %.1) -> %.1 { +// CHECK:STDOUT: fn @Ptr(%p.param_patt: %.2) -> %.2 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.1 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.2 = name_ref p, %p // CHECK:STDOUT: return %p.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConstPtr(%p.param_patt: %.3) -> %.3 { +// CHECK:STDOUT: fn @ConstPtr(%p.param_patt: %.4) -> %.4 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.3 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p // CHECK:STDOUT: return %p.ref // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/code_after_return.carbon b/toolchain/check/testdata/return/code_after_return.carbon index 77d255dc00b0..f29dd0d4697f 100644 --- a/toolchain/check/testdata/return/code_after_return.carbon +++ b/toolchain/check/testdata/return/code_after_return.carbon @@ -22,7 +22,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/return/code_after_return_value.carbon b/toolchain/check/testdata/return/code_after_return_value.carbon index 303c122be965..7bd10ec6292f 100644 --- a/toolchain/check/testdata/return/code_after_return_value.carbon +++ b/toolchain/check/testdata/return/code_after_return_value.carbon @@ -25,23 +25,26 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.1 -// CHECK:STDOUT: .Int32 = %import_ref.2 +// CHECK:STDOUT: .Int = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -57,30 +60,32 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_9.2: type = converted %bool.make_type, %.loc11_9.1 [template = bool] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_18.2: type = converted %int.make_type_32, %.loc11_18.1 [template = i32] +// CHECK:STDOUT: %.loc11_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_18.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_18.3: type = converted %int.make_type_signed, %.loc11_18.2 [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%b.param_patt: bool) -> i32 { +// CHECK:STDOUT: fn @F(%b.param_patt: bool) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_10: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_11.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_11.2: = bound_method %.loc12_10, %.loc12_11.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_11.2(%.loc12_10) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_11.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc12_11.4: i32 = converted %.loc12_10, %.loc12_11.3 [template = constants.%.27] -// CHECK:STDOUT: return %.loc12_11.4 +// CHECK:STDOUT: %.loc12_10: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_11.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_11.2: = bound_method %.loc12_10, %.loc12_11.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_11.3: = specific_function %.loc12_11.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc12_11.3(%.loc12_10) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_11.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc12_11.5: %i32 = converted %.loc12_10, %.loc12_11.4 [template = constants.%.25] +// CHECK:STDOUT: return %.loc12_11.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_call_in_type.carbon b/toolchain/check/testdata/return/fail_call_in_type.carbon index fe3deb107cb6..c7f4e0da3b92 100644 --- a/toolchain/check/testdata/return/fail_call_in_type.carbon +++ b/toolchain/check/testdata/return/fail_call_in_type.carbon @@ -21,16 +21,18 @@ fn Six() -> ReturnType() { return 6; } // CHECK:STDOUT: constants { // CHECK:STDOUT: %ReturnType.type: type = fn_type @ReturnType [template] // CHECK:STDOUT: %ReturnType: %ReturnType.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Six.type: type = fn_type @Six [template] // CHECK:STDOUT: %Six: %Six.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -65,15 +67,16 @@ fn Six() -> ReturnType() { return 6; } // CHECK:STDOUT: // CHECK:STDOUT: fn @ReturnType() -> type { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_37.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_37.2: type = converted %int.make_type_32, %.loc13_37.1 [template = i32] +// CHECK:STDOUT: %.loc13_34: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_34) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_37.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_37.2: type = converted %int.make_type_signed, %.loc13_37.1 [template = constants.%i32] // CHECK:STDOUT: return %.loc13_37.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Six() -> { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc17_35: Core.IntLiteral = int_value 6 [template = constants.%.1] +// CHECK:STDOUT: %.loc17_35: Core.IntLiteral = int_value 6 [template = constants.%.2] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_let_in_type.carbon b/toolchain/check/testdata/return/fail_let_in_type.carbon index 9c7511e4c745..20fa441a0f70 100644 --- a/toolchain/check/testdata/return/fail_let_in_type.carbon +++ b/toolchain/check/testdata/return/fail_let_in_type.carbon @@ -41,20 +41,20 @@ fn FirstPerfectNumber() -> z { return 6; } // CHECK:STDOUT: --- fail_let_in_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file {} // CHECK:STDOUT: // CHECK:STDOUT: fn @Six() -> { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc16: Core.IntLiteral = int_value 6 [template = constants.%.1] +// CHECK:STDOUT: %.loc16: Core.IntLiteral = int_value 6 [template = constants.%.2] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @HalfDozen() -> { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc28: Core.IntLiteral = int_value 6 [template = constants.%.1] +// CHECK:STDOUT: %.loc28: Core.IntLiteral = int_value 6 [template = constants.%.2] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_missing_return.carbon b/toolchain/check/testdata/return/fail_missing_return.carbon index c65d6a1e361c..afff7675891e 100644 --- a/toolchain/check/testdata/return/fail_missing_return.carbon +++ b/toolchain/check/testdata/return/fail_missing_return.carbon @@ -17,15 +17,17 @@ fn Main() -> i32 { // CHECK:STDOUT: --- fail_missing_return.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -38,18 +40,19 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.3: type = converted %int.make_type_signed, %.loc11_14.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Main() -> i32 { +// CHECK:STDOUT: fn @Main() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon b/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon index e15f4e98d7de..49469551a86d 100644 --- a/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon @@ -18,15 +18,17 @@ fn Procedure() -> i32 { // CHECK:STDOUT: --- fail_return_var_no_returned_var.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Procedure.type: type = fn_type @Procedure [template] // CHECK:STDOUT: %Procedure: %Procedure.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -39,18 +41,19 @@ fn Procedure() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Procedure.decl: %Procedure.type = fn_decl @Procedure [template = constants.%Procedure] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.3: type = converted %int.make_type_signed, %.loc11_19.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Procedure() -> i32 { +// CHECK:STDOUT: fn @Procedure() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon index 6d2e511f8e52..93a00018c381 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -35,36 +35,41 @@ fn G() -> C { // CHECK:STDOUT: --- fail_return_with_returned_var.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %.29: type = unbound_element_type %C, i32 [template] -// CHECK:STDOUT: %.30: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.31: = complete_type_witness %.30 [template] +// CHECK:STDOUT: %.27: type = unbound_element_type %C, %i32 [template] +// CHECK:STDOUT: %.28: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %.29: = complete_type_witness %.28 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.33: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.34: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %.35: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.36: i32 = int_value 1 [template] -// CHECK:STDOUT: %.37: = bound_method %.33, %Convert.15 [template] -// CHECK:STDOUT: %.38: i32 = int_value 2 [template] -// CHECK:STDOUT: %struct: %C = struct_value (%.36, %.38) [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.32: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %.33: = bound_method %.26, %Convert.14 [template] +// CHECK:STDOUT: %.34: = specific_function %.33, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.35: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.36: = bound_method %.31, %Convert.14 [template] +// CHECK:STDOUT: %.37: = specific_function %.36, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.38: %i32 = int_value 2 [template] +// CHECK:STDOUT: %struct: %C = struct_value (%.35, %.38) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -80,14 +85,15 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11, %.loc11_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_11.3: type = converted %int.make_type_signed.loc11, %.loc11_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { @@ -101,15 +107,17 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %int.make_type_32.loc23_18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_18.1: type = value_of_initializer %int.make_type_32.loc23_18 [template = i32] -// CHECK:STDOUT: %.loc23_18.2: type = converted %int.make_type_32.loc23_18, %.loc23_18.1 [template = i32] -// CHECK:STDOUT: %.loc23_16: %.29 = field_decl a, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc23_30: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_30.1: type = value_of_initializer %int.make_type_32.loc23_30 [template = i32] -// CHECK:STDOUT: %.loc23_30.2: type = converted %int.make_type_32.loc23_30, %.loc23_30.1 [template = i32] -// CHECK:STDOUT: %.loc23_28: %.29 = field_decl b, element1 [template] -// CHECK:STDOUT: %.loc23_35: = complete_type_witness %.30 [template = constants.%.31] +// CHECK:STDOUT: %.loc23_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc23_18: init type = call constants.%Int(%.loc23_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_18.2: type = value_of_initializer %int.make_type_signed.loc23_18 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_18.3: type = converted %int.make_type_signed.loc23_18, %.loc23_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_16: %.27 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc23_30.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc23_30: init type = call constants.%Int(%.loc23_30.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_30.2: type = value_of_initializer %int.make_type_signed.loc23_30 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_30.3: type = converted %int.make_type_signed.loc23_30, %.loc23_30.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_28: %.27 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc23_35: = complete_type_witness %.28 [template = constants.%.29] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -117,20 +125,22 @@ fn G() -> C { // CHECK:STDOUT: .b = %.loc23_28 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32 { +// CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_19.2: type = converted %int.make_type_32.loc12, %.loc12_19.1 [template = i32] -// CHECK:STDOUT: %v.var: ref i32 = var v -// CHECK:STDOUT: %v: ref i32 = bind_name v, %v.var -// CHECK:STDOUT: %.loc12_25: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_26.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_26.2: = bound_method %.loc12_25, %.loc12_26.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_26.2(%.loc12_25) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_26.3: init i32 = converted %.loc12_25, %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: assign %v.var, %.loc12_26.3 -// CHECK:STDOUT: %.loc20: Core.IntLiteral = int_value 1 [template = constants.%.28] +// CHECK:STDOUT: %.loc12_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_19.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_19.3: type = converted %int.make_type_signed.loc12, %.loc12_19.2 [template = constants.%i32] +// CHECK:STDOUT: %v.var: ref %i32 = var v +// CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var +// CHECK:STDOUT: %.loc12_25: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_26.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_26.2: = bound_method %.loc12_25, %.loc12_26.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_26.3: = specific_function %.loc12_26.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc12_26.3(%.loc12_25) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_26.4: init %i32 = converted %.loc12_25, %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: assign %v.var, %.loc12_26.4 +// CHECK:STDOUT: %.loc20: Core.IntLiteral = int_value 1 [template = constants.%.26] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -138,23 +148,25 @@ fn G() -> C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref.loc25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c: ref %C = bind_name c, %return -// CHECK:STDOUT: %.loc25_29: Core.IntLiteral = int_value 1 [template = constants.%.28] -// CHECK:STDOUT: %.loc25_37: Core.IntLiteral = int_value 2 [template = constants.%.33] -// CHECK:STDOUT: %.loc25_38.1: %.34 = struct_literal (%.loc25_29, %.loc25_37) -// CHECK:STDOUT: %.loc25_38.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc25_38.3: = bound_method %.loc25_29, %.loc25_38.2 [template = constants.%.35] -// CHECK:STDOUT: %int.convert_checked.loc25_38.1: init i32 = call %.loc25_38.3(%.loc25_29) [template = constants.%.36] -// CHECK:STDOUT: %.loc25_38.4: init i32 = converted %.loc25_29, %int.convert_checked.loc25_38.1 [template = constants.%.36] -// CHECK:STDOUT: %.loc25_38.5: ref i32 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc25_38.6: init i32 = initialize_from %.loc25_38.4 to %.loc25_38.5 [template = constants.%.36] -// CHECK:STDOUT: %.loc25_38.7: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc25_38.8: = bound_method %.loc25_37, %.loc25_38.7 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc25_38.2: init i32 = call %.loc25_38.8(%.loc25_37) [template = constants.%.38] -// CHECK:STDOUT: %.loc25_38.9: init i32 = converted %.loc25_37, %int.convert_checked.loc25_38.2 [template = constants.%.38] -// CHECK:STDOUT: %.loc25_38.10: ref i32 = class_element_access %return, element1 -// CHECK:STDOUT: %.loc25_38.11: init i32 = initialize_from %.loc25_38.9 to %.loc25_38.10 [template = constants.%.38] -// CHECK:STDOUT: %.loc25_38.12: init %C = class_init (%.loc25_38.6, %.loc25_38.11), %return [template = constants.%struct] -// CHECK:STDOUT: %.loc25_39: init %C = converted %.loc25_38.1, %.loc25_38.12 [template = constants.%struct] +// CHECK:STDOUT: %.loc25_29: Core.IntLiteral = int_value 1 [template = constants.%.26] +// CHECK:STDOUT: %.loc25_37: Core.IntLiteral = int_value 2 [template = constants.%.31] +// CHECK:STDOUT: %.loc25_38.1: %.32 = struct_literal (%.loc25_29, %.loc25_37) +// CHECK:STDOUT: %.loc25_38.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc25_38.3: = bound_method %.loc25_29, %.loc25_38.2 [template = constants.%.33] +// CHECK:STDOUT: %.loc25_38.4: = specific_function %.loc25_38.3, @Convert.2(constants.%.1) [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked.loc25_38.1: init %i32 = call %.loc25_38.4(%.loc25_29) [template = constants.%.35] +// CHECK:STDOUT: %.loc25_38.5: init %i32 = converted %.loc25_29, %int.convert_checked.loc25_38.1 [template = constants.%.35] +// CHECK:STDOUT: %.loc25_38.6: ref %i32 = class_element_access %return, element0 +// CHECK:STDOUT: %.loc25_38.7: init %i32 = initialize_from %.loc25_38.5 to %.loc25_38.6 [template = constants.%.35] +// CHECK:STDOUT: %.loc25_38.8: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc25_38.9: = bound_method %.loc25_37, %.loc25_38.8 [template = constants.%.36] +// CHECK:STDOUT: %.loc25_38.10: = specific_function %.loc25_38.9, @Convert.2(constants.%.1) [template = constants.%.37] +// CHECK:STDOUT: %int.convert_checked.loc25_38.2: init %i32 = call %.loc25_38.10(%.loc25_37) [template = constants.%.38] +// CHECK:STDOUT: %.loc25_38.11: init %i32 = converted %.loc25_37, %int.convert_checked.loc25_38.2 [template = constants.%.38] +// CHECK:STDOUT: %.loc25_38.12: ref %i32 = class_element_access %return, element1 +// CHECK:STDOUT: %.loc25_38.13: init %i32 = initialize_from %.loc25_38.11 to %.loc25_38.12 [template = constants.%.38] +// CHECK:STDOUT: %.loc25_38.14: init %C = class_init (%.loc25_38.7, %.loc25_38.13), %return [template = constants.%struct] +// CHECK:STDOUT: %.loc25_39: init %C = converted %.loc25_38.1, %.loc25_38.14 [template = constants.%struct] // CHECK:STDOUT: assign %return, %.loc25_39 // CHECK:STDOUT: %c.ref: ref %C = name_ref c, %c // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index b93d0ca8b814..9d4ebd599370 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -42,28 +42,32 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: --- fail_returned_var_shadow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %SameScope.type: type = fn_type @SameScope [template] // CHECK:STDOUT: %SameScope: %SameScope.type = struct_value () [template] -// CHECK:STDOUT: %.1: bool = bool_literal true [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 0 [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] +// CHECK:STDOUT: %.2: bool = bool_literal true [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] // CHECK:STDOUT: %DifferentScopes.type: type = fn_type @DifferentScopes [template] // CHECK:STDOUT: %DifferentScopes: %DifferentScopes.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -78,111 +82,123 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %SameScope.decl: %SameScope.type = fn_decl @SameScope [template = constants.%SameScope] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.3: type = converted %int.make_type_signed.loc11, %.loc11_19.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %DifferentScopes.decl: %DifferentScopes.type = fn_decl @DifferentScopes [template = constants.%DifferentScopes] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc26: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc26_25.1: type = value_of_initializer %int.make_type_32.loc26 [template = i32] -// CHECK:STDOUT: %.loc26_25.2: type = converted %int.make_type_32.loc26, %.loc26_25.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc26_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc26: init type = call constants.%Int(%.loc26_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc26_25.2: type = value_of_initializer %int.make_type_signed.loc26 [template = constants.%i32] +// CHECK:STDOUT: %.loc26_25.3: type = converted %int.make_type_signed.loc26, %.loc26_25.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @SameScope() -> i32 { +// CHECK:STDOUT: fn @SameScope() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12: bool = bool_literal true [template = constants.%.1] +// CHECK:STDOUT: %.loc12: bool = bool_literal true [template = constants.%.2] // CHECK:STDOUT: if %.loc12 br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_21.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_21.2: type = converted %int.make_type_32.loc13, %.loc13_21.1 [template = i32] -// CHECK:STDOUT: %v.var: ref i32 = var v -// CHECK:STDOUT: %v: ref i32 = bind_name v, %v.var -// CHECK:STDOUT: %.loc13_27: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc13_28.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_28.2: = bound_method %.loc13_27, %.loc13_28.1 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc13: init i32 = call %.loc13_28.2(%.loc13_27) [template = constants.%.28] -// CHECK:STDOUT: %.loc13_28.3: init i32 = converted %.loc13_27, %int.convert_checked.loc13 [template = constants.%.28] -// CHECK:STDOUT: assign %v.var, %.loc13_28.3 -// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_21.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] -// CHECK:STDOUT: %.loc21_21.2: type = converted %int.make_type_32.loc21, %.loc21_21.1 [template = i32] -// CHECK:STDOUT: %w.var: ref i32 = var w -// CHECK:STDOUT: %w: ref i32 = bind_name w, %w.var -// CHECK:STDOUT: %.loc21_27: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc21_28.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc21_28.2: = bound_method %.loc21_27, %.loc21_28.1 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc21: init i32 = call %.loc21_28.2(%.loc21_27) [template = constants.%.31] -// CHECK:STDOUT: %.loc21_28.3: init i32 = converted %.loc21_27, %int.convert_checked.loc21 [template = constants.%.31] -// CHECK:STDOUT: assign %w.var, %.loc21_28.3 +// CHECK:STDOUT: %.loc13_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_21.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_21.3: type = converted %int.make_type_signed.loc13, %.loc13_21.2 [template = constants.%i32] +// CHECK:STDOUT: %v.var: ref %i32 = var v +// CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var +// CHECK:STDOUT: %.loc13_27: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc13_28.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_28.2: = bound_method %.loc13_27, %.loc13_28.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc13_28.3: = specific_function %.loc13_28.2, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %.loc13_28.3(%.loc13_27) [template = constants.%.26] +// CHECK:STDOUT: %.loc13_28.4: init %i32 = converted %.loc13_27, %int.convert_checked.loc13 [template = constants.%.26] +// CHECK:STDOUT: assign %v.var, %.loc13_28.4 +// CHECK:STDOUT: %.loc21_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%.loc21_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_21.2: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_21.3: type = converted %int.make_type_signed.loc21, %.loc21_21.2 [template = constants.%i32] +// CHECK:STDOUT: %w.var: ref %i32 = var w +// CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var +// CHECK:STDOUT: %.loc21_27: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc21_28.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc21_28.2: = bound_method %.loc21_27, %.loc21_28.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc21_28.3: = specific_function %.loc21_28.2, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %.loc21_28.3(%.loc21_27) [template = constants.%.30] +// CHECK:STDOUT: %.loc21_28.4: init %i32 = converted %.loc21_27, %int.convert_checked.loc21 [template = constants.%.30] +// CHECK:STDOUT: assign %w.var, %.loc21_28.4 // CHECK:STDOUT: br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.else: -// CHECK:STDOUT: %.loc23_10: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc23_11.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc23_11.2: = bound_method %.loc23_10, %.loc23_11.1 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc23: init i32 = call %.loc23_11.2(%.loc23_10) [template = constants.%.28] -// CHECK:STDOUT: %.loc23_11.3: i32 = value_of_initializer %int.convert_checked.loc23 [template = constants.%.28] -// CHECK:STDOUT: %.loc23_11.4: i32 = converted %.loc23_10, %.loc23_11.3 [template = constants.%.28] -// CHECK:STDOUT: return %.loc23_11.4 +// CHECK:STDOUT: %.loc23_10: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc23_11.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc23_11.2: = bound_method %.loc23_10, %.loc23_11.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc23_11.3: = specific_function %.loc23_11.2, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %.loc23_11.3(%.loc23_10) [template = constants.%.26] +// CHECK:STDOUT: %.loc23_11.4: %i32 = value_of_initializer %int.convert_checked.loc23 [template = constants.%.26] +// CHECK:STDOUT: %.loc23_11.5: %i32 = converted %.loc23_10, %.loc23_11.4 [template = constants.%.26] +// CHECK:STDOUT: return %.loc23_11.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @DifferentScopes() -> i32 { +// CHECK:STDOUT: fn @DifferentScopes() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc27: bool = bool_literal true [template = constants.%.1] +// CHECK:STDOUT: %.loc27: bool = bool_literal true [template = constants.%.2] // CHECK:STDOUT: if %.loc27 br !if.then.loc27 else br !if.else.loc27 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc27: -// CHECK:STDOUT: %int.make_type_32.loc28: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc28_21.1: type = value_of_initializer %int.make_type_32.loc28 [template = i32] -// CHECK:STDOUT: %.loc28_21.2: type = converted %int.make_type_32.loc28, %.loc28_21.1 [template = i32] -// CHECK:STDOUT: %v.var: ref i32 = var v -// CHECK:STDOUT: %v: ref i32 = bind_name v, %v.var -// CHECK:STDOUT: %.loc28_27: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc28_28.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc28_28.2: = bound_method %.loc28_27, %.loc28_28.1 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc28: init i32 = call %.loc28_28.2(%.loc28_27) [template = constants.%.28] -// CHECK:STDOUT: %.loc28_28.3: init i32 = converted %.loc28_27, %int.convert_checked.loc28 [template = constants.%.28] -// CHECK:STDOUT: assign %v.var, %.loc28_28.3 -// CHECK:STDOUT: %.loc29: bool = bool_literal true [template = constants.%.1] +// CHECK:STDOUT: %.loc28_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc28: init type = call constants.%Int(%.loc28_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc28_21.2: type = value_of_initializer %int.make_type_signed.loc28 [template = constants.%i32] +// CHECK:STDOUT: %.loc28_21.3: type = converted %int.make_type_signed.loc28, %.loc28_21.2 [template = constants.%i32] +// CHECK:STDOUT: %v.var: ref %i32 = var v +// CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var +// CHECK:STDOUT: %.loc28_27: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc28_28.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc28_28.2: = bound_method %.loc28_27, %.loc28_28.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc28_28.3: = specific_function %.loc28_28.2, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc28: init %i32 = call %.loc28_28.3(%.loc28_27) [template = constants.%.26] +// CHECK:STDOUT: %.loc28_28.4: init %i32 = converted %.loc28_27, %int.convert_checked.loc28 [template = constants.%.26] +// CHECK:STDOUT: assign %v.var, %.loc28_28.4 +// CHECK:STDOUT: %.loc29: bool = bool_literal true [template = constants.%.2] // CHECK:STDOUT: if %.loc29 br !if.then.loc29 else br !if.else.loc29 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc29: -// CHECK:STDOUT: %int.make_type_32.loc36: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc36_23.1: type = value_of_initializer %int.make_type_32.loc36 [template = i32] -// CHECK:STDOUT: %.loc36_23.2: type = converted %int.make_type_32.loc36, %.loc36_23.1 [template = i32] -// CHECK:STDOUT: %w.var: ref i32 = var w -// CHECK:STDOUT: %w: ref i32 = bind_name w, %w.var -// CHECK:STDOUT: %.loc36_29: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc36_30.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc36_30.2: = bound_method %.loc36_29, %.loc36_30.1 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc36: init i32 = call %.loc36_30.2(%.loc36_29) [template = constants.%.31] -// CHECK:STDOUT: %.loc36_30.3: init i32 = converted %.loc36_29, %int.convert_checked.loc36 [template = constants.%.31] -// CHECK:STDOUT: assign %w.var, %.loc36_30.3 +// CHECK:STDOUT: %.loc36_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc36: init type = call constants.%Int(%.loc36_23.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc36_23.2: type = value_of_initializer %int.make_type_signed.loc36 [template = constants.%i32] +// CHECK:STDOUT: %.loc36_23.3: type = converted %int.make_type_signed.loc36, %.loc36_23.2 [template = constants.%i32] +// CHECK:STDOUT: %w.var: ref %i32 = var w +// CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var +// CHECK:STDOUT: %.loc36_29: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc36_30.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc36_30.2: = bound_method %.loc36_29, %.loc36_30.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc36_30.3: = specific_function %.loc36_30.2, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc36: init %i32 = call %.loc36_30.3(%.loc36_29) [template = constants.%.30] +// CHECK:STDOUT: %.loc36_30.4: init %i32 = converted %.loc36_29, %int.convert_checked.loc36 [template = constants.%.30] +// CHECK:STDOUT: assign %w.var, %.loc36_30.4 // CHECK:STDOUT: br !if.else.loc29 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc29: // CHECK:STDOUT: br !if.else.loc27 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc27: -// CHECK:STDOUT: %.loc39_10: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc39_11.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc39_11.2: = bound_method %.loc39_10, %.loc39_11.1 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc39: init i32 = call %.loc39_11.2(%.loc39_10) [template = constants.%.28] -// CHECK:STDOUT: %.loc39_11.3: i32 = value_of_initializer %int.convert_checked.loc39 [template = constants.%.28] -// CHECK:STDOUT: %.loc39_11.4: i32 = converted %.loc39_10, %.loc39_11.3 [template = constants.%.28] -// CHECK:STDOUT: return %.loc39_11.4 +// CHECK:STDOUT: %.loc39_10: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc39_11.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc39_11.2: = bound_method %.loc39_10, %.loc39_11.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc39_11.3: = specific_function %.loc39_11.2, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc39: init %i32 = call %.loc39_11.3(%.loc39_10) [template = constants.%.26] +// CHECK:STDOUT: %.loc39_11.4: %i32 = value_of_initializer %int.convert_checked.loc39 [template = constants.%.26] +// CHECK:STDOUT: %.loc39_11.5: %i32 = converted %.loc39_10, %.loc39_11.4 [template = constants.%.26] +// CHECK:STDOUT: return %.loc39_11.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_returned_var_type.carbon b/toolchain/check/testdata/return/fail_returned_var_type.carbon index c45ccf1a7511..76ec45446cba 100644 --- a/toolchain/check/testdata/return/fail_returned_var_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_type.carbon @@ -22,19 +22,21 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: --- fail_returned_var_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Mismatch.type: type = fn_type @Mismatch [template] // CHECK:STDOUT: %Mismatch: %Mismatch.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] -// CHECK:STDOUT: %.2: f64 = float_literal 0 [template] +// CHECK:STDOUT: %.3: f64 = float_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .Float = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -48,25 +50,26 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mismatch.decl: %Mismatch.type = fn_decl @Mismatch [template = constants.%Mismatch] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_18.2: type = converted %int.make_type_32, %.loc11_18.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_18.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_18.3: type = converted %int.make_type_signed, %.loc11_18.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mismatch() -> i32 { +// CHECK:STDOUT: fn @Mismatch() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc18_19.1: Core.IntLiteral = int_value 64 [template = constants.%.1] +// CHECK:STDOUT: %.loc18_19.1: Core.IntLiteral = int_value 64 [template = constants.%.2] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc18_19.1) [template = f64] // CHECK:STDOUT: %.loc18_19.2: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc18_19.3: type = converted %float.make_type, %.loc18_19.2 [template = f64] // CHECK:STDOUT: %v: f64 = bind_name v, -// CHECK:STDOUT: %.loc18_25: f64 = float_literal 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc18_25: f64 = float_literal 0 [template = constants.%.3] // CHECK:STDOUT: assign , // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_type_mismatch.carbon b/toolchain/check/testdata/return/fail_type_mismatch.carbon index 3d6efcbf3f5b..5858ba884b2c 100644 --- a/toolchain/check/testdata/return/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/return/fail_type_mismatch.carbon @@ -21,16 +21,18 @@ fn Main() -> i32 { // CHECK:STDOUT: --- fail_type_mismatch.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.1: f64 = float_literal 1 [template] +// CHECK:STDOUT: %.2: f64 = float_literal 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -44,21 +46,22 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.3: type = converted %int.make_type_signed, %.loc11_14.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Main() -> i32 { +// CHECK:STDOUT: fn @Main() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc18_10: f64 = float_literal 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc18_13: i32 = converted %.loc18_10, [template = ] +// CHECK:STDOUT: %.loc18_10: f64 = float_literal 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc18_13: %i32 = converted %.loc18_10, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_value_missing.carbon b/toolchain/check/testdata/return/fail_value_missing.carbon index 181126d5b263..83841cf09f18 100644 --- a/toolchain/check/testdata/return/fail_value_missing.carbon +++ b/toolchain/check/testdata/return/fail_value_missing.carbon @@ -21,15 +21,17 @@ fn Main() -> i32 { // CHECK:STDOUT: --- fail_value_missing.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -42,18 +44,19 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.3: type = converted %int.make_type_signed, %.loc11_14.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Main() -> i32 { +// CHECK:STDOUT: fn @Main() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_var_in_type.carbon b/toolchain/check/testdata/return/fail_var_in_type.carbon index 502cec846806..83ef8a61ca16 100644 --- a/toolchain/check/testdata/return/fail_var_in_type.carbon +++ b/toolchain/check/testdata/return/fail_var_in_type.carbon @@ -17,16 +17,18 @@ fn Six() -> x { return 6; } // CHECK:STDOUT: --- fail_var_in_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Six.type: type = fn_type @Six [template] // CHECK:STDOUT: %Six: %Six.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -54,14 +56,15 @@ fn Six() -> x { return 6; } // CHECK:STDOUT: // CHECK:STDOUT: fn @Six() -> { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15_24: Core.IntLiteral = int_value 6 [template = constants.%.1] +// CHECK:STDOUT: %.loc15_24: Core.IntLiteral = int_value 6 [template = constants.%.2] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: assign file.%x.var, %int.make_type_32 +// CHECK:STDOUT: %.loc11: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11) [template = constants.%i32] +// CHECK:STDOUT: assign file.%x.var, %int.make_type_signed // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon b/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon index b63f62f5d3fb..bc35e74760dc 100644 --- a/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon +++ b/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon @@ -13,9 +13,8 @@ // A minimized prelude intended to contain as few functions as possible. package Core; -fn Int32() -> type = "int.make_type_32"; - fn IntLiteral() -> type = "int_literal.make_type"; +fn Int(N: IntLiteral()) -> type = "int.make_type_signed"; interface ImplicitAs(T:! type) { fn Convert[self: Self]() -> T; @@ -66,10 +65,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: --- core.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] @@ -80,29 +79,24 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.3 [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] -// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.3 [template] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @ImplicitAs.%Convert.decl [template] -// CHECK:STDOUT: %.5: = interface_witness (%Convert.2) [template] +// CHECK:STDOUT: %.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.3 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, @ImplicitAs.%Convert.decl [template] +// CHECK:STDOUT: %.6: = interface_witness (%Convert.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int32 = %Int32.decl // CHECK:STDOUT: .IntLiteral = %IntLiteral.decl +// CHECK:STDOUT: .Int = %Int.decl // CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] { -// CHECK:STDOUT: %return.patt: type = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 -// CHECK:STDOUT: %return: ref type = return_slot %return.param -// CHECK:STDOUT: } // CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] { // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0 @@ -110,37 +104,53 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 // CHECK:STDOUT: %return: ref type = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] { +// CHECK:STDOUT: %N.patt: Core.IntLiteral = binding_pattern N +// CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: type = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc6_22.2: type = converted %int_literal.make_type, %.loc6_22.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %N: Core.IntLiteral = bind_name N, %N.param +// CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 +// CHECK:STDOUT: %return: ref type = return_slot %return.param +// CHECK:STDOUT: } // CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.1 = interface_decl @ImplicitAs [template = constants.%ImplicitAs] { -// CHECK:STDOUT: %T.patt.loc9_22.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_22.2 (constants.%T.patt)] -// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc9_22.1, runtime_param [symbolic = %T.patt.loc9_22.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.patt.loc8_22.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_22.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc8_22.1, runtime_param [symbolic = %T.patt.loc8_22.2 (constants.%T.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.param: type = value_param runtime_param -// CHECK:STDOUT: %T.loc9_22.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc9_22.2 (constants.%T)] +// CHECK:STDOUT: %T.loc8_22.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_22.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc13_17.2: type = converted %int_literal.make_type, %.loc13_17.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc12_17.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc12_17.2: type = converted %int_literal.make_type, %.loc12_17.1 [template = Core.IntLiteral] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, file.%ImplicitAs.decl [template = constants.%ImplicitAs] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_32.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_32.2: type = converted %int.make_type_32, %.loc13_32.1 [template = i32] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %.loc12_33: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc12_33) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_32.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc12_32.2: type = converted %int.make_type_signed, %.loc12_32.1 [template = constants.%i32] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32)> [template = constants.%ImplicitAs.type.3] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @ImplicitAs(%T.loc9_22.1: type) { -// CHECK:STDOUT: %T.loc9_22.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc9_22.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc9_22.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_22.2 (constants.%T.patt)] +// CHECK:STDOUT: generic interface @ImplicitAs(%T.loc8_22.1: type) { +// CHECK:STDOUT: %T.loc8_22.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_22.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_22.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_22.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T.loc9_22.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T.loc8_22.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%T.loc9_22.2) [symbolic = %Convert.type (constants.%Convert.type.1)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%T.loc8_22.2) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.loc10_32.2: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.loc10_32.2 (constants.%.1)] -// CHECK:STDOUT: %.loc10_32.3: @ImplicitAs.%.loc10_32.2 (%.1) = assoc_entity element0, %Convert.decl [symbolic = %.loc10_32.3 (constants.%.2)] +// CHECK:STDOUT: %.loc9_32.2: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.loc9_32.2 (constants.%.1)] +// CHECK:STDOUT: %.loc9_32.3: @ImplicitAs.%.loc9_32.2 (%.1) = assoc_entity element0, %Convert.decl [symbolic = %.loc9_32.3 (constants.%.2)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] @@ -150,53 +160,54 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.patt: @Convert.1.%T (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @Convert.1.%T (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc10_20.1: @Convert.1.%ImplicitAs.type (%ImplicitAs.type.2) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%T) [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref: @Convert.1.%ImplicitAs.type (%ImplicitAs.type.2) = name_ref Self, %.loc10_20.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %.loc10_20.2: type = facet_type_access %Self.ref [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %.loc10_20.3: type = converted %Self.ref, %.loc10_20.2 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %T.ref: type = name_ref T, @ImplicitAs.%T.loc9_22.1 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %.loc9_20.1: @Convert.1.%ImplicitAs.type (%ImplicitAs.type.2) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%T) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref: @Convert.1.%ImplicitAs.type (%ImplicitAs.type.2) = name_ref Self, %.loc9_20.1 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %.loc9_20.2: type = facet_type_access %Self.ref [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %.loc9_20.3: type = converted %Self.ref, %.loc9_20.2 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %T.ref: type = name_ref T, @ImplicitAs.%T.loc8_22.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %self.param: @Convert.1.%Self (%Self) = value_param runtime_param0 // CHECK:STDOUT: %self: @Convert.1.%Self (%Self) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @Convert.1.%T (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @Convert.1.%T (%T) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc10_32.1: @ImplicitAs.%.loc10_32.2 (%.1) = assoc_entity element0, %Convert.decl [symbolic = %.loc10_32.3 (constants.%.2)] +// CHECK:STDOUT: %.loc9_32.1: @ImplicitAs.%.loc9_32.2 (%.1) = assoc_entity element0, %Convert.decl [symbolic = %.loc9_32.3 (constants.%.2)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 -// CHECK:STDOUT: .Convert = %.loc10_32.1 +// CHECK:STDOUT: .Convert = %.loc9_32.1 // CHECK:STDOUT: witness = (%Convert.decl) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc13_17.2 as %ImplicitAs.type { +// CHECK:STDOUT: impl @impl: %.loc12_17.2 as %ImplicitAs.type { // CHECK:STDOUT: %Convert.decl: %Convert.type.2 = fn_decl @Convert.2 [template = constants.%Convert.2] { // CHECK:STDOUT: %self.patt: Core.IntLiteral = binding_pattern self // CHECK:STDOUT: %self.param_patt: Core.IntLiteral = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%.loc13_17.2 [template = Core.IntLiteral] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_31.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_31.2: type = converted %int.make_type_32, %.loc14_31.1 [template = i32] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%.loc12_17.2 [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc13_31.1: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_31.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_31.3: type = converted %int.make_type_signed, %.loc13_31.2 [template = constants.%i32] // CHECK:STDOUT: %self.param: Core.IntLiteral = value_param runtime_param0 // CHECK:STDOUT: %self: Core.IntLiteral = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13_38: = interface_witness (%Convert.decl) [template = constants.%.5] +// CHECK:STDOUT: %.loc12_38: = interface_witness (%Convert.decl) [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl -// CHECK:STDOUT: witness = %.loc13_38 +// CHECK:STDOUT: witness = %.loc12_38 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; -// CHECK:STDOUT: // CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.1(@ImplicitAs.%T.loc9_22.1: type, @ImplicitAs.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { +// CHECK:STDOUT: fn @Int(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(@ImplicitAs.%T.loc8_22.1: type, @ImplicitAs.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)] // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)] @@ -204,16 +215,16 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self)]() -> @Convert.1.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.2[%self.param_patt: Core.IntLiteral]() -> i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @Convert.2[%self.param_patt: Core.IntLiteral]() -> %i32 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%T) { -// CHECK:STDOUT: %T.loc9_22.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc9_22.2 => constants.%T +// CHECK:STDOUT: %T.loc8_22.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_22.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%T) { -// CHECK:STDOUT: %T.loc9_22.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc9_22.2 => constants.%T +// CHECK:STDOUT: %T.loc8_22.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_22.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.1(constants.%T, constants.%Self) { @@ -222,26 +233,26 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(%T.loc9_22.2) { -// CHECK:STDOUT: %T.loc9_22.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc9_22.2 => constants.%T +// CHECK:STDOUT: specific @ImplicitAs(%T.loc8_22.2) { +// CHECK:STDOUT: %T.loc8_22.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_22.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(i32) { -// CHECK:STDOUT: %T.loc9_22.2 => i32 -// CHECK:STDOUT: %T.patt.loc9_22.2 => i32 +// CHECK:STDOUT: specific @ImplicitAs(constants.%i32) { +// CHECK:STDOUT: %T.loc8_22.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc8_22.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 // CHECK:STDOUT: %Self.2 => constants.%Self // CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 // CHECK:STDOUT: %Convert => constants.%Convert.3 -// CHECK:STDOUT: %.loc10_32.2 => constants.%.3 -// CHECK:STDOUT: %.loc10_32.3 => constants.%.4 +// CHECK:STDOUT: %.loc9_32.2 => constants.%.4 +// CHECK:STDOUT: %.loc9_32.3 => constants.%.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.1(i32, Core.IntLiteral) { -// CHECK:STDOUT: %T => i32 +// CHECK:STDOUT: specific @Convert.1(constants.%i32, Core.IntLiteral) { +// CHECK:STDOUT: %T => constants.%i32 // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 // CHECK:STDOUT: %Self => Core.IntLiteral // CHECK:STDOUT: } @@ -249,23 +260,25 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: --- library.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %N: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%N) [symbolic] -// CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %D: type = class_type @D [template] -// CHECK:STDOUT: %.3: type = unbound_element_type %D, i32 [template] -// CHECK:STDOUT: %.4: type = struct_type {.n: i32, .m: i32} [template] -// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] +// CHECK:STDOUT: %.4: type = unbound_element_type %D, %i32 [template] +// CHECK:STDOUT: %.5: type = struct_type {.n: %i32, .m: %i32} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] -// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.8: type = struct_type {.n: Core.IntLiteral, .m: Core.IntLiteral} [template] +// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.9: type = struct_type {.n: Core.IntLiteral, .m: Core.IntLiteral} [template] // CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] @@ -275,94 +288,94 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%T) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.6 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %.10: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.11: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.6 [template] -// CHECK:STDOUT: %.13: %.9 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %.12: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.14: %.10 = assoc_entity element0, imports.%import_ref.7 [symbolic] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] -// CHECK:STDOUT: %.14: = interface_witness (%Convert.3) [template] -// CHECK:STDOUT: %.15: = bound_method %.7, %Convert.3 [template] -// CHECK:STDOUT: %.16: i32 = int_value 0 [template] -// CHECK:STDOUT: %struct: %D = struct_value (%.16, %.16) [template] -// CHECK:STDOUT: %C.3: type = class_type @C, @C(%.16) [template] +// CHECK:STDOUT: %.15: = interface_witness (%Convert.3) [template] +// CHECK:STDOUT: %.16: = bound_method %.8, %Convert.3 [template] +// CHECK:STDOUT: %.17: %i32 = int_value 0 [template] +// CHECK:STDOUT: %struct: %D = struct_value (%.17, %.17) [template] +// CHECK:STDOUT: %C.3: type = class_type @C, @C(%.17) [template] // CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%D)> [template] // CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [template] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(%D) [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.17: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.5 [template] -// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.6 [template] -// CHECK:STDOUT: %.19: = interface_witness (%Convert.4) [template] -// CHECK:STDOUT: %.21: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.22: = bound_method %.21, %Convert.3 [template] -// CHECK:STDOUT: %.23: i32 = int_value 1 [template] -// CHECK:STDOUT: %C.4: type = class_type @C, @C(%.23) [template] +// CHECK:STDOUT: %.18: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.5 [template] +// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.20: = interface_witness (%Convert.4) [template] +// CHECK:STDOUT: %.22: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.23: = bound_method %.22, %Convert.3 [template] +// CHECK:STDOUT: %.24: %i32 = int_value 1 [template] +// CHECK:STDOUT: %C.4: type = class_type @C, @C(%.24) [template] // CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4 [template] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [template] -// CHECK:STDOUT: %.24: = interface_witness (%Convert.6) [template] -// CHECK:STDOUT: %.25: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.26: = bound_method %.25, %Convert.3 [template] -// CHECK:STDOUT: %.27: i32 = int_value 2 [template] -// CHECK:STDOUT: %C.5: type = class_type @C, @C(%.27) [template] +// CHECK:STDOUT: %.25: = interface_witness (%Convert.6) [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.27: = bound_method %.26, %Convert.3 [template] +// CHECK:STDOUT: %.28: %i32 = int_value 2 [template] +// CHECK:STDOUT: %C.5: type = class_type @C, @C(%.28) [template] // CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5 [template] // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [template] -// CHECK:STDOUT: %.28: = interface_witness (%Convert.7) [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.3 [template] -// CHECK:STDOUT: %.31: i32 = int_value 3 [template] -// CHECK:STDOUT: %C.6: type = class_type @C, @C(%.31) [template] +// CHECK:STDOUT: %.29: = interface_witness (%Convert.7) [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.31: = bound_method %.30, %Convert.3 [template] +// CHECK:STDOUT: %.32: %i32 = int_value 3 [template] +// CHECK:STDOUT: %C.6: type = class_type @C, @C(%.32) [template] // CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6 [template] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.8) [template] -// CHECK:STDOUT: %.33: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %.34: = bound_method %.33, %Convert.3 [template] -// CHECK:STDOUT: %.35: i32 = int_value 4 [template] -// CHECK:STDOUT: %C.7: type = class_type @C, @C(%.35) [template] +// CHECK:STDOUT: %.33: = interface_witness (%Convert.8) [template] +// CHECK:STDOUT: %.34: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.35: = bound_method %.34, %Convert.3 [template] +// CHECK:STDOUT: %.36: %i32 = int_value 4 [template] +// CHECK:STDOUT: %C.7: type = class_type @C, @C(%.36) [template] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.7 [template] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %.36: = interface_witness (%Convert.9) [template] -// CHECK:STDOUT: %.37: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %.38: = bound_method %.37, %Convert.3 [template] -// CHECK:STDOUT: %.39: i32 = int_value 5 [template] -// CHECK:STDOUT: %C.8: type = class_type @C, @C(%.39) [template] +// CHECK:STDOUT: %.37: = interface_witness (%Convert.9) [template] +// CHECK:STDOUT: %.38: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.39: = bound_method %.38, %Convert.3 [template] +// CHECK:STDOUT: %.40: %i32 = int_value 5 [template] +// CHECK:STDOUT: %C.8: type = class_type @C, @C(%.40) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.8 [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %.40: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %.41: Core.IntLiteral = int_value 6 [template] -// CHECK:STDOUT: %.42: = bound_method %.41, %Convert.3 [template] -// CHECK:STDOUT: %.43: i32 = int_value 6 [template] -// CHECK:STDOUT: %C.9: type = class_type @C, @C(%.43) [template] +// CHECK:STDOUT: %.41: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %.42: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %.43: = bound_method %.42, %Convert.3 [template] +// CHECK:STDOUT: %.44: %i32 = int_value 6 [template] +// CHECK:STDOUT: %C.9: type = class_type @C, @C(%.44) [template] // CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.9 [template] // CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %.44: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %.45: Core.IntLiteral = int_value 7 [template] -// CHECK:STDOUT: %.46: = bound_method %.45, %Convert.3 [template] -// CHECK:STDOUT: %.47: i32 = int_value 7 [template] -// CHECK:STDOUT: %C.10: type = class_type @C, @C(%.47) [template] +// CHECK:STDOUT: %.45: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %.46: Core.IntLiteral = int_value 7 [template] +// CHECK:STDOUT: %.47: = bound_method %.46, %Convert.3 [template] +// CHECK:STDOUT: %.48: %i32 = int_value 7 [template] +// CHECK:STDOUT: %C.10: type = class_type @C, @C(%.48) [template] // CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10 [template] // CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %.48: = interface_witness (%Convert.12) [template] +// CHECK:STDOUT: %.49: = interface_witness (%Convert.12) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//default, inst+22, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst+28, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.9) = import_ref Core//default, inst+50, loaded [symbolic = @ImplicitAs.%.2 (constants.%.13)] -// CHECK:STDOUT: %import_ref.5: @ImplicitAs.%Convert.type (%Convert.type.1) = import_ref Core//default, inst+43, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.1)] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//default, inst+43, unloaded -// CHECK:STDOUT: %import_ref.8: type = import_ref Core//default, inst+61, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//default, inst+66, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.10: = import_ref Core//default, inst+88, loaded [template = constants.%.14] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//default, inst+30, loaded [template = constants.%ImplicitAs] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst+36, unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.10) = import_ref Core//default, inst+58, loaded [symbolic = @ImplicitAs.%.2 (constants.%.14)] +// CHECK:STDOUT: %import_ref.5: @ImplicitAs.%Convert.type (%Convert.type.1) = import_ref Core//default, inst+51, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.1)] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//default, inst+51, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//default, inst+69, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//default, inst+77, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.10: = import_ref Core//default, inst+100, loaded [template = constants.%.15] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -374,14 +387,15 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { -// CHECK:STDOUT: %N.patt.loc6_9.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_9.2 (constants.%N.patt)] -// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc6_9.1, runtime_param [symbolic = %N.patt.loc6_9.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.patt.loc6_9.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_9.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc6_9.1, runtime_param [symbolic = %N.patt.loc6_9.2 (constants.%N.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc6_13.2: type = converted %int.make_type_32, %.loc6_13.1 [template = i32] -// CHECK:STDOUT: %N.param: i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc6_9.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc6_9.2 (constants.%N)] +// CHECK:STDOUT: %.loc6_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc6_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc6_13.3: type = converted %int.make_type_signed, %.loc6_13.2 [template = constants.%i32] +// CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc6_9.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc6_9.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { @@ -394,13 +408,13 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc10_8: Core.IntLiteral = int_value 0 [template = constants.%.7] -// CHECK:STDOUT: %.loc10_7.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc10_7.2: = bound_method %.loc10_8, %.loc10_7.1 [template = constants.%.15] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc10_7.2(%.loc10_8) [template = constants.%.16] -// CHECK:STDOUT: %.loc10_7.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.16] -// CHECK:STDOUT: %.loc10_7.4: i32 = converted %.loc10_8, %.loc10_7.3 [template = constants.%.16] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.16) [template = constants.%C.3] +// CHECK:STDOUT: %.loc10_8: Core.IntLiteral = int_value 0 [template = constants.%.8] +// CHECK:STDOUT: %.loc10_7.1: %Convert.type.2 = interface_witness_access constants.%.15, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc10_7.2: = bound_method %.loc10_8, %.loc10_7.1 [template = constants.%.16] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc10_7.2(%.loc10_8) [template = constants.%.17] +// CHECK:STDOUT: %.loc10_7.3: %i32 = value_of_initializer %int.convert_checked [template = constants.%.17] +// CHECK:STDOUT: %.loc10_7.4: %i32 = converted %.loc10_8, %.loc10_7.3 [template = constants.%.17] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.17) [template = constants.%C.3] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] @@ -408,13 +422,13 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.3 [template] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc11_8: Core.IntLiteral = int_value 1 [template = constants.%.21] -// CHECK:STDOUT: %.loc11_7.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc11_7.2: = bound_method %.loc11_8, %.loc11_7.1 [template = constants.%.22] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc11_7.2(%.loc11_8) [template = constants.%.23] -// CHECK:STDOUT: %.loc11_7.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.23] -// CHECK:STDOUT: %.loc11_7.4: i32 = converted %.loc11_8, %.loc11_7.3 [template = constants.%.23] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.23) [template = constants.%C.4] +// CHECK:STDOUT: %.loc11_8: Core.IntLiteral = int_value 1 [template = constants.%.22] +// CHECK:STDOUT: %.loc11_7.1: %Convert.type.2 = interface_witness_access constants.%.15, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc11_7.2: = bound_method %.loc11_8, %.loc11_7.1 [template = constants.%.23] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc11_7.2(%.loc11_8) [template = constants.%.24] +// CHECK:STDOUT: %.loc11_7.3: %i32 = value_of_initializer %int.convert_checked [template = constants.%.24] +// CHECK:STDOUT: %.loc11_7.4: %i32 = converted %.loc11_8, %.loc11_7.3 [template = constants.%.24] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.24) [template = constants.%C.4] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] @@ -422,13 +436,13 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.4 [template] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc12_8: Core.IntLiteral = int_value 2 [template = constants.%.25] -// CHECK:STDOUT: %.loc12_7.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc12_7.2: = bound_method %.loc12_8, %.loc12_7.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_7.2(%.loc12_8) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_7.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc12_7.4: i32 = converted %.loc12_8, %.loc12_7.3 [template = constants.%.27] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.27) [template = constants.%C.5] +// CHECK:STDOUT: %.loc12_8: Core.IntLiteral = int_value 2 [template = constants.%.26] +// CHECK:STDOUT: %.loc12_7.1: %Convert.type.2 = interface_witness_access constants.%.15, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc12_7.2: = bound_method %.loc12_8, %.loc12_7.1 [template = constants.%.27] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc12_7.2(%.loc12_8) [template = constants.%.28] +// CHECK:STDOUT: %.loc12_7.3: %i32 = value_of_initializer %int.convert_checked [template = constants.%.28] +// CHECK:STDOUT: %.loc12_7.4: %i32 = converted %.loc12_8, %.loc12_7.3 [template = constants.%.28] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.28) [template = constants.%C.5] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] @@ -436,13 +450,13 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.5 [template] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc13_8: Core.IntLiteral = int_value 3 [template = constants.%.29] -// CHECK:STDOUT: %.loc13_7.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc13_7.2: = bound_method %.loc13_8, %.loc13_7.1 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc13_7.2(%.loc13_8) [template = constants.%.31] -// CHECK:STDOUT: %.loc13_7.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.31] -// CHECK:STDOUT: %.loc13_7.4: i32 = converted %.loc13_8, %.loc13_7.3 [template = constants.%.31] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.31) [template = constants.%C.6] +// CHECK:STDOUT: %.loc13_8: Core.IntLiteral = int_value 3 [template = constants.%.30] +// CHECK:STDOUT: %.loc13_7.1: %Convert.type.2 = interface_witness_access constants.%.15, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc13_7.2: = bound_method %.loc13_8, %.loc13_7.1 [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc13_7.2(%.loc13_8) [template = constants.%.32] +// CHECK:STDOUT: %.loc13_7.3: %i32 = value_of_initializer %int.convert_checked [template = constants.%.32] +// CHECK:STDOUT: %.loc13_7.4: %i32 = converted %.loc13_8, %.loc13_7.3 [template = constants.%.32] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.32) [template = constants.%C.6] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] @@ -450,13 +464,13 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.6 [template] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc14_8: Core.IntLiteral = int_value 4 [template = constants.%.33] -// CHECK:STDOUT: %.loc14_7.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc14_7.2: = bound_method %.loc14_8, %.loc14_7.1 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc14_7.2(%.loc14_8) [template = constants.%.35] -// CHECK:STDOUT: %.loc14_7.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.35] -// CHECK:STDOUT: %.loc14_7.4: i32 = converted %.loc14_8, %.loc14_7.3 [template = constants.%.35] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.35) [template = constants.%C.7] +// CHECK:STDOUT: %.loc14_8: Core.IntLiteral = int_value 4 [template = constants.%.34] +// CHECK:STDOUT: %.loc14_7.1: %Convert.type.2 = interface_witness_access constants.%.15, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc14_7.2: = bound_method %.loc14_8, %.loc14_7.1 [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc14_7.2(%.loc14_8) [template = constants.%.36] +// CHECK:STDOUT: %.loc14_7.3: %i32 = value_of_initializer %int.convert_checked [template = constants.%.36] +// CHECK:STDOUT: %.loc14_7.4: %i32 = converted %.loc14_8, %.loc14_7.3 [template = constants.%.36] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.36) [template = constants.%C.7] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] @@ -464,13 +478,13 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.7 [template] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc15_8: Core.IntLiteral = int_value 5 [template = constants.%.37] -// CHECK:STDOUT: %.loc15_7.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc15_7.2: = bound_method %.loc15_8, %.loc15_7.1 [template = constants.%.38] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc15_7.2(%.loc15_8) [template = constants.%.39] -// CHECK:STDOUT: %.loc15_7.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.39] -// CHECK:STDOUT: %.loc15_7.4: i32 = converted %.loc15_8, %.loc15_7.3 [template = constants.%.39] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.39) [template = constants.%C.8] +// CHECK:STDOUT: %.loc15_8: Core.IntLiteral = int_value 5 [template = constants.%.38] +// CHECK:STDOUT: %.loc15_7.1: %Convert.type.2 = interface_witness_access constants.%.15, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc15_7.2: = bound_method %.loc15_8, %.loc15_7.1 [template = constants.%.39] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc15_7.2(%.loc15_8) [template = constants.%.40] +// CHECK:STDOUT: %.loc15_7.3: %i32 = value_of_initializer %int.convert_checked [template = constants.%.40] +// CHECK:STDOUT: %.loc15_7.4: %i32 = converted %.loc15_8, %.loc15_7.3 [template = constants.%.40] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.40) [template = constants.%C.8] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] @@ -478,13 +492,13 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.8 [template] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc16_8: Core.IntLiteral = int_value 6 [template = constants.%.41] -// CHECK:STDOUT: %.loc16_7.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc16_7.2: = bound_method %.loc16_8, %.loc16_7.1 [template = constants.%.42] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc16_7.2(%.loc16_8) [template = constants.%.43] -// CHECK:STDOUT: %.loc16_7.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.43] -// CHECK:STDOUT: %.loc16_7.4: i32 = converted %.loc16_8, %.loc16_7.3 [template = constants.%.43] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.43) [template = constants.%C.9] +// CHECK:STDOUT: %.loc16_8: Core.IntLiteral = int_value 6 [template = constants.%.42] +// CHECK:STDOUT: %.loc16_7.1: %Convert.type.2 = interface_witness_access constants.%.15, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc16_7.2: = bound_method %.loc16_8, %.loc16_7.1 [template = constants.%.43] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc16_7.2(%.loc16_8) [template = constants.%.44] +// CHECK:STDOUT: %.loc16_7.3: %i32 = value_of_initializer %int.convert_checked [template = constants.%.44] +// CHECK:STDOUT: %.loc16_7.4: %i32 = converted %.loc16_8, %.loc16_7.3 [template = constants.%.44] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.44) [template = constants.%C.9] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] @@ -492,13 +506,13 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.9 [template] {} { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc17_8: Core.IntLiteral = int_value 7 [template = constants.%.45] -// CHECK:STDOUT: %.loc17_7.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc17_7.2: = bound_method %.loc17_8, %.loc17_7.1 [template = constants.%.46] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc17_7.2(%.loc17_8) [template = constants.%.47] -// CHECK:STDOUT: %.loc17_7.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.47] -// CHECK:STDOUT: %.loc17_7.4: i32 = converted %.loc17_8, %.loc17_7.3 [template = constants.%.47] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.47) [template = constants.%C.10] +// CHECK:STDOUT: %.loc17_8: Core.IntLiteral = int_value 7 [template = constants.%.46] +// CHECK:STDOUT: %.loc17_7.1: %Convert.type.2 = interface_witness_access constants.%.15, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc17_7.2: = bound_method %.loc17_8, %.loc17_7.1 [template = constants.%.47] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc17_7.2(%.loc17_8) [template = constants.%.48] +// CHECK:STDOUT: %.loc17_7.3: %i32 = value_of_initializer %int.convert_checked [template = constants.%.48] +// CHECK:STDOUT: %.loc17_7.4: %i32 = converted %.loc17_8, %.loc17_7.3 [template = constants.%.48] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.48) [template = constants.%C.10] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] @@ -515,8 +529,8 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%T) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.9)] -// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.9) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.10) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.11)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -545,7 +559,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc10_33: = interface_witness (%Convert.decl) [template = constants.%.19] +// CHECK:STDOUT: %.loc10_33: = interface_witness (%Convert.decl) [template = constants.%.20] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl @@ -566,7 +580,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11_33: = interface_witness (%Convert.decl) [template = constants.%.24] +// CHECK:STDOUT: %.loc11_33: = interface_witness (%Convert.decl) [template = constants.%.25] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl @@ -587,7 +601,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc12_33: = interface_witness (%Convert.decl) [template = constants.%.28] +// CHECK:STDOUT: %.loc12_33: = interface_witness (%Convert.decl) [template = constants.%.29] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl @@ -608,7 +622,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc13_33: = interface_witness (%Convert.decl) [template = constants.%.32] +// CHECK:STDOUT: %.loc13_33: = interface_witness (%Convert.decl) [template = constants.%.33] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl @@ -629,7 +643,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc14_33: = interface_witness (%Convert.decl) [template = constants.%.36] +// CHECK:STDOUT: %.loc14_33: = interface_witness (%Convert.decl) [template = constants.%.37] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl @@ -650,7 +664,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15_33: = interface_witness (%Convert.decl) [template = constants.%.40] +// CHECK:STDOUT: %.loc15_33: = interface_witness (%Convert.decl) [template = constants.%.41] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl @@ -671,7 +685,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc16_33: = interface_witness (%Convert.decl) [template = constants.%.44] +// CHECK:STDOUT: %.loc16_33: = interface_witness (%Convert.decl) [template = constants.%.45] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl @@ -692,21 +706,21 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc17_33: = interface_witness (%Convert.decl) [template = constants.%.48] +// CHECK:STDOUT: %.loc17_33: = interface_witness (%Convert.decl) [template = constants.%.49] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl // CHECK:STDOUT: witness = %.loc17_33 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(%N.loc6_9.1: i32) { -// CHECK:STDOUT: %N.loc6_9.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc6_9.2 (constants.%N)] -// CHECK:STDOUT: %N.patt.loc6_9.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_9.2 (constants.%N.patt)] +// CHECK:STDOUT: generic class @C(%N.loc6_9.1: %i32) { +// CHECK:STDOUT: %N.loc6_9.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc6_9.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc6_9.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_9.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc6_19: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc6_19: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 @@ -714,15 +728,17 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { -// CHECK:STDOUT: %int.make_type_32.loc7_18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_18.1: type = value_of_initializer %int.make_type_32.loc7_18 [template = i32] -// CHECK:STDOUT: %.loc7_18.2: type = converted %int.make_type_32.loc7_18, %.loc7_18.1 [template = i32] -// CHECK:STDOUT: %.loc7_16: %.3 = field_decl n, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc7_30: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_30.1: type = value_of_initializer %int.make_type_32.loc7_30 [template = i32] -// CHECK:STDOUT: %.loc7_30.2: type = converted %int.make_type_32.loc7_30, %.loc7_30.1 [template = i32] -// CHECK:STDOUT: %.loc7_28: %.3 = field_decl m, element1 [template] -// CHECK:STDOUT: %.loc7_35: = complete_type_witness %.4 [template = constants.%.5] +// CHECK:STDOUT: %.loc7_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_18: init type = call constants.%Int(%.loc7_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_18.2: type = value_of_initializer %int.make_type_signed.loc7_18 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_18.3: type = converted %int.make_type_signed.loc7_18, %.loc7_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_16: %.4 = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc7_30.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_30: init type = call constants.%Int(%.loc7_30.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_30.2: type = value_of_initializer %int.make_type_signed.loc7_30 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_30.3: type = converted %int.make_type_signed.loc7_30, %.loc7_30.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_28: %.4 = field_decl m, element1 [template] +// CHECK:STDOUT: %.loc7_35: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D @@ -730,25 +746,25 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: .m = %.loc7_28 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; +// CHECK:STDOUT: fn @Int(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Make() -> %return: %D { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc8_31: Core.IntLiteral = int_value 0 [template = constants.%.7] -// CHECK:STDOUT: %.loc8_39: Core.IntLiteral = int_value 0 [template = constants.%.7] -// CHECK:STDOUT: %.loc8_40.1: %.8 = struct_literal (%.loc8_31, %.loc8_39) -// CHECK:STDOUT: %.loc8_40.2: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc8_40.3: = bound_method %.loc8_31, %.loc8_40.2 [template = constants.%.15] -// CHECK:STDOUT: %int.convert_checked.loc8_40.1: init i32 = call %.loc8_40.3(%.loc8_31) [template = constants.%.16] -// CHECK:STDOUT: %.loc8_40.4: init i32 = converted %.loc8_31, %int.convert_checked.loc8_40.1 [template = constants.%.16] -// CHECK:STDOUT: %.loc8_40.5: ref i32 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc8_40.6: init i32 = initialize_from %.loc8_40.4 to %.loc8_40.5 [template = constants.%.16] -// CHECK:STDOUT: %.loc8_40.7: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc8_40.8: = bound_method %.loc8_39, %.loc8_40.7 [template = constants.%.15] -// CHECK:STDOUT: %int.convert_checked.loc8_40.2: init i32 = call %.loc8_40.8(%.loc8_39) [template = constants.%.16] -// CHECK:STDOUT: %.loc8_40.9: init i32 = converted %.loc8_39, %int.convert_checked.loc8_40.2 [template = constants.%.16] -// CHECK:STDOUT: %.loc8_40.10: ref i32 = class_element_access %return, element1 -// CHECK:STDOUT: %.loc8_40.11: init i32 = initialize_from %.loc8_40.9 to %.loc8_40.10 [template = constants.%.16] +// CHECK:STDOUT: %.loc8_31: Core.IntLiteral = int_value 0 [template = constants.%.8] +// CHECK:STDOUT: %.loc8_39: Core.IntLiteral = int_value 0 [template = constants.%.8] +// CHECK:STDOUT: %.loc8_40.1: %.9 = struct_literal (%.loc8_31, %.loc8_39) +// CHECK:STDOUT: %.loc8_40.2: %Convert.type.2 = interface_witness_access constants.%.15, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc8_40.3: = bound_method %.loc8_31, %.loc8_40.2 [template = constants.%.16] +// CHECK:STDOUT: %int.convert_checked.loc8_40.1: init %i32 = call %.loc8_40.3(%.loc8_31) [template = constants.%.17] +// CHECK:STDOUT: %.loc8_40.4: init %i32 = converted %.loc8_31, %int.convert_checked.loc8_40.1 [template = constants.%.17] +// CHECK:STDOUT: %.loc8_40.5: ref %i32 = class_element_access %return, element0 +// CHECK:STDOUT: %.loc8_40.6: init %i32 = initialize_from %.loc8_40.4 to %.loc8_40.5 [template = constants.%.17] +// CHECK:STDOUT: %.loc8_40.7: %Convert.type.2 = interface_witness_access constants.%.15, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc8_40.8: = bound_method %.loc8_39, %.loc8_40.7 [template = constants.%.16] +// CHECK:STDOUT: %int.convert_checked.loc8_40.2: init %i32 = call %.loc8_40.8(%.loc8_39) [template = constants.%.17] +// CHECK:STDOUT: %.loc8_40.9: init %i32 = converted %.loc8_39, %int.convert_checked.loc8_40.2 [template = constants.%.17] +// CHECK:STDOUT: %.loc8_40.10: ref %i32 = class_element_access %return, element1 +// CHECK:STDOUT: %.loc8_40.11: init %i32 = initialize_from %.loc8_40.9 to %.loc8_40.10 [template = constants.%.17] // CHECK:STDOUT: %.loc8_40.12: init %D = class_init (%.loc8_40.6, %.loc8_40.11), %return [template = constants.%struct] // CHECK:STDOUT: %.loc8_41: init %D = converted %.loc8_40.1, %.loc8_40.12 [template = constants.%struct] // CHECK:STDOUT: return %.loc8_41 to %return @@ -762,7 +778,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.2[%self.param_patt: Core.IntLiteral]() -> i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @Convert.2[%self.param_patt: Core.IntLiteral]() -> %i32 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Convert.3[%self.param_patt: %C.3]() -> %return: %D { // CHECK:STDOUT: !entry: @@ -854,22 +870,22 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(i32) { -// CHECK:STDOUT: %T => i32 -// CHECK:STDOUT: %T.patt => i32 +// CHECK:STDOUT: specific @ImplicitAs(constants.%i32) { +// CHECK:STDOUT: %T => constants.%i32 +// CHECK:STDOUT: %T.patt => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.1 => constants.%.11 -// CHECK:STDOUT: %.2 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.2 => constants.%.13 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%.16) { -// CHECK:STDOUT: %N.loc6_9.2 => constants.%.16 -// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%.16 +// CHECK:STDOUT: specific @C(constants.%.17) { +// CHECK:STDOUT: %N.loc6_9.2 => constants.%.17 +// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%.17 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -883,8 +899,8 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5 // CHECK:STDOUT: %Convert => constants.%Convert.5 -// CHECK:STDOUT: %.1 => constants.%.17 -// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: %.1 => constants.%.18 +// CHECK:STDOUT: %.2 => constants.%.19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.1(constants.%D, constants.%C.3) { @@ -893,9 +909,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self => constants.%C.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%.23) { -// CHECK:STDOUT: %N.loc6_9.2 => constants.%.23 -// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%.23 +// CHECK:STDOUT: specific @C(constants.%.24) { +// CHECK:STDOUT: %N.loc6_9.2 => constants.%.24 +// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%.24 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -906,9 +922,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self => constants.%C.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%.27) { -// CHECK:STDOUT: %N.loc6_9.2 => constants.%.27 -// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%.27 +// CHECK:STDOUT: specific @C(constants.%.28) { +// CHECK:STDOUT: %N.loc6_9.2 => constants.%.28 +// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%.28 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -919,9 +935,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self => constants.%C.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%.31) { -// CHECK:STDOUT: %N.loc6_9.2 => constants.%.31 -// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%.31 +// CHECK:STDOUT: specific @C(constants.%.32) { +// CHECK:STDOUT: %N.loc6_9.2 => constants.%.32 +// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%.32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -932,9 +948,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self => constants.%C.6 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%.35) { -// CHECK:STDOUT: %N.loc6_9.2 => constants.%.35 -// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%.35 +// CHECK:STDOUT: specific @C(constants.%.36) { +// CHECK:STDOUT: %N.loc6_9.2 => constants.%.36 +// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%.36 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -945,9 +961,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self => constants.%C.7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%.39) { -// CHECK:STDOUT: %N.loc6_9.2 => constants.%.39 -// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%.39 +// CHECK:STDOUT: specific @C(constants.%.40) { +// CHECK:STDOUT: %N.loc6_9.2 => constants.%.40 +// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%.40 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -958,9 +974,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self => constants.%C.8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%.43) { -// CHECK:STDOUT: %N.loc6_9.2 => constants.%.43 -// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%.43 +// CHECK:STDOUT: specific @C(constants.%.44) { +// CHECK:STDOUT: %N.loc6_9.2 => constants.%.44 +// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%.44 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -971,9 +987,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self => constants.%C.9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%.47) { -// CHECK:STDOUT: %N.loc6_9.2 => constants.%.47 -// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%.47 +// CHECK:STDOUT: specific @C(constants.%.48) { +// CHECK:STDOUT: %N.loc6_9.2 => constants.%.48 +// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%.48 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -987,18 +1003,20 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: --- user.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %F0.type: type = fn_type @F0 [template] // CHECK:STDOUT: %F0: %F0.type = struct_value () [template] -// CHECK:STDOUT: %.4: bool = bool_literal false [template] -// CHECK:STDOUT: %.5: type = struct_type {} [template] +// CHECK:STDOUT: %.5: bool = bool_literal false [template] +// CHECK:STDOUT: %.6: type = struct_type {} [template] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %N: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: %i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] @@ -1006,85 +1024,85 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%T) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.12 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.12 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.10: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.12 [template] -// CHECK:STDOUT: %.12: %.8 = assoc_entity element0, imports.%import_ref.13 [symbolic] +// CHECK:STDOUT: %.11: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.9 = assoc_entity element0, imports.%import_ref.13 [symbolic] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] -// CHECK:STDOUT: %.13: = interface_witness (%Convert.3) [template] -// CHECK:STDOUT: %.14: = bound_method %.7, %Convert.3 [template] -// CHECK:STDOUT: %.15: i32 = int_value 0 [template] -// CHECK:STDOUT: %C.3: type = class_type @C, @C(%.15) [template] +// CHECK:STDOUT: %.14: = interface_witness (%Convert.3) [template] +// CHECK:STDOUT: %.15: = bound_method %.8, %Convert.3 [template] +// CHECK:STDOUT: %.16: %i32 = int_value 0 [template] +// CHECK:STDOUT: %C.3: type = class_type @C, @C(%.16) [template] // CHECK:STDOUT: %struct.1: %C.3 = struct_value () [template] // CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%D)> [template] // CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.1, @ImplicitAs(%D) [template] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [template] -// CHECK:STDOUT: %.17: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.4 [template] -// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.12 [template] -// CHECK:STDOUT: %.19: i32 = int_value 1 [template] -// CHECK:STDOUT: %C.4: type = class_type @C, @C(%.19) [template] -// CHECK:STDOUT: %.20: i32 = int_value 2 [template] -// CHECK:STDOUT: %C.5: type = class_type @C, @C(%.20) [template] -// CHECK:STDOUT: %.21: i32 = int_value 3 [template] -// CHECK:STDOUT: %C.6: type = class_type @C, @C(%.21) [template] -// CHECK:STDOUT: %.22: i32 = int_value 4 [template] -// CHECK:STDOUT: %C.7: type = class_type @C, @C(%.22) [template] -// CHECK:STDOUT: %.23: i32 = int_value 5 [template] -// CHECK:STDOUT: %C.8: type = class_type @C, @C(%.23) [template] -// CHECK:STDOUT: %.24: i32 = int_value 6 [template] -// CHECK:STDOUT: %C.9: type = class_type @C, @C(%.24) [template] -// CHECK:STDOUT: %.25: i32 = int_value 7 [template] -// CHECK:STDOUT: %C.10: type = class_type @C, @C(%.25) [template] +// CHECK:STDOUT: %.18: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.4 [template] +// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.20: %i32 = int_value 1 [template] +// CHECK:STDOUT: %C.4: type = class_type @C, @C(%.20) [template] +// CHECK:STDOUT: %.21: %i32 = int_value 2 [template] +// CHECK:STDOUT: %C.5: type = class_type @C, @C(%.21) [template] +// CHECK:STDOUT: %.22: %i32 = int_value 3 [template] +// CHECK:STDOUT: %C.6: type = class_type @C, @C(%.22) [template] +// CHECK:STDOUT: %.23: %i32 = int_value 4 [template] +// CHECK:STDOUT: %C.7: type = class_type @C, @C(%.23) [template] +// CHECK:STDOUT: %.24: %i32 = int_value 5 [template] +// CHECK:STDOUT: %C.8: type = class_type @C, @C(%.24) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 6 [template] +// CHECK:STDOUT: %C.9: type = class_type @C, @C(%.25) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 7 [template] +// CHECK:STDOUT: %C.10: type = class_type @C, @C(%.26) [template] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.5) [template] -// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.28: = bound_method %.27, %Convert.3 [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.5) [template] +// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.29: = bound_method %.28, %Convert.3 [template] // CHECK:STDOUT: %struct.2: %C.4 = struct_value () [template] // CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4 [template] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.6) [template] -// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.31: = bound_method %.30, %Convert.3 [template] +// CHECK:STDOUT: %.30: = interface_witness (%Convert.6) [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.32: = bound_method %.31, %Convert.3 [template] // CHECK:STDOUT: %struct.3: %C.5 = struct_value () [template] // CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5 [template] // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [template] -// CHECK:STDOUT: %.32: = interface_witness (%Convert.7) [template] -// CHECK:STDOUT: %.33: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.34: = bound_method %.33, %Convert.3 [template] +// CHECK:STDOUT: %.33: = interface_witness (%Convert.7) [template] +// CHECK:STDOUT: %.34: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.35: = bound_method %.34, %Convert.3 [template] // CHECK:STDOUT: %struct.4: %C.6 = struct_value () [template] // CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6 [template] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [template] -// CHECK:STDOUT: %.35: = interface_witness (%Convert.8) [template] -// CHECK:STDOUT: %.36: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %.37: = bound_method %.36, %Convert.3 [template] +// CHECK:STDOUT: %.36: = interface_witness (%Convert.8) [template] +// CHECK:STDOUT: %.37: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.38: = bound_method %.37, %Convert.3 [template] // CHECK:STDOUT: %struct.5: %C.7 = struct_value () [template] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.7 [template] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %.38: = interface_witness (%Convert.9) [template] -// CHECK:STDOUT: %.39: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %.40: = bound_method %.39, %Convert.3 [template] +// CHECK:STDOUT: %.39: = interface_witness (%Convert.9) [template] +// CHECK:STDOUT: %.40: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.41: = bound_method %.40, %Convert.3 [template] // CHECK:STDOUT: %struct.6: %C.8 = struct_value () [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.8 [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %.41: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %.42: Core.IntLiteral = int_value 6 [template] -// CHECK:STDOUT: %.43: = bound_method %.42, %Convert.3 [template] +// CHECK:STDOUT: %.42: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %.43: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %.44: = bound_method %.43, %Convert.3 [template] // CHECK:STDOUT: %struct.7: %C.9 = struct_value () [template] // CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.9 [template] // CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %.44: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %.45: Core.IntLiteral = int_value 7 [template] -// CHECK:STDOUT: %.46: = bound_method %.45, %Convert.3 [template] +// CHECK:STDOUT: %.45: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %.46: Core.IntLiteral = int_value 7 [template] +// CHECK:STDOUT: %.47: = bound_method %.46, %Convert.3 [template] // CHECK:STDOUT: %struct.8: %C.10 = struct_value () [template] // CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10 [template] // CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %.47: = interface_witness (%Convert.12) [template] +// CHECK:STDOUT: %.48: = interface_witness (%Convert.12) [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] // CHECK:STDOUT: } @@ -1097,48 +1115,48 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: import P//library // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.8 // CHECK:STDOUT: import Core//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: type = import_ref P//library, inst+29, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.3 = import_ref P//library, inst+30, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref P//library, inst+35, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref P//library, inst+39, unloaded -// CHECK:STDOUT: %import_ref.6: %C.type = import_ref P//library, inst+20, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.7 = import_ref P//library, inst+25, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Core//default, inst+28, unloaded -// CHECK:STDOUT: %import_ref.10: @ImplicitAs.%.1 (%.8) = import_ref Core//default, inst+50, loaded [symbolic = @ImplicitAs.%.2 (constants.%.12)] -// CHECK:STDOUT: %import_ref.11 = import_ref Core//default, inst+43, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Core//default, inst+43, unloaded -// CHECK:STDOUT: %import_ref.14: type = import_ref Core//default, inst+61, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.15: type = import_ref Core//default, inst+66, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.16: = import_ref Core//default, inst+88, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.17: type = import_ref P//library, inst+144, loaded [template = constants.%C.3] -// CHECK:STDOUT: %import_ref.18: type = import_ref P//library, inst+149, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.19: = import_ref P//library, inst+169, loaded [template = constants.%.26] -// CHECK:STDOUT: %import_ref.20: type = import_ref P//library, inst+186, loaded [template = constants.%C.4] -// CHECK:STDOUT: %import_ref.21: type = import_ref P//library, inst+191, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.22: = import_ref P//library, inst+206, loaded [template = constants.%.29] -// CHECK:STDOUT: %import_ref.23: type = import_ref P//library, inst+222, loaded [template = constants.%C.5] -// CHECK:STDOUT: %import_ref.24: type = import_ref P//library, inst+227, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.25: = import_ref P//library, inst+242, loaded [template = constants.%.32] -// CHECK:STDOUT: %import_ref.26: type = import_ref P//library, inst+258, loaded [template = constants.%C.6] -// CHECK:STDOUT: %import_ref.27: type = import_ref P//library, inst+263, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.28: = import_ref P//library, inst+278, loaded [template = constants.%.35] -// CHECK:STDOUT: %import_ref.29: type = import_ref P//library, inst+294, loaded [template = constants.%C.7] -// CHECK:STDOUT: %import_ref.30: type = import_ref P//library, inst+299, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.31: = import_ref P//library, inst+314, loaded [template = constants.%.38] -// CHECK:STDOUT: %import_ref.32: type = import_ref P//library, inst+330, loaded [template = constants.%C.8] -// CHECK:STDOUT: %import_ref.33: type = import_ref P//library, inst+335, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.34: = import_ref P//library, inst+350, loaded [template = constants.%.41] -// CHECK:STDOUT: %import_ref.35: type = import_ref P//library, inst+366, loaded [template = constants.%C.9] -// CHECK:STDOUT: %import_ref.36: type = import_ref P//library, inst+371, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.37: = import_ref P//library, inst+386, loaded [template = constants.%.44] -// CHECK:STDOUT: %import_ref.38: type = import_ref P//library, inst+402, loaded [template = constants.%C.10] -// CHECK:STDOUT: %import_ref.39: type = import_ref P//library, inst+407, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.40: = import_ref P//library, inst+422, loaded [template = constants.%.47] -// CHECK:STDOUT: %import_ref.41: %Make.type = import_ref P//library, inst+48, loaded [template = constants.%Make] +// CHECK:STDOUT: %import_ref.2: type = import_ref P//library, inst+36, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.3 = import_ref P//library, inst+37, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref P//library, inst+43, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref P//library, inst+48, unloaded +// CHECK:STDOUT: %import_ref.6: %C.type = import_ref P//library, inst+27, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.7 = import_ref P//library, inst+32, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Core//default, inst+36, unloaded +// CHECK:STDOUT: %import_ref.10: @ImplicitAs.%.1 (%.9) = import_ref Core//default, inst+58, loaded [symbolic = @ImplicitAs.%.2 (constants.%.13)] +// CHECK:STDOUT: %import_ref.11 = import_ref Core//default, inst+51, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Core//default, inst+51, unloaded +// CHECK:STDOUT: %import_ref.14: type = import_ref Core//default, inst+69, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//default, inst+77, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.16: = import_ref Core//default, inst+100, loaded [template = constants.%.14] +// CHECK:STDOUT: %import_ref.17: type = import_ref P//library, inst+153, loaded [template = constants.%C.3] +// CHECK:STDOUT: %import_ref.18: type = import_ref P//library, inst+158, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.19: = import_ref P//library, inst+178, loaded [template = constants.%.27] +// CHECK:STDOUT: %import_ref.20: type = import_ref P//library, inst+195, loaded [template = constants.%C.4] +// CHECK:STDOUT: %import_ref.21: type = import_ref P//library, inst+200, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.22: = import_ref P//library, inst+215, loaded [template = constants.%.30] +// CHECK:STDOUT: %import_ref.23: type = import_ref P//library, inst+231, loaded [template = constants.%C.5] +// CHECK:STDOUT: %import_ref.24: type = import_ref P//library, inst+236, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.25: = import_ref P//library, inst+251, loaded [template = constants.%.33] +// CHECK:STDOUT: %import_ref.26: type = import_ref P//library, inst+267, loaded [template = constants.%C.6] +// CHECK:STDOUT: %import_ref.27: type = import_ref P//library, inst+272, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.28: = import_ref P//library, inst+287, loaded [template = constants.%.36] +// CHECK:STDOUT: %import_ref.29: type = import_ref P//library, inst+303, loaded [template = constants.%C.7] +// CHECK:STDOUT: %import_ref.30: type = import_ref P//library, inst+308, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.31: = import_ref P//library, inst+323, loaded [template = constants.%.39] +// CHECK:STDOUT: %import_ref.32: type = import_ref P//library, inst+339, loaded [template = constants.%C.8] +// CHECK:STDOUT: %import_ref.33: type = import_ref P//library, inst+344, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.34: = import_ref P//library, inst+359, loaded [template = constants.%.42] +// CHECK:STDOUT: %import_ref.35: type = import_ref P//library, inst+375, loaded [template = constants.%C.9] +// CHECK:STDOUT: %import_ref.36: type = import_ref P//library, inst+380, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.37: = import_ref P//library, inst+395, loaded [template = constants.%.45] +// CHECK:STDOUT: %import_ref.38: type = import_ref P//library, inst+411, loaded [template = constants.%C.10] +// CHECK:STDOUT: %import_ref.39: type = import_ref P//library, inst+416, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.40: = import_ref P//library, inst+431, loaded [template = constants.%.48] +// CHECK:STDOUT: %import_ref.41: %Make.type = import_ref P//library, inst+57, loaded [template = constants.%Make] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1150,18 +1168,19 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %P.import = import P // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F0.decl: %F0.type = fn_decl @F0 [template = constants.%F0] { -// CHECK:STDOUT: %n.patt: i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %D = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %D = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc7_10.2: type = converted %int.make_type_32, %.loc7_10.1 [template = i32] +// CHECK:STDOUT: %.loc7_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc7_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc7_10.3: type = converted %int.make_type_signed, %.loc7_10.2 [template = constants.%i32] // CHECK:STDOUT: %P.ref.loc7: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%D] -// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: i32 = bind_name n, %n.param +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } @@ -1176,8 +1195,8 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%T) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.8)] -// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.8) = assoc_entity element0, imports.%import_ref.12 [symbolic = %.2 (constants.%.9)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.9) = assoc_entity element0, imports.%import_ref.12 [symbolic = %.2 (constants.%.10)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -1239,9 +1258,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: .m = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%N: i32) { -// CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: generic class @C(constants.%N: %i32) { +// CHECK:STDOUT: %N: %i32 = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -1251,29 +1270,29 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; +// CHECK:STDOUT: fn @Int(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F0(%n.param_patt: i32) -> %return: %D { +// CHECK:STDOUT: fn @F0(%n.param_patt: %i32) -> %return: %D { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc8_7: bool = bool_literal false [template = constants.%.4] +// CHECK:STDOUT: %.loc8_7: bool = bool_literal false [template = constants.%.5] // CHECK:STDOUT: if %.loc8_7 br !if.then.loc8 else br !if.else.loc8 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc8: -// CHECK:STDOUT: %.loc8_24.1: %.5 = struct_literal () +// CHECK:STDOUT: %.loc8_24.1: %.6 = struct_literal () // CHECK:STDOUT: %P.ref.loc8: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %C.ref.loc8: %C.type = name_ref C, imports.%import_ref.6 [template = constants.%C.1] -// CHECK:STDOUT: %.loc8_33: Core.IntLiteral = int_value 0 [template = constants.%.7] -// CHECK:STDOUT: %.loc8_32.1: %Convert.type.2 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc8_32.2: = bound_method %.loc8_33, %.loc8_32.1 [template = constants.%.14] -// CHECK:STDOUT: %int.convert_checked.loc8: init i32 = call %.loc8_32.2(%.loc8_33) [template = constants.%.15] -// CHECK:STDOUT: %.loc8_32.3: i32 = value_of_initializer %int.convert_checked.loc8 [template = constants.%.15] -// CHECK:STDOUT: %.loc8_32.4: i32 = converted %.loc8_33, %.loc8_32.3 [template = constants.%.15] -// CHECK:STDOUT: %C.loc8: type = class_type @C, @C(constants.%.15) [template = constants.%C.3] +// CHECK:STDOUT: %.loc8_33: Core.IntLiteral = int_value 0 [template = constants.%.8] +// CHECK:STDOUT: %.loc8_32.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc8_32.2: = bound_method %.loc8_33, %.loc8_32.1 [template = constants.%.15] +// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %.loc8_32.2(%.loc8_33) [template = constants.%.16] +// CHECK:STDOUT: %.loc8_32.3: %i32 = value_of_initializer %int.convert_checked.loc8 [template = constants.%.16] +// CHECK:STDOUT: %.loc8_32.4: %i32 = converted %.loc8_33, %.loc8_32.3 [template = constants.%.16] +// CHECK:STDOUT: %C.loc8: type = class_type @C, @C(constants.%.16) [template = constants.%C.3] // CHECK:STDOUT: %.loc8_24.2: ref %C.3 = temporary_storage // CHECK:STDOUT: %.loc8_24.3: init %C.3 = class_init (), %.loc8_24.2 [template = constants.%struct.1] // CHECK:STDOUT: %.loc8_24.4: ref %C.3 = temporary %.loc8_24.2, %.loc8_24.3 // CHECK:STDOUT: %.loc8_26.1: ref %C.3 = converted %.loc8_24.1, %.loc8_24.4 -// CHECK:STDOUT: %.loc8_35.1: %Convert.type.4 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.5] +// CHECK:STDOUT: %.loc8_35.1: %Convert.type.4 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.5] // CHECK:STDOUT: %.loc8_35.2: = bound_method %.loc8_26.1, %.loc8_35.1 // CHECK:STDOUT: %.loc8_35.3: ref %D = temporary_storage // CHECK:STDOUT: %.loc8_26.2: %C.3 = bind_value %.loc8_26.1 @@ -1282,25 +1301,25 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: return %.loc8_35.4 to %return // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc8: -// CHECK:STDOUT: %.loc9_7: bool = bool_literal false [template = constants.%.4] +// CHECK:STDOUT: %.loc9_7: bool = bool_literal false [template = constants.%.5] // CHECK:STDOUT: if %.loc9_7 br !if.then.loc9 else br !if.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc9: -// CHECK:STDOUT: %.loc9_24.1: %.5 = struct_literal () +// CHECK:STDOUT: %.loc9_24.1: %.6 = struct_literal () // CHECK:STDOUT: %P.ref.loc9: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %C.ref.loc9: %C.type = name_ref C, imports.%import_ref.6 [template = constants.%C.1] -// CHECK:STDOUT: %.loc9_33: Core.IntLiteral = int_value 1 [template = constants.%.27] -// CHECK:STDOUT: %.loc9_32.1: %Convert.type.2 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc9_32.2: = bound_method %.loc9_33, %.loc9_32.1 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc9: init i32 = call %.loc9_32.2(%.loc9_33) [template = constants.%.19] -// CHECK:STDOUT: %.loc9_32.3: i32 = value_of_initializer %int.convert_checked.loc9 [template = constants.%.19] -// CHECK:STDOUT: %.loc9_32.4: i32 = converted %.loc9_33, %.loc9_32.3 [template = constants.%.19] -// CHECK:STDOUT: %C.loc9: type = class_type @C, @C(constants.%.19) [template = constants.%C.4] +// CHECK:STDOUT: %.loc9_33: Core.IntLiteral = int_value 1 [template = constants.%.28] +// CHECK:STDOUT: %.loc9_32.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc9_32.2: = bound_method %.loc9_33, %.loc9_32.1 [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %.loc9_32.2(%.loc9_33) [template = constants.%.20] +// CHECK:STDOUT: %.loc9_32.3: %i32 = value_of_initializer %int.convert_checked.loc9 [template = constants.%.20] +// CHECK:STDOUT: %.loc9_32.4: %i32 = converted %.loc9_33, %.loc9_32.3 [template = constants.%.20] +// CHECK:STDOUT: %C.loc9: type = class_type @C, @C(constants.%.20) [template = constants.%C.4] // CHECK:STDOUT: %.loc9_24.2: ref %C.4 = temporary_storage // CHECK:STDOUT: %.loc9_24.3: init %C.4 = class_init (), %.loc9_24.2 [template = constants.%struct.2] // CHECK:STDOUT: %.loc9_24.4: ref %C.4 = temporary %.loc9_24.2, %.loc9_24.3 // CHECK:STDOUT: %.loc9_26.1: ref %C.4 = converted %.loc9_24.1, %.loc9_24.4 -// CHECK:STDOUT: %.loc9_35.1: %Convert.type.4 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.6] +// CHECK:STDOUT: %.loc9_35.1: %Convert.type.4 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.6] // CHECK:STDOUT: %.loc9_35.2: = bound_method %.loc9_26.1, %.loc9_35.1 // CHECK:STDOUT: %.loc9_35.3: ref %D = temporary_storage // CHECK:STDOUT: %.loc9_26.2: %C.4 = bind_value %.loc9_26.1 @@ -1309,25 +1328,25 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: return %.loc9_35.4 to %return // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc9: -// CHECK:STDOUT: %.loc10_7: bool = bool_literal false [template = constants.%.4] +// CHECK:STDOUT: %.loc10_7: bool = bool_literal false [template = constants.%.5] // CHECK:STDOUT: if %.loc10_7 br !if.then.loc10 else br !if.else.loc10 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc10: -// CHECK:STDOUT: %.loc10_24.1: %.5 = struct_literal () +// CHECK:STDOUT: %.loc10_24.1: %.6 = struct_literal () // CHECK:STDOUT: %P.ref.loc10: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %C.ref.loc10: %C.type = name_ref C, imports.%import_ref.6 [template = constants.%C.1] -// CHECK:STDOUT: %.loc10_33: Core.IntLiteral = int_value 2 [template = constants.%.30] -// CHECK:STDOUT: %.loc10_32.1: %Convert.type.2 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc10_32.2: = bound_method %.loc10_33, %.loc10_32.1 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked.loc10: init i32 = call %.loc10_32.2(%.loc10_33) [template = constants.%.20] -// CHECK:STDOUT: %.loc10_32.3: i32 = value_of_initializer %int.convert_checked.loc10 [template = constants.%.20] -// CHECK:STDOUT: %.loc10_32.4: i32 = converted %.loc10_33, %.loc10_32.3 [template = constants.%.20] -// CHECK:STDOUT: %C.loc10: type = class_type @C, @C(constants.%.20) [template = constants.%C.5] +// CHECK:STDOUT: %.loc10_33: Core.IntLiteral = int_value 2 [template = constants.%.31] +// CHECK:STDOUT: %.loc10_32.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc10_32.2: = bound_method %.loc10_33, %.loc10_32.1 [template = constants.%.32] +// CHECK:STDOUT: %int.convert_checked.loc10: init %i32 = call %.loc10_32.2(%.loc10_33) [template = constants.%.21] +// CHECK:STDOUT: %.loc10_32.3: %i32 = value_of_initializer %int.convert_checked.loc10 [template = constants.%.21] +// CHECK:STDOUT: %.loc10_32.4: %i32 = converted %.loc10_33, %.loc10_32.3 [template = constants.%.21] +// CHECK:STDOUT: %C.loc10: type = class_type @C, @C(constants.%.21) [template = constants.%C.5] // CHECK:STDOUT: %.loc10_24.2: ref %C.5 = temporary_storage // CHECK:STDOUT: %.loc10_24.3: init %C.5 = class_init (), %.loc10_24.2 [template = constants.%struct.3] // CHECK:STDOUT: %.loc10_24.4: ref %C.5 = temporary %.loc10_24.2, %.loc10_24.3 // CHECK:STDOUT: %.loc10_26.1: ref %C.5 = converted %.loc10_24.1, %.loc10_24.4 -// CHECK:STDOUT: %.loc10_35.1: %Convert.type.4 = interface_witness_access constants.%.32, element0 [template = constants.%Convert.7] +// CHECK:STDOUT: %.loc10_35.1: %Convert.type.4 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.7] // CHECK:STDOUT: %.loc10_35.2: = bound_method %.loc10_26.1, %.loc10_35.1 // CHECK:STDOUT: %.loc10_35.3: ref %D = temporary_storage // CHECK:STDOUT: %.loc10_26.2: %C.5 = bind_value %.loc10_26.1 @@ -1336,25 +1355,25 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: return %.loc10_35.4 to %return // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc10: -// CHECK:STDOUT: %.loc11_7: bool = bool_literal false [template = constants.%.4] +// CHECK:STDOUT: %.loc11_7: bool = bool_literal false [template = constants.%.5] // CHECK:STDOUT: if %.loc11_7 br !if.then.loc11 else br !if.else.loc11 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc11: -// CHECK:STDOUT: %.loc11_24.1: %.5 = struct_literal () +// CHECK:STDOUT: %.loc11_24.1: %.6 = struct_literal () // CHECK:STDOUT: %P.ref.loc11: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %C.ref.loc11: %C.type = name_ref C, imports.%import_ref.6 [template = constants.%C.1] -// CHECK:STDOUT: %.loc11_33: Core.IntLiteral = int_value 3 [template = constants.%.33] -// CHECK:STDOUT: %.loc11_32.1: %Convert.type.2 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc11_32.2: = bound_method %.loc11_33, %.loc11_32.1 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc11: init i32 = call %.loc11_32.2(%.loc11_33) [template = constants.%.21] -// CHECK:STDOUT: %.loc11_32.3: i32 = value_of_initializer %int.convert_checked.loc11 [template = constants.%.21] -// CHECK:STDOUT: %.loc11_32.4: i32 = converted %.loc11_33, %.loc11_32.3 [template = constants.%.21] -// CHECK:STDOUT: %C.loc11: type = class_type @C, @C(constants.%.21) [template = constants.%C.6] +// CHECK:STDOUT: %.loc11_33: Core.IntLiteral = int_value 3 [template = constants.%.34] +// CHECK:STDOUT: %.loc11_32.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc11_32.2: = bound_method %.loc11_33, %.loc11_32.1 [template = constants.%.35] +// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %.loc11_32.2(%.loc11_33) [template = constants.%.22] +// CHECK:STDOUT: %.loc11_32.3: %i32 = value_of_initializer %int.convert_checked.loc11 [template = constants.%.22] +// CHECK:STDOUT: %.loc11_32.4: %i32 = converted %.loc11_33, %.loc11_32.3 [template = constants.%.22] +// CHECK:STDOUT: %C.loc11: type = class_type @C, @C(constants.%.22) [template = constants.%C.6] // CHECK:STDOUT: %.loc11_24.2: ref %C.6 = temporary_storage // CHECK:STDOUT: %.loc11_24.3: init %C.6 = class_init (), %.loc11_24.2 [template = constants.%struct.4] // CHECK:STDOUT: %.loc11_24.4: ref %C.6 = temporary %.loc11_24.2, %.loc11_24.3 // CHECK:STDOUT: %.loc11_26.1: ref %C.6 = converted %.loc11_24.1, %.loc11_24.4 -// CHECK:STDOUT: %.loc11_35.1: %Convert.type.4 = interface_witness_access constants.%.35, element0 [template = constants.%Convert.8] +// CHECK:STDOUT: %.loc11_35.1: %Convert.type.4 = interface_witness_access constants.%.36, element0 [template = constants.%Convert.8] // CHECK:STDOUT: %.loc11_35.2: = bound_method %.loc11_26.1, %.loc11_35.1 // CHECK:STDOUT: %.loc11_35.3: ref %D = temporary_storage // CHECK:STDOUT: %.loc11_26.2: %C.6 = bind_value %.loc11_26.1 @@ -1363,25 +1382,25 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: return %.loc11_35.4 to %return // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc11: -// CHECK:STDOUT: %.loc12_7: bool = bool_literal false [template = constants.%.4] +// CHECK:STDOUT: %.loc12_7: bool = bool_literal false [template = constants.%.5] // CHECK:STDOUT: if %.loc12_7 br !if.then.loc12 else br !if.else.loc12 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc12: -// CHECK:STDOUT: %.loc12_24.1: %.5 = struct_literal () +// CHECK:STDOUT: %.loc12_24.1: %.6 = struct_literal () // CHECK:STDOUT: %P.ref.loc12: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %C.ref.loc12: %C.type = name_ref C, imports.%import_ref.6 [template = constants.%C.1] -// CHECK:STDOUT: %.loc12_33: Core.IntLiteral = int_value 4 [template = constants.%.36] -// CHECK:STDOUT: %.loc12_32.1: %Convert.type.2 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc12_32.2: = bound_method %.loc12_33, %.loc12_32.1 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked.loc12: init i32 = call %.loc12_32.2(%.loc12_33) [template = constants.%.22] -// CHECK:STDOUT: %.loc12_32.3: i32 = value_of_initializer %int.convert_checked.loc12 [template = constants.%.22] -// CHECK:STDOUT: %.loc12_32.4: i32 = converted %.loc12_33, %.loc12_32.3 [template = constants.%.22] -// CHECK:STDOUT: %C.loc12: type = class_type @C, @C(constants.%.22) [template = constants.%C.7] +// CHECK:STDOUT: %.loc12_33: Core.IntLiteral = int_value 4 [template = constants.%.37] +// CHECK:STDOUT: %.loc12_32.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc12_32.2: = bound_method %.loc12_33, %.loc12_32.1 [template = constants.%.38] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %.loc12_32.2(%.loc12_33) [template = constants.%.23] +// CHECK:STDOUT: %.loc12_32.3: %i32 = value_of_initializer %int.convert_checked.loc12 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_32.4: %i32 = converted %.loc12_33, %.loc12_32.3 [template = constants.%.23] +// CHECK:STDOUT: %C.loc12: type = class_type @C, @C(constants.%.23) [template = constants.%C.7] // CHECK:STDOUT: %.loc12_24.2: ref %C.7 = temporary_storage // CHECK:STDOUT: %.loc12_24.3: init %C.7 = class_init (), %.loc12_24.2 [template = constants.%struct.5] // CHECK:STDOUT: %.loc12_24.4: ref %C.7 = temporary %.loc12_24.2, %.loc12_24.3 // CHECK:STDOUT: %.loc12_26.1: ref %C.7 = converted %.loc12_24.1, %.loc12_24.4 -// CHECK:STDOUT: %.loc12_35.1: %Convert.type.4 = interface_witness_access constants.%.38, element0 [template = constants.%Convert.9] +// CHECK:STDOUT: %.loc12_35.1: %Convert.type.4 = interface_witness_access constants.%.39, element0 [template = constants.%Convert.9] // CHECK:STDOUT: %.loc12_35.2: = bound_method %.loc12_26.1, %.loc12_35.1 // CHECK:STDOUT: %.loc12_35.3: ref %D = temporary_storage // CHECK:STDOUT: %.loc12_26.2: %C.7 = bind_value %.loc12_26.1 @@ -1390,25 +1409,25 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: return %.loc12_35.4 to %return // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc12: -// CHECK:STDOUT: %.loc13_7: bool = bool_literal false [template = constants.%.4] +// CHECK:STDOUT: %.loc13_7: bool = bool_literal false [template = constants.%.5] // CHECK:STDOUT: if %.loc13_7 br !if.then.loc13 else br !if.else.loc13 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc13: -// CHECK:STDOUT: %.loc13_24.1: %.5 = struct_literal () +// CHECK:STDOUT: %.loc13_24.1: %.6 = struct_literal () // CHECK:STDOUT: %P.ref.loc13: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %C.ref.loc13: %C.type = name_ref C, imports.%import_ref.6 [template = constants.%C.1] -// CHECK:STDOUT: %.loc13_33: Core.IntLiteral = int_value 5 [template = constants.%.39] -// CHECK:STDOUT: %.loc13_32.1: %Convert.type.2 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc13_32.2: = bound_method %.loc13_33, %.loc13_32.1 [template = constants.%.40] -// CHECK:STDOUT: %int.convert_checked.loc13: init i32 = call %.loc13_32.2(%.loc13_33) [template = constants.%.23] -// CHECK:STDOUT: %.loc13_32.3: i32 = value_of_initializer %int.convert_checked.loc13 [template = constants.%.23] -// CHECK:STDOUT: %.loc13_32.4: i32 = converted %.loc13_33, %.loc13_32.3 [template = constants.%.23] -// CHECK:STDOUT: %C.loc13: type = class_type @C, @C(constants.%.23) [template = constants.%C.8] +// CHECK:STDOUT: %.loc13_33: Core.IntLiteral = int_value 5 [template = constants.%.40] +// CHECK:STDOUT: %.loc13_32.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc13_32.2: = bound_method %.loc13_33, %.loc13_32.1 [template = constants.%.41] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %.loc13_32.2(%.loc13_33) [template = constants.%.24] +// CHECK:STDOUT: %.loc13_32.3: %i32 = value_of_initializer %int.convert_checked.loc13 [template = constants.%.24] +// CHECK:STDOUT: %.loc13_32.4: %i32 = converted %.loc13_33, %.loc13_32.3 [template = constants.%.24] +// CHECK:STDOUT: %C.loc13: type = class_type @C, @C(constants.%.24) [template = constants.%C.8] // CHECK:STDOUT: %.loc13_24.2: ref %C.8 = temporary_storage // CHECK:STDOUT: %.loc13_24.3: init %C.8 = class_init (), %.loc13_24.2 [template = constants.%struct.6] // CHECK:STDOUT: %.loc13_24.4: ref %C.8 = temporary %.loc13_24.2, %.loc13_24.3 // CHECK:STDOUT: %.loc13_26.1: ref %C.8 = converted %.loc13_24.1, %.loc13_24.4 -// CHECK:STDOUT: %.loc13_35.1: %Convert.type.4 = interface_witness_access constants.%.41, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %.loc13_35.1: %Convert.type.4 = interface_witness_access constants.%.42, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %.loc13_35.2: = bound_method %.loc13_26.1, %.loc13_35.1 // CHECK:STDOUT: %.loc13_35.3: ref %D = temporary_storage // CHECK:STDOUT: %.loc13_26.2: %C.8 = bind_value %.loc13_26.1 @@ -1417,25 +1436,25 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: return %.loc13_35.4 to %return // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc13: -// CHECK:STDOUT: %.loc14_7: bool = bool_literal false [template = constants.%.4] +// CHECK:STDOUT: %.loc14_7: bool = bool_literal false [template = constants.%.5] // CHECK:STDOUT: if %.loc14_7 br !if.then.loc14 else br !if.else.loc14 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc14: -// CHECK:STDOUT: %.loc14_24.1: %.5 = struct_literal () +// CHECK:STDOUT: %.loc14_24.1: %.6 = struct_literal () // CHECK:STDOUT: %P.ref.loc14: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %C.ref.loc14: %C.type = name_ref C, imports.%import_ref.6 [template = constants.%C.1] -// CHECK:STDOUT: %.loc14_33: Core.IntLiteral = int_value 6 [template = constants.%.42] -// CHECK:STDOUT: %.loc14_32.1: %Convert.type.2 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc14_32.2: = bound_method %.loc14_33, %.loc14_32.1 [template = constants.%.43] -// CHECK:STDOUT: %int.convert_checked.loc14: init i32 = call %.loc14_32.2(%.loc14_33) [template = constants.%.24] -// CHECK:STDOUT: %.loc14_32.3: i32 = value_of_initializer %int.convert_checked.loc14 [template = constants.%.24] -// CHECK:STDOUT: %.loc14_32.4: i32 = converted %.loc14_33, %.loc14_32.3 [template = constants.%.24] -// CHECK:STDOUT: %C.loc14: type = class_type @C, @C(constants.%.24) [template = constants.%C.9] +// CHECK:STDOUT: %.loc14_33: Core.IntLiteral = int_value 6 [template = constants.%.43] +// CHECK:STDOUT: %.loc14_32.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc14_32.2: = bound_method %.loc14_33, %.loc14_32.1 [template = constants.%.44] +// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %.loc14_32.2(%.loc14_33) [template = constants.%.25] +// CHECK:STDOUT: %.loc14_32.3: %i32 = value_of_initializer %int.convert_checked.loc14 [template = constants.%.25] +// CHECK:STDOUT: %.loc14_32.4: %i32 = converted %.loc14_33, %.loc14_32.3 [template = constants.%.25] +// CHECK:STDOUT: %C.loc14: type = class_type @C, @C(constants.%.25) [template = constants.%C.9] // CHECK:STDOUT: %.loc14_24.2: ref %C.9 = temporary_storage // CHECK:STDOUT: %.loc14_24.3: init %C.9 = class_init (), %.loc14_24.2 [template = constants.%struct.7] // CHECK:STDOUT: %.loc14_24.4: ref %C.9 = temporary %.loc14_24.2, %.loc14_24.3 // CHECK:STDOUT: %.loc14_26.1: ref %C.9 = converted %.loc14_24.1, %.loc14_24.4 -// CHECK:STDOUT: %.loc14_35.1: %Convert.type.4 = interface_witness_access constants.%.44, element0 [template = constants.%Convert.11] +// CHECK:STDOUT: %.loc14_35.1: %Convert.type.4 = interface_witness_access constants.%.45, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %.loc14_35.2: = bound_method %.loc14_26.1, %.loc14_35.1 // CHECK:STDOUT: %.loc14_35.3: ref %D = temporary_storage // CHECK:STDOUT: %.loc14_26.2: %C.9 = bind_value %.loc14_26.1 @@ -1444,25 +1463,25 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: return %.loc14_35.4 to %return // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc14: -// CHECK:STDOUT: %.loc15_7: bool = bool_literal false [template = constants.%.4] +// CHECK:STDOUT: %.loc15_7: bool = bool_literal false [template = constants.%.5] // CHECK:STDOUT: if %.loc15_7 br !if.then.loc15 else br !if.else.loc15 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc15: -// CHECK:STDOUT: %.loc15_24.1: %.5 = struct_literal () +// CHECK:STDOUT: %.loc15_24.1: %.6 = struct_literal () // CHECK:STDOUT: %P.ref.loc15: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %C.ref.loc15: %C.type = name_ref C, imports.%import_ref.6 [template = constants.%C.1] -// CHECK:STDOUT: %.loc15_33: Core.IntLiteral = int_value 7 [template = constants.%.45] -// CHECK:STDOUT: %.loc15_32.1: %Convert.type.2 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.3] -// CHECK:STDOUT: %.loc15_32.2: = bound_method %.loc15_33, %.loc15_32.1 [template = constants.%.46] -// CHECK:STDOUT: %int.convert_checked.loc15: init i32 = call %.loc15_32.2(%.loc15_33) [template = constants.%.25] -// CHECK:STDOUT: %.loc15_32.3: i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%.25] -// CHECK:STDOUT: %.loc15_32.4: i32 = converted %.loc15_33, %.loc15_32.3 [template = constants.%.25] -// CHECK:STDOUT: %C.loc15: type = class_type @C, @C(constants.%.25) [template = constants.%C.10] +// CHECK:STDOUT: %.loc15_33: Core.IntLiteral = int_value 7 [template = constants.%.46] +// CHECK:STDOUT: %.loc15_32.1: %Convert.type.2 = interface_witness_access constants.%.14, element0 [template = constants.%Convert.3] +// CHECK:STDOUT: %.loc15_32.2: = bound_method %.loc15_33, %.loc15_32.1 [template = constants.%.47] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %.loc15_32.2(%.loc15_33) [template = constants.%.26] +// CHECK:STDOUT: %.loc15_32.3: %i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%.26] +// CHECK:STDOUT: %.loc15_32.4: %i32 = converted %.loc15_33, %.loc15_32.3 [template = constants.%.26] +// CHECK:STDOUT: %C.loc15: type = class_type @C, @C(constants.%.26) [template = constants.%C.10] // CHECK:STDOUT: %.loc15_24.2: ref %C.10 = temporary_storage // CHECK:STDOUT: %.loc15_24.3: init %C.10 = class_init (), %.loc15_24.2 [template = constants.%struct.8] // CHECK:STDOUT: %.loc15_24.4: ref %C.10 = temporary %.loc15_24.2, %.loc15_24.3 // CHECK:STDOUT: %.loc15_26.1: ref %C.10 = converted %.loc15_24.1, %.loc15_24.4 -// CHECK:STDOUT: %.loc15_35.1: %Convert.type.4 = interface_witness_access constants.%.47, element0 [template = constants.%Convert.12] +// CHECK:STDOUT: %.loc15_35.1: %Convert.type.4 = interface_witness_access constants.%.48, element0 [template = constants.%Convert.12] // CHECK:STDOUT: %.loc15_35.2: = bound_method %.loc15_26.1, %.loc15_35.1 // CHECK:STDOUT: %.loc15_35.3: ref %D = temporary_storage // CHECK:STDOUT: %.loc15_26.2: %C.10 = bind_value %.loc15_26.1 @@ -1486,7 +1505,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.2[%self.param_patt: Core.IntLiteral]() -> i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @Convert.2[%self.param_patt: Core.IntLiteral]() -> %i32 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Convert.3[%self.param_patt: %C.3]() -> %D; // CHECK:STDOUT: @@ -1532,22 +1551,22 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(i32) { -// CHECK:STDOUT: %T => i32 -// CHECK:STDOUT: %T.patt => i32 +// CHECK:STDOUT: specific @ImplicitAs(constants.%i32) { +// CHECK:STDOUT: %T => constants.%i32 +// CHECK:STDOUT: %T.patt => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.1 => constants.%.10 -// CHECK:STDOUT: %.2 => constants.%.11 +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %.2 => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%.15) { -// CHECK:STDOUT: %N => constants.%.15 -// CHECK:STDOUT: %N.patt => constants.%.15 +// CHECK:STDOUT: specific @C(constants.%.16) { +// CHECK:STDOUT: %N => constants.%.16 +// CHECK:STDOUT: %N.patt => constants.%.16 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -1561,15 +1580,8 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.4 // CHECK:STDOUT: %Convert => constants.%Convert.4 -// CHECK:STDOUT: %.1 => constants.%.17 -// CHECK:STDOUT: %.2 => constants.%.18 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%.19) { -// CHECK:STDOUT: %N => constants.%.19 -// CHECK:STDOUT: %N.patt => constants.%.19 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %.1 => constants.%.18 +// CHECK:STDOUT: %.2 => constants.%.19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%.20) { @@ -1614,3 +1626,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @C(constants.%.26) { +// CHECK:STDOUT: %N => constants.%.26 +// CHECK:STDOUT: %N.patt => constants.%.26 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index 2478082e712e..882fa25368f6 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -27,35 +27,40 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = unbound_element_type %C, i32 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = unbound_element_type %C, %i32 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.7: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.32: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 1 [template] -// CHECK:STDOUT: %.34: = bound_method %.6, %Convert.15 [template] -// CHECK:STDOUT: %.35: i32 = int_value 2 [template] -// CHECK:STDOUT: %struct: %C = struct_value (%.33, %.35) [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.8: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.28: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.29: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.30: = specific_function %.29, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.31: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.32: = bound_method %.7, %Convert.14 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 2 [template] +// CHECK:STDOUT: %struct: %C = struct_value (%.31, %.34) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.36: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.37: = bound_method %.36, %Convert.15 [template] -// CHECK:STDOUT: %.38: i32 = int_value 0 [template] +// CHECK:STDOUT: %.35: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.36: = bound_method %.35, %Convert.14 [template] +// CHECK:STDOUT: %.37: = specific_function %.36, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.38: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -80,27 +85,30 @@ fn G() -> i32 { // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] -// CHECK:STDOUT: %.loc21_11.2: type = converted %int.make_type_32.loc21, %.loc21_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc21_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%.loc21_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_11.2: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_11.3: type = converted %int.make_type_signed.loc21, %.loc21_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32] -// CHECK:STDOUT: %.loc12_8: %.1 = field_decl a, element0 [template] -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] -// CHECK:STDOUT: %.loc13_8: %.1 = field_decl b, element1 [template] -// CHECK:STDOUT: %.loc14: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_10.3: type = converted %int.make_type_signed.loc12, %.loc12_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc13_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_10.3: type = converted %int.make_type_signed.loc13, %.loc13_10.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -112,41 +120,45 @@ fn G() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %result: ref %C = bind_name result, %return -// CHECK:STDOUT: %.loc17_34: Core.IntLiteral = int_value 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc17_42: Core.IntLiteral = int_value 2 [template = constants.%.6] -// CHECK:STDOUT: %.loc17_43.1: %.7 = struct_literal (%.loc17_34, %.loc17_42) -// CHECK:STDOUT: %.loc17_43.2: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc17_43.3: = bound_method %.loc17_34, %.loc17_43.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc17_43.1: init i32 = call %.loc17_43.3(%.loc17_34) [template = constants.%.33] -// CHECK:STDOUT: %.loc17_43.4: init i32 = converted %.loc17_34, %int.convert_checked.loc17_43.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc17_43.5: ref i32 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc17_43.6: init i32 = initialize_from %.loc17_43.4 to %.loc17_43.5 [template = constants.%.33] -// CHECK:STDOUT: %.loc17_43.7: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc17_43.8: = bound_method %.loc17_42, %.loc17_43.7 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc17_43.2: init i32 = call %.loc17_43.8(%.loc17_42) [template = constants.%.35] -// CHECK:STDOUT: %.loc17_43.9: init i32 = converted %.loc17_42, %int.convert_checked.loc17_43.2 [template = constants.%.35] -// CHECK:STDOUT: %.loc17_43.10: ref i32 = class_element_access %return, element1 -// CHECK:STDOUT: %.loc17_43.11: init i32 = initialize_from %.loc17_43.9 to %.loc17_43.10 [template = constants.%.35] -// CHECK:STDOUT: %.loc17_43.12: init %C = class_init (%.loc17_43.6, %.loc17_43.11), %return [template = constants.%struct] -// CHECK:STDOUT: %.loc17_44: init %C = converted %.loc17_43.1, %.loc17_43.12 [template = constants.%struct] +// CHECK:STDOUT: %.loc17_34: Core.IntLiteral = int_value 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc17_42: Core.IntLiteral = int_value 2 [template = constants.%.7] +// CHECK:STDOUT: %.loc17_43.1: %.8 = struct_literal (%.loc17_34, %.loc17_42) +// CHECK:STDOUT: %.loc17_43.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc17_43.3: = bound_method %.loc17_34, %.loc17_43.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc17_43.4: = specific_function %.loc17_43.3, @Convert.2(constants.%.1) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc17_43.1: init %i32 = call %.loc17_43.4(%.loc17_34) [template = constants.%.31] +// CHECK:STDOUT: %.loc17_43.5: init %i32 = converted %.loc17_34, %int.convert_checked.loc17_43.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc17_43.6: ref %i32 = class_element_access %return, element0 +// CHECK:STDOUT: %.loc17_43.7: init %i32 = initialize_from %.loc17_43.5 to %.loc17_43.6 [template = constants.%.31] +// CHECK:STDOUT: %.loc17_43.8: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc17_43.9: = bound_method %.loc17_42, %.loc17_43.8 [template = constants.%.32] +// CHECK:STDOUT: %.loc17_43.10: = specific_function %.loc17_43.9, @Convert.2(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc17_43.2: init %i32 = call %.loc17_43.10(%.loc17_42) [template = constants.%.34] +// CHECK:STDOUT: %.loc17_43.11: init %i32 = converted %.loc17_42, %int.convert_checked.loc17_43.2 [template = constants.%.34] +// CHECK:STDOUT: %.loc17_43.12: ref %i32 = class_element_access %return, element1 +// CHECK:STDOUT: %.loc17_43.13: init %i32 = initialize_from %.loc17_43.11 to %.loc17_43.12 [template = constants.%.34] +// CHECK:STDOUT: %.loc17_43.14: init %C = class_init (%.loc17_43.7, %.loc17_43.13), %return [template = constants.%struct] +// CHECK:STDOUT: %.loc17_44: init %C = converted %.loc17_43.1, %.loc17_43.14 [template = constants.%struct] // CHECK:STDOUT: assign %return, %.loc17_44 // CHECK:STDOUT: return %result to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> i32 { +// CHECK:STDOUT: fn @G() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_24.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] -// CHECK:STDOUT: %.loc22_24.2: type = converted %int.make_type_32.loc22, %.loc22_24.1 [template = i32] -// CHECK:STDOUT: %result.var: ref i32 = var result -// CHECK:STDOUT: %result: ref i32 = bind_name result, %result.var -// CHECK:STDOUT: %.loc22_30: Core.IntLiteral = int_value 0 [template = constants.%.36] -// CHECK:STDOUT: %.loc22_31.1: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc22_31.2: = bound_method %.loc22_30, %.loc22_31.1 [template = constants.%.37] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc22_31.2(%.loc22_30) [template = constants.%.38] -// CHECK:STDOUT: %.loc22_31.3: init i32 = converted %.loc22_30, %int.convert_checked [template = constants.%.38] -// CHECK:STDOUT: assign %result.var, %.loc22_31.3 -// CHECK:STDOUT: %.loc22_16: i32 = bind_value %result +// CHECK:STDOUT: %.loc22_24.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%.loc22_24.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc22_24.2: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] +// CHECK:STDOUT: %.loc22_24.3: type = converted %int.make_type_signed.loc22, %.loc22_24.2 [template = constants.%i32] +// CHECK:STDOUT: %result.var: ref %i32 = var result +// CHECK:STDOUT: %result: ref %i32 = bind_name result, %result.var +// CHECK:STDOUT: %.loc22_30: Core.IntLiteral = int_value 0 [template = constants.%.35] +// CHECK:STDOUT: %.loc22_31.1: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc22_31.2: = bound_method %.loc22_30, %.loc22_31.1 [template = constants.%.36] +// CHECK:STDOUT: %.loc22_31.3: = specific_function %.loc22_31.2, @Convert.2(constants.%.1) [template = constants.%.37] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc22_31.3(%.loc22_30) [template = constants.%.38] +// CHECK:STDOUT: %.loc22_31.4: init %i32 = converted %.loc22_30, %int.convert_checked [template = constants.%.38] +// CHECK:STDOUT: assign %result.var, %.loc22_31.4 +// CHECK:STDOUT: %.loc22_16: %i32 = bind_value %result // CHECK:STDOUT: return %.loc22_16 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/returned_var_scope.carbon b/toolchain/check/testdata/return/returned_var_scope.carbon index c5247484ec19..c076e32892e0 100644 --- a/toolchain/check/testdata/return/returned_var_scope.carbon +++ b/toolchain/check/testdata/return/returned_var_scope.carbon @@ -30,21 +30,25 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: --- returned_var_scope.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %UnrelatedScopes.type: type = fn_type @UnrelatedScopes [template] // CHECK:STDOUT: %UnrelatedScopes: %UnrelatedScopes.type = struct_value () [template] -// CHECK:STDOUT: %.1: bool = bool_literal true [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.26: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.27: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.28: i32 = int_value 0 [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.30: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] +// CHECK:STDOUT: %.2: bool = bool_literal true [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.23: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.24: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.25: = specific_function %.24, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.26: %i32 = int_value 0 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %EnclosingButAfter.type: type = fn_type @EnclosingButAfter [template] @@ -53,9 +57,9 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Bool = %import_ref.51 +// CHECK:STDOUT: .Bool = %import_ref.38 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -69,114 +73,125 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %UnrelatedScopes.decl: %UnrelatedScopes.type = fn_decl @UnrelatedScopes [template = constants.%UnrelatedScopes] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_32.loc11, %.loc11_25.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.3: type = converted %int.make_type_signed.loc11, %.loc11_25.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %EnclosingButAfter.decl: %EnclosingButAfter.type = fn_decl @EnclosingButAfter [template = constants.%EnclosingButAfter] { // CHECK:STDOUT: %b.patt: bool = binding_pattern b // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc21_25.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc21_25.2: type = converted %bool.make_type, %.loc21_25.1 [template = bool] -// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_34.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] -// CHECK:STDOUT: %.loc21_34.2: type = converted %int.make_type_32.loc21, %.loc21_34.1 [template = i32] +// CHECK:STDOUT: %.loc21_34.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%.loc21_34.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_34.2: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_34.3: type = converted %int.make_type_signed.loc21, %.loc21_34.2 [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @UnrelatedScopes() -> i32 { +// CHECK:STDOUT: fn @UnrelatedScopes() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12: bool = bool_literal true [template = constants.%.1] +// CHECK:STDOUT: %.loc12: bool = bool_literal true [template = constants.%.2] // CHECK:STDOUT: if %.loc12 br !if.then.loc12 else br !if.else.loc12 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc12: -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_21.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_21.2: type = converted %int.make_type_32.loc13, %.loc13_21.1 [template = i32] -// CHECK:STDOUT: %v.var: ref i32 = var v -// CHECK:STDOUT: %v: ref i32 = bind_name v, %v.var -// CHECK:STDOUT: %.loc13_27: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc13_28.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_28.2: = bound_method %.loc13_27, %.loc13_28.1 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc13: init i32 = call %.loc13_28.2(%.loc13_27) [template = constants.%.28] -// CHECK:STDOUT: %.loc13_28.3: init i32 = converted %.loc13_27, %int.convert_checked.loc13 [template = constants.%.28] -// CHECK:STDOUT: assign %v.var, %.loc13_28.3 +// CHECK:STDOUT: %.loc13_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_21.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_21.3: type = converted %int.make_type_signed.loc13, %.loc13_21.2 [template = constants.%i32] +// CHECK:STDOUT: %v.var: ref %i32 = var v +// CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var +// CHECK:STDOUT: %.loc13_27: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc13_28.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_28.2: = bound_method %.loc13_27, %.loc13_28.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc13_28.3: = specific_function %.loc13_28.2, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %.loc13_28.3(%.loc13_27) [template = constants.%.26] +// CHECK:STDOUT: %.loc13_28.4: init %i32 = converted %.loc13_27, %int.convert_checked.loc13 [template = constants.%.26] +// CHECK:STDOUT: assign %v.var, %.loc13_28.4 // CHECK:STDOUT: br !if.else.loc12 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc12: -// CHECK:STDOUT: %.loc15: bool = bool_literal true [template = constants.%.1] +// CHECK:STDOUT: %.loc15: bool = bool_literal true [template = constants.%.2] // CHECK:STDOUT: if %.loc15 br !if.then.loc15 else br !if.else.loc15 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc15: -// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_21.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] -// CHECK:STDOUT: %.loc16_21.2: type = converted %int.make_type_32.loc16, %.loc16_21.1 [template = i32] -// CHECK:STDOUT: %w.var: ref i32 = var w -// CHECK:STDOUT: %w: ref i32 = bind_name w, %w.var -// CHECK:STDOUT: %.loc16_27: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc16_28.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc16_28.2: = bound_method %.loc16_27, %.loc16_28.1 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc16: init i32 = call %.loc16_28.2(%.loc16_27) [template = constants.%.31] -// CHECK:STDOUT: %.loc16_28.3: init i32 = converted %.loc16_27, %int.convert_checked.loc16 [template = constants.%.31] -// CHECK:STDOUT: assign %w.var, %.loc16_28.3 +// CHECK:STDOUT: %.loc16_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%.loc16_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_21.2: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_21.3: type = converted %int.make_type_signed.loc16, %.loc16_21.2 [template = constants.%i32] +// CHECK:STDOUT: %w.var: ref %i32 = var w +// CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var +// CHECK:STDOUT: %.loc16_27: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc16_28.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc16_28.2: = bound_method %.loc16_27, %.loc16_28.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc16_28.3: = specific_function %.loc16_28.2, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %.loc16_28.3(%.loc16_27) [template = constants.%.30] +// CHECK:STDOUT: %.loc16_28.4: init %i32 = converted %.loc16_27, %int.convert_checked.loc16 [template = constants.%.30] +// CHECK:STDOUT: assign %w.var, %.loc16_28.4 // CHECK:STDOUT: br !if.else.loc15 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc15: -// CHECK:STDOUT: %.loc18_10: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc18_11.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_11.2: = bound_method %.loc18_10, %.loc18_11.1 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc18: init i32 = call %.loc18_11.2(%.loc18_10) [template = constants.%.28] -// CHECK:STDOUT: %.loc18_11.3: i32 = value_of_initializer %int.convert_checked.loc18 [template = constants.%.28] -// CHECK:STDOUT: %.loc18_11.4: i32 = converted %.loc18_10, %.loc18_11.3 [template = constants.%.28] -// CHECK:STDOUT: return %.loc18_11.4 +// CHECK:STDOUT: %.loc18_10: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc18_11.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_11.2: = bound_method %.loc18_10, %.loc18_11.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc18_11.3: = specific_function %.loc18_11.2, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %.loc18_11.3(%.loc18_10) [template = constants.%.26] +// CHECK:STDOUT: %.loc18_11.4: %i32 = value_of_initializer %int.convert_checked.loc18 [template = constants.%.26] +// CHECK:STDOUT: %.loc18_11.5: %i32 = converted %.loc18_10, %.loc18_11.4 [template = constants.%.26] +// CHECK:STDOUT: return %.loc18_11.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @EnclosingButAfter(%b.param_patt: bool) -> i32 { +// CHECK:STDOUT: fn @EnclosingButAfter(%b.param_patt: bool) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %int.make_type_32.loc23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc23_21.1: type = value_of_initializer %int.make_type_32.loc23 [template = i32] -// CHECK:STDOUT: %.loc23_21.2: type = converted %int.make_type_32.loc23, %.loc23_21.1 [template = i32] -// CHECK:STDOUT: %v.var: ref i32 = var v -// CHECK:STDOUT: %v: ref i32 = bind_name v, %v.var -// CHECK:STDOUT: %.loc23_27: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc23_28.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc23_28.2: = bound_method %.loc23_27, %.loc23_28.1 [template = constants.%.27] -// CHECK:STDOUT: %int.convert_checked.loc23: init i32 = call %.loc23_28.2(%.loc23_27) [template = constants.%.28] -// CHECK:STDOUT: %.loc23_28.3: init i32 = converted %.loc23_27, %int.convert_checked.loc23 [template = constants.%.28] -// CHECK:STDOUT: assign %v.var, %.loc23_28.3 -// CHECK:STDOUT: %.loc23_18: i32 = bind_value %v +// CHECK:STDOUT: %.loc23_21.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc23: init type = call constants.%Int(%.loc23_21.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc23_21.2: type = value_of_initializer %int.make_type_signed.loc23 [template = constants.%i32] +// CHECK:STDOUT: %.loc23_21.3: type = converted %int.make_type_signed.loc23, %.loc23_21.2 [template = constants.%i32] +// CHECK:STDOUT: %v.var: ref %i32 = var v +// CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var +// CHECK:STDOUT: %.loc23_27: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc23_28.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc23_28.2: = bound_method %.loc23_27, %.loc23_28.1 [template = constants.%.24] +// CHECK:STDOUT: %.loc23_28.3: = specific_function %.loc23_28.2, @Convert.2(constants.%.1) [template = constants.%.25] +// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %.loc23_28.3(%.loc23_27) [template = constants.%.26] +// CHECK:STDOUT: %.loc23_28.4: init %i32 = converted %.loc23_27, %int.convert_checked.loc23 [template = constants.%.26] +// CHECK:STDOUT: assign %v.var, %.loc23_28.4 +// CHECK:STDOUT: %.loc23_18: %i32 = bind_value %v // CHECK:STDOUT: return %.loc23_18 // CHECK:STDOUT: // CHECK:STDOUT: !if.else: -// CHECK:STDOUT: %int.make_type_32.loc26: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc26_19.1: type = value_of_initializer %int.make_type_32.loc26 [template = i32] -// CHECK:STDOUT: %.loc26_19.2: type = converted %int.make_type_32.loc26, %.loc26_19.1 [template = i32] -// CHECK:STDOUT: %w.var: ref i32 = var w -// CHECK:STDOUT: %w: ref i32 = bind_name w, %w.var -// CHECK:STDOUT: %.loc26_25: Core.IntLiteral = int_value 1 [template = constants.%.29] -// CHECK:STDOUT: %.loc26_26.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc26_26.2: = bound_method %.loc26_25, %.loc26_26.1 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc26: init i32 = call %.loc26_26.2(%.loc26_25) [template = constants.%.31] -// CHECK:STDOUT: %.loc26_26.3: init i32 = converted %.loc26_25, %int.convert_checked.loc26 [template = constants.%.31] -// CHECK:STDOUT: assign %w.var, %.loc26_26.3 -// CHECK:STDOUT: %.loc26_16: i32 = bind_value %w +// CHECK:STDOUT: %.loc26_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc26: init type = call constants.%Int(%.loc26_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc26_19.2: type = value_of_initializer %int.make_type_signed.loc26 [template = constants.%i32] +// CHECK:STDOUT: %.loc26_19.3: type = converted %int.make_type_signed.loc26, %.loc26_19.2 [template = constants.%i32] +// CHECK:STDOUT: %w.var: ref %i32 = var w +// CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var +// CHECK:STDOUT: %.loc26_25: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc26_26.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc26_26.2: = bound_method %.loc26_25, %.loc26_26.1 [template = constants.%.28] +// CHECK:STDOUT: %.loc26_26.3: = specific_function %.loc26_26.2, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %.loc26_26.3(%.loc26_25) [template = constants.%.30] +// CHECK:STDOUT: %.loc26_26.4: init %i32 = converted %.loc26_25, %int.convert_checked.loc26 [template = constants.%.30] +// CHECK:STDOUT: assign %w.var, %.loc26_26.4 +// CHECK:STDOUT: %.loc26_16: %i32 = bind_value %w // CHECK:STDOUT: return %.loc26_16 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/struct.carbon b/toolchain/check/testdata/return/struct.carbon index b00c14b44c06..81576111f1fd 100644 --- a/toolchain/check/testdata/return/struct.carbon +++ b/toolchain/check/testdata/return/struct.carbon @@ -15,25 +15,28 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: --- struct.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: i32} [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.3: type = struct_type {.a: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 3 [template] -// CHECK:STDOUT: %struct: %.1 = struct_value (%.29) [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.4: type = struct_type {.a: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 3 [template] +// CHECK:STDOUT: %struct: %.2 = struct_value (%.27) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -47,29 +50,31 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { -// CHECK:STDOUT: %return.patt: %.1 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.1 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32, %.loc11_19.1 [template = i32] -// CHECK:STDOUT: %.loc11_22: type = struct_type {.a: i32} [template = constants.%.1] -// CHECK:STDOUT: %return.param: ref %.1 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref %.1 = return_slot %return.param +// CHECK:STDOUT: %.loc11_19.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_19.3: type = converted %int.make_type_signed, %.loc11_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22: type = struct_type {.a: %i32} [template = constants.%.2] +// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Main() -> %.1 { +// CHECK:STDOUT: fn @Main() -> %.2 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 3 [template = constants.%.2] -// CHECK:STDOUT: %.loc12_17.1: %.3 = struct_literal (%.loc12_16) -// CHECK:STDOUT: %.loc12_17.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_17.3: = bound_method %.loc12_16, %.loc12_17.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_17.3(%.loc12_16) [template = constants.%.29] -// CHECK:STDOUT: %.loc12_17.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.29] -// CHECK:STDOUT: %.loc12_17.5: i32 = converted %.loc12_16, %.loc12_17.4 [template = constants.%.29] -// CHECK:STDOUT: %struct: %.1 = struct_value (%.loc12_17.5) [template = constants.%struct] -// CHECK:STDOUT: %.loc12_18: %.1 = converted %.loc12_17.1, %struct [template = constants.%struct] +// CHECK:STDOUT: %.loc12_16: Core.IntLiteral = int_value 3 [template = constants.%.3] +// CHECK:STDOUT: %.loc12_17.1: %.4 = struct_literal (%.loc12_16) +// CHECK:STDOUT: %.loc12_17.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_17.3: = bound_method %.loc12_16, %.loc12_17.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc12_17.4: = specific_function %.loc12_17.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc12_17.4(%.loc12_16) [template = constants.%.27] +// CHECK:STDOUT: %.loc12_17.5: %i32 = value_of_initializer %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc12_17.6: %i32 = converted %.loc12_16, %.loc12_17.5 [template = constants.%.27] +// CHECK:STDOUT: %struct: %.2 = struct_value (%.loc12_17.6) [template = constants.%struct] +// CHECK:STDOUT: %.loc12_18: %.2 = converted %.loc12_17.1, %struct [template = constants.%struct] // CHECK:STDOUT: return %.loc12_18 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/tuple.carbon b/toolchain/check/testdata/return/tuple.carbon index 4067f9424909..eb9059593068 100644 --- a/toolchain/check/testdata/return/tuple.carbon +++ b/toolchain/check/testdata/return/tuple.carbon @@ -16,29 +16,33 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: --- tuple.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 15 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 35 [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 15 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 35 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 15 [template] -// CHECK:STDOUT: %.30: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 35 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.29, %.31) [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 15 [template] +// CHECK:STDOUT: %.28: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 35 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.27, %.30) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -55,13 +59,15 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: %return.patt: %tuple.type.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc12_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc12_20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_23.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc12_15, %int.make_type_32.loc12_20) -// CHECK:STDOUT: %.loc12_23.2: type = value_of_initializer %int.make_type_32.loc12_15 [template = i32] -// CHECK:STDOUT: %.loc12_23.3: type = converted %int.make_type_32.loc12_15, %.loc12_23.2 [template = i32] -// CHECK:STDOUT: %.loc12_23.4: type = value_of_initializer %int.make_type_32.loc12_20 [template = i32] -// CHECK:STDOUT: %.loc12_23.5: type = converted %int.make_type_32.loc12_20, %.loc12_23.4 [template = i32] +// CHECK:STDOUT: %.loc12_15: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_15: init type = call constants.%Int(%.loc12_15) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_20: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_20: init type = call constants.%Int(%.loc12_20) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_23.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc12_15, %int.make_type_signed.loc12_20) +// CHECK:STDOUT: %.loc12_23.2: type = value_of_initializer %int.make_type_signed.loc12_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_23.3: type = converted %int.make_type_signed.loc12_15, %.loc12_23.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_23.4: type = value_of_initializer %int.make_type_signed.loc12_20 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_23.5: type = converted %int.make_type_signed.loc12_20, %.loc12_23.4 [template = constants.%i32] // CHECK:STDOUT: %.loc12_23.6: type = converted %.loc12_23.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param @@ -70,23 +76,25 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() -> %return: %tuple.type.2 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc13_11: Core.IntLiteral = int_value 15 [template = constants.%.2] -// CHECK:STDOUT: %.loc13_15: Core.IntLiteral = int_value 35 [template = constants.%.3] +// CHECK:STDOUT: %.loc13_11: Core.IntLiteral = int_value 15 [template = constants.%.3] +// CHECK:STDOUT: %.loc13_15: Core.IntLiteral = int_value 35 [template = constants.%.4] // CHECK:STDOUT: %.loc13_17.1: %tuple.type.3 = tuple_literal (%.loc13_11, %.loc13_15) -// CHECK:STDOUT: %.loc13_17.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_17.3: = bound_method %.loc13_11, %.loc13_17.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc13_17.1: init i32 = call %.loc13_17.3(%.loc13_11) [template = constants.%.29] -// CHECK:STDOUT: %.loc13_17.4: init i32 = converted %.loc13_11, %int.convert_checked.loc13_17.1 [template = constants.%.29] -// CHECK:STDOUT: %.loc13_17.5: ref i32 = tuple_access %return, element0 -// CHECK:STDOUT: %.loc13_17.6: init i32 = initialize_from %.loc13_17.4 to %.loc13_17.5 [template = constants.%.29] -// CHECK:STDOUT: %.loc13_17.7: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc13_17.8: = bound_method %.loc13_15, %.loc13_17.7 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc13_17.2: init i32 = call %.loc13_17.8(%.loc13_15) [template = constants.%.31] -// CHECK:STDOUT: %.loc13_17.9: init i32 = converted %.loc13_15, %int.convert_checked.loc13_17.2 [template = constants.%.31] -// CHECK:STDOUT: %.loc13_17.10: ref i32 = tuple_access %return, element1 -// CHECK:STDOUT: %.loc13_17.11: init i32 = initialize_from %.loc13_17.9 to %.loc13_17.10 [template = constants.%.31] -// CHECK:STDOUT: %.loc13_17.12: init %tuple.type.2 = tuple_init (%.loc13_17.6, %.loc13_17.11) to %return [template = constants.%tuple] -// CHECK:STDOUT: %.loc13_18: init %tuple.type.2 = converted %.loc13_17.1, %.loc13_17.12 [template = constants.%tuple] +// CHECK:STDOUT: %.loc13_17.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_17.3: = bound_method %.loc13_11, %.loc13_17.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc13_17.4: = specific_function %.loc13_17.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc13_17.1: init %i32 = call %.loc13_17.4(%.loc13_11) [template = constants.%.27] +// CHECK:STDOUT: %.loc13_17.5: init %i32 = converted %.loc13_11, %int.convert_checked.loc13_17.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc13_17.6: ref %i32 = tuple_access %return, element0 +// CHECK:STDOUT: %.loc13_17.7: init %i32 = initialize_from %.loc13_17.5 to %.loc13_17.6 [template = constants.%.27] +// CHECK:STDOUT: %.loc13_17.8: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc13_17.9: = bound_method %.loc13_15, %.loc13_17.8 [template = constants.%.28] +// CHECK:STDOUT: %.loc13_17.10: = specific_function %.loc13_17.9, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc13_17.2: init %i32 = call %.loc13_17.10(%.loc13_15) [template = constants.%.30] +// CHECK:STDOUT: %.loc13_17.11: init %i32 = converted %.loc13_15, %int.convert_checked.loc13_17.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc13_17.12: ref %i32 = tuple_access %return, element1 +// CHECK:STDOUT: %.loc13_17.13: init %i32 = initialize_from %.loc13_17.11 to %.loc13_17.12 [template = constants.%.30] +// CHECK:STDOUT: %.loc13_17.14: init %tuple.type.2 = tuple_init (%.loc13_17.7, %.loc13_17.13) to %return [template = constants.%tuple] +// CHECK:STDOUT: %.loc13_18: init %tuple.type.2 = converted %.loc13_17.1, %.loc13_17.14 [template = constants.%tuple] // CHECK:STDOUT: return %.loc13_18 to %return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/value.carbon b/toolchain/check/testdata/return/value.carbon index 2adbe5854522..b651369a9b74 100644 --- a/toolchain/check/testdata/return/value.carbon +++ b/toolchain/check/testdata/return/value.carbon @@ -15,22 +15,25 @@ fn Main() -> i32 { // CHECK:STDOUT: --- value.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -44,25 +47,27 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32, %.loc11_14.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_14.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14.3: type = converted %int.make_type_signed, %.loc11_14.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Main() -> i32 { +// CHECK:STDOUT: fn @Main() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_10: Core.IntLiteral = int_value 0 [template = constants.%.1] -// CHECK:STDOUT: %.loc12_11.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_11.2: = bound_method %.loc12_10, %.loc12_11.1 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc12_11.2(%.loc12_10) [template = constants.%.27] -// CHECK:STDOUT: %.loc12_11.3: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc12_11.4: i32 = converted %.loc12_10, %.loc12_11.3 [template = constants.%.27] -// CHECK:STDOUT: return %.loc12_11.4 +// CHECK:STDOUT: %.loc12_10: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc12_11.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_11.2: = bound_method %.loc12_10, %.loc12_11.1 [template = constants.%.23] +// CHECK:STDOUT: %.loc12_11.3: = specific_function %.loc12_11.2, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc12_11.3(%.loc12_10) [template = constants.%.25] +// CHECK:STDOUT: %.loc12_11.4: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc12_11.5: %i32 = converted %.loc12_10, %.loc12_11.4 [template = constants.%.25] +// CHECK:STDOUT: return %.loc12_11.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/fail_assign_empty.carbon b/toolchain/check/testdata/struct/fail_assign_empty.carbon index c83ef58496c2..d9299f94368d 100644 --- a/toolchain/check/testdata/struct/fail_assign_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_empty.carbon @@ -16,15 +16,17 @@ var x: {.a: i32} = {}; // CHECK:STDOUT: --- fail_assign_empty.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %i32} [template] +// CHECK:STDOUT: %.3: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -36,17 +38,18 @@ var x: {.a: i32} = {}; // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32, %.loc14_13.1 [template = i32] -// CHECK:STDOUT: %.loc14_16: type = struct_type {.a: i32} [template = constants.%.1] -// CHECK:STDOUT: %x.var: ref %.1 = var x -// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var +// CHECK:STDOUT: %.loc14_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_13.3: type = converted %int.make_type_signed, %.loc14_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_16: type = struct_type {.a: %i32} [template = constants.%.2] +// CHECK:STDOUT: %x.var: ref %.2 = var x +// CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc14: %.2 = struct_literal () +// CHECK:STDOUT: %.loc14: %.3 = struct_literal () // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_duplicate_name.carbon b/toolchain/check/testdata/struct/fail_duplicate_name.carbon index f97e40f6d38c..16ef2cb63469 100644 --- a/toolchain/check/testdata/struct/fail_duplicate_name.carbon +++ b/toolchain/check/testdata/struct/fail_duplicate_name.carbon @@ -55,22 +55,24 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDOUT: --- fail_duplicate_name.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: Core.IntLiteral} [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.4: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.5: type = struct_type {.b: i32, .c: i32} [template] -// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: Core.IntLiteral} [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.5: type = struct_type {.a: %i32} [template] +// CHECK:STDOUT: %.6: type = struct_type {.b: %i32, .c: %i32} [template] +// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.9: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -90,66 +92,77 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDOUT: %return.patt: = return_slot_pattern // CHECK:STDOUT: %return.param_patt: = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc18_16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_16.1: type = value_of_initializer %int.make_type_32.loc18_16 [template = i32] -// CHECK:STDOUT: %.loc18_16.2: type = converted %int.make_type_32.loc18_16, %.loc18_16.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc18_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_27.1: type = value_of_initializer %int.make_type_32.loc18_27 [template = i32] -// CHECK:STDOUT: %.loc18_27.2: type = converted %int.make_type_32.loc18_27, %.loc18_27.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc18_36: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_36.1: type = value_of_initializer %int.make_type_32.loc18_36 [template = i32] -// CHECK:STDOUT: %.loc18_36.2: type = converted %int.make_type_32.loc18_36, %.loc18_36.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc18_47: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_47.1: type = value_of_initializer %int.make_type_32.loc18_47 [template = i32] -// CHECK:STDOUT: %.loc18_47.2: type = converted %int.make_type_32.loc18_47, %.loc18_47.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc18_56: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_56.1: type = value_of_initializer %int.make_type_32.loc18_56 [template = i32] -// CHECK:STDOUT: %.loc18_56.2: type = converted %int.make_type_32.loc18_56, %.loc18_56.1 [template = i32] +// CHECK:STDOUT: %.loc18_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18_16: init type = call constants.%Int(%.loc18_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_16.2: type = value_of_initializer %int.make_type_signed.loc18_16 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_16.3: type = converted %int.make_type_signed.loc18_16, %.loc18_16.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18_27: init type = call constants.%Int(%.loc18_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_27.2: type = value_of_initializer %int.make_type_signed.loc18_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_27.3: type = converted %int.make_type_signed.loc18_27, %.loc18_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_36.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18_36: init type = call constants.%Int(%.loc18_36.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_36.2: type = value_of_initializer %int.make_type_signed.loc18_36 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_36.3: type = converted %int.make_type_signed.loc18_36, %.loc18_36.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_47.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18_47: init type = call constants.%Int(%.loc18_47.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_47.2: type = value_of_initializer %int.make_type_signed.loc18_47 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_47.3: type = converted %int.make_type_signed.loc18_47, %.loc18_47.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_56.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18_56: init type = call constants.%Int(%.loc18_56.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_56.2: type = value_of_initializer %int.make_type_signed.loc18_56 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_56.3: type = converted %int.make_type_signed.loc18_56, %.loc18_56.2 [template = constants.%i32] // CHECK:STDOUT: %return.param: ref = out_param runtime_param0 // CHECK:STDOUT: %return: ref = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int.make_type_32.loc27_13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc27_13.1: type = value_of_initializer %int.make_type_32.loc27_13 [template = i32] -// CHECK:STDOUT: %.loc27_13.2: type = converted %int.make_type_32.loc27_13, %.loc27_13.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc27_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc27_22.1: type = value_of_initializer %int.make_type_32.loc27_22 [template = i32] -// CHECK:STDOUT: %.loc27_22.2: type = converted %int.make_type_32.loc27_22, %.loc27_22.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc36: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc36_8.1: type = value_of_initializer %int.make_type_32.loc36 [template = i32] -// CHECK:STDOUT: %.loc36_8.2: type = converted %int.make_type_32.loc36, %.loc36_8.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc45: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc45_13.1: type = value_of_initializer %int.make_type_32.loc45 [template = i32] -// CHECK:STDOUT: %.loc45_13.2: type = converted %int.make_type_32.loc45, %.loc45_13.1 [template = i32] -// CHECK:STDOUT: %.loc45_16: type = struct_type {.a: i32} [template = constants.%.4] -// CHECK:STDOUT: %x.var: ref %.4 = var x -// CHECK:STDOUT: %x: ref %.4 = bind_name x, %x.var -// CHECK:STDOUT: %int.make_type_32.loc53_13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc53_13.1: type = value_of_initializer %int.make_type_32.loc53_13 [template = i32] -// CHECK:STDOUT: %.loc53_13.2: type = converted %int.make_type_32.loc53_13, %.loc53_13.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc53_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc53_22.1: type = value_of_initializer %int.make_type_32.loc53_22 [template = i32] -// CHECK:STDOUT: %.loc53_22.2: type = converted %int.make_type_32.loc53_22, %.loc53_22.1 [template = i32] -// CHECK:STDOUT: %.loc53_25: type = struct_type {.b: i32, .c: i32} [template = constants.%.5] -// CHECK:STDOUT: %y.var: ref %.5 = var y -// CHECK:STDOUT: %y: ref %.5 = bind_name y, %y.var +// CHECK:STDOUT: %.loc27_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc27_13: init type = call constants.%Int(%.loc27_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc27_13.2: type = value_of_initializer %int.make_type_signed.loc27_13 [template = constants.%i32] +// CHECK:STDOUT: %.loc27_13.3: type = converted %int.make_type_signed.loc27_13, %.loc27_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc27_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc27_22: init type = call constants.%Int(%.loc27_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc27_22.2: type = value_of_initializer %int.make_type_signed.loc27_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc27_22.3: type = converted %int.make_type_signed.loc27_22, %.loc27_22.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc36_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc36: init type = call constants.%Int(%.loc36_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc36_8.2: type = value_of_initializer %int.make_type_signed.loc36 [template = constants.%i32] +// CHECK:STDOUT: %.loc36_8.3: type = converted %int.make_type_signed.loc36, %.loc36_8.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc45_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc45: init type = call constants.%Int(%.loc45_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc45_13.2: type = value_of_initializer %int.make_type_signed.loc45 [template = constants.%i32] +// CHECK:STDOUT: %.loc45_13.3: type = converted %int.make_type_signed.loc45, %.loc45_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc45_16: type = struct_type {.a: %i32} [template = constants.%.5] +// CHECK:STDOUT: %x.var: ref %.5 = var x +// CHECK:STDOUT: %x: ref %.5 = bind_name x, %x.var +// CHECK:STDOUT: %.loc53_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc53_13: init type = call constants.%Int(%.loc53_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc53_13.2: type = value_of_initializer %int.make_type_signed.loc53_13 [template = constants.%i32] +// CHECK:STDOUT: %.loc53_13.3: type = converted %int.make_type_signed.loc53_13, %.loc53_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc53_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc53_22: init type = call constants.%Int(%.loc53_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc53_22.2: type = value_of_initializer %int.make_type_signed.loc53_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc53_22.3: type = converted %int.make_type_signed.loc53_22, %.loc53_22.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc53_25: type = struct_type {.b: %i32, .c: %i32} [template = constants.%.6] +// CHECK:STDOUT: %y.var: ref %.6 = var y +// CHECK:STDOUT: %y: ref %.6 = bind_name y, %y.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> ; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc27_35: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc27_36: %.2 = struct_literal (%.loc27_35) +// CHECK:STDOUT: %.loc27_35: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc27_36: %.3 = struct_literal (%.loc27_35) // CHECK:STDOUT: %v: = bind_name v, -// CHECK:STDOUT: %.loc36_22: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc36_32: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc36_22: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc36_32: Core.IntLiteral = int_value 2 [template = constants.%.4] // CHECK:STDOUT: %def.ref: = name_ref def, [template = ] -// CHECK:STDOUT: %w: i32 = bind_name w, -// CHECK:STDOUT: %.loc45_26: Core.IntLiteral = int_value 1 [template = constants.%.1] -// CHECK:STDOUT: %.loc45_34: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %w: %i32 = bind_name w, +// CHECK:STDOUT: %.loc45_26: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc45_34: Core.IntLiteral = int_value 2 [template = constants.%.4] // CHECK:STDOUT: assign file.%x.var, -// CHECK:STDOUT: %.loc53_35: Core.IntLiteral = int_value 3 [template = constants.%.7] -// CHECK:STDOUT: %.loc53_43: Core.IntLiteral = int_value 4 [template = constants.%.8] +// CHECK:STDOUT: %.loc53_35: Core.IntLiteral = int_value 3 [template = constants.%.8] +// CHECK:STDOUT: %.loc53_43: Core.IntLiteral = int_value 4 [template = constants.%.9] // CHECK:STDOUT: assign file.%y.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon index df3088274a85..38d29c141161 100644 --- a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon @@ -22,17 +22,19 @@ var y: {.b: i32} = x; // CHECK:STDOUT: --- fail_field_name_mismatch.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.3: type = struct_type {.b: Core.IntLiteral} [template] -// CHECK:STDOUT: %.4: type = struct_type {.b: i32} [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %i32} [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.4: type = struct_type {.b: Core.IntLiteral} [template] +// CHECK:STDOUT: %.5: type = struct_type {.b: %i32} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -45,26 +47,28 @@ var y: {.b: i32} = x; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_13.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_13.2: type = converted %int.make_type_32.loc15, %.loc15_13.1 [template = i32] -// CHECK:STDOUT: %.loc15_16: type = struct_type {.a: i32} [template = constants.%.1] -// CHECK:STDOUT: %x.var: ref %.1 = var x -// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var -// CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc20_13.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32] -// CHECK:STDOUT: %.loc20_13.2: type = converted %int.make_type_32.loc20, %.loc20_13.1 [template = i32] -// CHECK:STDOUT: %.loc20_16: type = struct_type {.b: i32} [template = constants.%.4] -// CHECK:STDOUT: %y.var: ref %.4 = var y -// CHECK:STDOUT: %y: ref %.4 = bind_name y, %y.var +// CHECK:STDOUT: %.loc15_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_13.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_13.3: type = converted %int.make_type_signed.loc15, %.loc15_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_16: type = struct_type {.a: %i32} [template = constants.%.2] +// CHECK:STDOUT: %x.var: ref %.2 = var x +// CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var +// CHECK:STDOUT: %.loc20_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%.loc20_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc20_13.2: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] +// CHECK:STDOUT: %.loc20_13.3: type = converted %int.make_type_signed.loc20, %.loc20_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc20_16: type = struct_type {.b: %i32} [template = constants.%.5] +// CHECK:STDOUT: %y.var: ref %.5 = var y +// CHECK:STDOUT: %y: ref %.5 = bind_name y, %y.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15_26: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc15_27: %.3 = struct_literal (%.loc15_26) +// CHECK:STDOUT: %.loc15_26: Core.IntLiteral = int_value 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_27: %.4 = struct_literal (%.loc15_26) // CHECK:STDOUT: assign file.%x.var, -// CHECK:STDOUT: %x.ref: ref %.1 = name_ref x, file.%x +// CHECK:STDOUT: %x.ref: ref %.2 = name_ref x, file.%x // CHECK:STDOUT: assign file.%y.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon index 49bc9040a33a..d5694156515f 100644 --- a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon @@ -16,16 +16,18 @@ var x: {.a: i32} = {.b = 1.0}; // CHECK:STDOUT: --- fail_field_type_mismatch.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.2: f64 = float_literal 1 [template] -// CHECK:STDOUT: %.3: type = struct_type {.b: f64} [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %i32} [template] +// CHECK:STDOUT: %.3: f64 = float_literal 1 [template] +// CHECK:STDOUT: %.4: type = struct_type {.b: f64} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -37,18 +39,19 @@ var x: {.a: i32} = {.b = 1.0}; // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32, %.loc14_13.1 [template = i32] -// CHECK:STDOUT: %.loc14_16: type = struct_type {.a: i32} [template = constants.%.1] -// CHECK:STDOUT: %x.var: ref %.1 = var x -// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var +// CHECK:STDOUT: %.loc14_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc14_13.3: type = converted %int.make_type_signed, %.loc14_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_16: type = struct_type {.a: %i32} [template = constants.%.2] +// CHECK:STDOUT: %x.var: ref %.2 = var x +// CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc14_26: f64 = float_literal 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc14_29: %.3 = struct_literal (%.loc14_26) +// CHECK:STDOUT: %.loc14_26: f64 = float_literal 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc14_29: %.4 = struct_literal (%.loc14_26) // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_member_access_type.carbon b/toolchain/check/testdata/struct/fail_member_access_type.carbon index 6dc695d8f469..dcca98ca6073 100644 --- a/toolchain/check/testdata/struct/fail_member_access_type.carbon +++ b/toolchain/check/testdata/struct/fail_member_access_type.carbon @@ -23,14 +23,16 @@ var y: i32 = x.b; // CHECK:STDOUT: %.2: type = struct_type {.a: f64} [template] // CHECK:STDOUT: %.3: f64 = float_literal 4 [template] // CHECK:STDOUT: %struct: %.2 = struct_value (%.3) [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Float = %import_ref.1 -// CHECK:STDOUT: .Int32 = %import_ref.2 +// CHECK:STDOUT: .Int = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -50,11 +52,12 @@ var y: i32 = x.b; // CHECK:STDOUT: %.loc11_16: type = struct_type {.a: f64} [template = constants.%.2] // CHECK:STDOUT: %x.var: ref %.2 = var x // CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32, %.loc15_8.1 [template = i32] -// CHECK:STDOUT: %y.var: ref i32 = var y -// CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.4] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed, %.loc15_8.2 [template = constants.%i32] +// CHECK:STDOUT: %y.var: ref %i32 = var y +// CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/struct/fail_non_member_access.carbon b/toolchain/check/testdata/struct/fail_non_member_access.carbon index 391d3b545220..4a3e4f4f1a20 100644 --- a/toolchain/check/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/check/testdata/struct/fail_non_member_access.carbon @@ -17,23 +17,26 @@ var y: i32 = x.b; // CHECK:STDOUT: --- fail_non_member_access.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %.3: type = struct_type {.a: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 4 [template] -// CHECK:STDOUT: %struct: %.1 = struct_value (%.29) [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %i32} [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.4: type = struct_type {.a: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 4 [template] +// CHECK:STDOUT: %struct: %.2 = struct_value (%.27) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -47,31 +50,34 @@ var y: i32 = x.b; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32.loc11, %.loc11_13.1 [template = i32] -// CHECK:STDOUT: %.loc11_16: type = struct_type {.a: i32} [template = constants.%.1] -// CHECK:STDOUT: %x.var: ref %.1 = var x -// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] -// CHECK:STDOUT: %y.var: ref i32 = var y -// CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var +// CHECK:STDOUT: %.loc11_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.3: type = converted %int.make_type_signed.loc11, %.loc11_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_16: type = struct_type {.a: %i32} [template = constants.%.2] +// CHECK:STDOUT: %x.var: ref %.2 = var x +// CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed.loc15, %.loc15_8.2 [template = constants.%i32] +// CHECK:STDOUT: %y.var: ref %i32 = var y +// CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 4 [template = constants.%.2] -// CHECK:STDOUT: %.loc11_27.1: %.3 = struct_literal (%.loc11_26) -// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_26, %.loc11_27.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc11_27.3(%.loc11_26) [template = constants.%.29] -// CHECK:STDOUT: %.loc11_27.4: init i32 = converted %.loc11_26, %int.convert_checked [template = constants.%.29] -// CHECK:STDOUT: %.loc11_27.5: init %.1 = struct_init (%.loc11_27.4) to file.%x.var [template = constants.%struct] -// CHECK:STDOUT: %.loc11_28: init %.1 = converted %.loc11_27.1, %.loc11_27.5 [template = constants.%struct] +// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 4 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_27.1: %.4 = struct_literal (%.loc11_26) +// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_26, %.loc11_27.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc11_27.4: = specific_function %.loc11_27.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc11_27.4(%.loc11_26) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_27.5: init %i32 = converted %.loc11_26, %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc11_27.6: init %.2 = struct_init (%.loc11_27.5) to file.%x.var [template = constants.%struct] +// CHECK:STDOUT: %.loc11_28: init %.2 = converted %.loc11_27.1, %.loc11_27.6 [template = constants.%struct] // CHECK:STDOUT: assign file.%x.var, %.loc11_28 -// CHECK:STDOUT: %x.ref: ref %.1 = name_ref x, file.%x +// CHECK:STDOUT: %x.ref: ref %.2 = name_ref x, file.%x // CHECK:STDOUT: assign file.%y.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_too_few_values.carbon b/toolchain/check/testdata/struct/fail_too_few_values.carbon index 08620a960b0e..a773a5ef55ce 100644 --- a/toolchain/check/testdata/struct/fail_too_few_values.carbon +++ b/toolchain/check/testdata/struct/fail_too_few_values.carbon @@ -16,16 +16,18 @@ var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDOUT: --- fail_too_few_values.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.4: type = struct_type {.a: Core.IntLiteral} [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.5: type = struct_type {.a: Core.IntLiteral} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -37,21 +39,23 @@ var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc14_13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32.loc14_13 [template = i32] -// CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32.loc14_13, %.loc14_13.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_22.1: type = value_of_initializer %int.make_type_32.loc14_22 [template = i32] -// CHECK:STDOUT: %.loc14_22.2: type = converted %int.make_type_32.loc14_22, %.loc14_22.1 [template = i32] -// CHECK:STDOUT: %.loc14_25: type = struct_type {.a: i32, .b: i32} [template = constants.%.1] -// CHECK:STDOUT: %x.var: ref %.1 = var x -// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var +// CHECK:STDOUT: %.loc14_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_13: init type = call constants.%Int(%.loc14_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_13.2: type = value_of_initializer %int.make_type_signed.loc14_13 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_13.3: type = converted %int.make_type_signed.loc14_13, %.loc14_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_22: init type = call constants.%Int(%.loc14_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_22.2: type = value_of_initializer %int.make_type_signed.loc14_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_22.3: type = converted %int.make_type_signed.loc14_22, %.loc14_22.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_25: type = struct_type {.a: %i32, .b: %i32} [template = constants.%.2] +// CHECK:STDOUT: %x.var: ref %.2 = var x +// CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc14_35: Core.IntLiteral = int_value 1 [template = constants.%.3] -// CHECK:STDOUT: %.loc14_36: %.4 = struct_literal (%.loc14_35) +// CHECK:STDOUT: %.loc14_35: Core.IntLiteral = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc14_36: %.5 = struct_literal (%.loc14_35) // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_type_assign.carbon b/toolchain/check/testdata/struct/fail_type_assign.carbon index 0c4643a8ab45..ac53416476cc 100644 --- a/toolchain/check/testdata/struct/fail_type_assign.carbon +++ b/toolchain/check/testdata/struct/fail_type_assign.carbon @@ -19,14 +19,16 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: --- fail_type_assign.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: i32} [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -39,21 +41,23 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc17_13.2: type = converted %int.make_type_32, %.loc17_13.1 [template = i32] -// CHECK:STDOUT: %.loc17_16: type = struct_type {.a: i32} [template = constants.%.1] -// CHECK:STDOUT: %x.var: ref %.1 = var x -// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var +// CHECK:STDOUT: %.loc17_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc17_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc17_13.3: type = converted %int.make_type_signed, %.loc17_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_16: type = struct_type {.a: %i32} [template = constants.%.2] +// CHECK:STDOUT: %x.var: ref %.2 = var x +// CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_25.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc17_25.2: type = converted %int.make_type_32, %.loc17_25.1 [template = i32] -// CHECK:STDOUT: %.loc17_28: type = struct_type {.a: i32} [template = constants.%.1] -// CHECK:STDOUT: %.loc17_29: %.1 = converted %.loc17_28, [template = ] +// CHECK:STDOUT: %.loc17_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc17_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_25.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc17_25.3: type = converted %int.make_type_signed, %.loc17_25.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_28: type = struct_type {.a: %i32} [template = constants.%.2] +// CHECK:STDOUT: %.loc17_29: %.2 = converted %.loc17_28, [template = ] // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index 60e6e87df5e1..2d41eb5e4694 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -43,10 +43,10 @@ var c_bad: C({.c = 1, .d = 2}) = F(); // --- fail_bad_value.impl.carbon impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C({.a = 3, .b = 4}) = F(); @@ -54,44 +54,49 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: --- implicit.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.3: type = struct_type {.a: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 0 [template] -// CHECK:STDOUT: %struct.1: %.1 = struct_value (%.29) [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %i32} [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.4: type = struct_type {.a: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 0 [template] +// CHECK:STDOUT: %struct.1: %.2 = struct_value (%.27) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.30: type = struct_type {.b: i32, .c: %tuple.type.2} [template] -// CHECK:STDOUT: %.31: type = struct_type {.a: %.30, .d: i32} [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] +// CHECK:STDOUT: %.28: type = struct_type {.b: %i32, .c: %tuple.type.2} [template] +// CHECK:STDOUT: %.29: type = struct_type {.a: %.28, .d: %i32} [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %.35: type = struct_type {.b: Core.IntLiteral, .c: %tuple.type.3} [template] -// CHECK:STDOUT: %.36: type = struct_type {.a: %.35, .d: Core.IntLiteral} [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.29) [template] -// CHECK:STDOUT: %struct.2: %.30 = struct_value (%.29, %tuple) [template] -// CHECK:STDOUT: %struct.3: %.31 = struct_value (%struct.2, %.29) [template] -// CHECK:STDOUT: %.37: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %S: %.37 = bind_symbolic_name S, 0 [symbolic] -// CHECK:STDOUT: %S.patt: %.37 = symbolic_binding_pattern S, 0 [symbolic] +// CHECK:STDOUT: %.33: type = struct_type {.b: Core.IntLiteral, .c: %tuple.type.3} [template] +// CHECK:STDOUT: %.34: type = struct_type {.a: %.33, .d: Core.IntLiteral} [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.27) [template] +// CHECK:STDOUT: %struct.2: %.28 = struct_value (%.27, %tuple) [template] +// CHECK:STDOUT: %struct.3: %.29 = struct_value (%struct.2, %.27) [template] +// CHECK:STDOUT: %.35: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %S: %.35 = bind_symbolic_name S, 0 [symbolic] +// CHECK:STDOUT: %S.patt: %.35 = symbolic_binding_pattern S, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%S) [symbolic] -// CHECK:STDOUT: %.38: type = struct_type {} [template] -// CHECK:STDOUT: %.39: = complete_type_witness %.38 [template] -// CHECK:STDOUT: %.40: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.41: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.42: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %.44: = bound_method %.40, %Convert.15 [template] -// CHECK:STDOUT: %.45: i32 = int_value 1 [template] -// CHECK:STDOUT: %.46: = bound_method %.41, %Convert.15 [template] -// CHECK:STDOUT: %.47: i32 = int_value 2 [template] -// CHECK:STDOUT: %struct.4: %.37 = struct_value (%.45, %.47) [template] +// CHECK:STDOUT: %.36: type = struct_type {} [template] +// CHECK:STDOUT: %.37: = complete_type_witness %.36 [template] +// CHECK:STDOUT: %.38: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.39: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.40: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %.42: = bound_method %.38, %Convert.14 [template] +// CHECK:STDOUT: %.43: = specific_function %.42, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.44: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.45: = bound_method %.39, %Convert.14 [template] +// CHECK:STDOUT: %.46: = specific_function %.45, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.47: %i32 = int_value 2 [template] +// CHECK:STDOUT: %struct.4: %.35 = struct_value (%.44, %.47) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%struct.4) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -99,7 +104,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -115,75 +120,83 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_17.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_17.2: type = converted %int.make_type_32.loc4, %.loc4_17.1 [template = i32] -// CHECK:STDOUT: %.loc4_20: type = struct_type {.a: i32} [template = constants.%.1] -// CHECK:STDOUT: %a_ref.var: ref %.1 = var a_ref -// CHECK:STDOUT: %a_ref: ref %.1 = bind_name a_ref, %a_ref.var -// CHECK:STDOUT: %int.make_type_32.loc5_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int.make_type_32.loc5_22 [template = i32] -// CHECK:STDOUT: %.loc5_22.2: type = converted %int.make_type_32.loc5_22, %.loc5_22.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_36.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc5_32) -// CHECK:STDOUT: %.loc5_36.2: type = value_of_initializer %int.make_type_32.loc5_32 [template = i32] -// CHECK:STDOUT: %.loc5_36.3: type = converted %int.make_type_32.loc5_32, %.loc5_36.2 [template = i32] +// CHECK:STDOUT: %.loc4_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_17.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_17.3: type = converted %int.make_type_signed.loc4, %.loc4_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_20: type = struct_type {.a: %i32} [template = constants.%.2] +// CHECK:STDOUT: %a_ref.var: ref %.2 = var a_ref +// CHECK:STDOUT: %a_ref: ref %.2 = bind_name a_ref, %a_ref.var +// CHECK:STDOUT: %.loc5_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_22: init type = call constants.%Int(%.loc5_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_22.2: type = value_of_initializer %int.make_type_signed.loc5_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_22.3: type = converted %int.make_type_signed.loc5_22, %.loc5_22.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_32: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_32: init type = call constants.%Int(%.loc5_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_36.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc5_32) +// CHECK:STDOUT: %.loc5_36.2: type = value_of_initializer %int.make_type_signed.loc5_32 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_36.3: type = converted %int.make_type_signed.loc5_32, %.loc5_36.2 [template = constants.%i32] // CHECK:STDOUT: %.loc5_36.4: type = converted %.loc5_36.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc5_37: type = struct_type {.b: i32, .c: %tuple.type.2} [template = constants.%.30] -// CHECK:STDOUT: %int.make_type_32.loc5_44: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_44.1: type = value_of_initializer %int.make_type_32.loc5_44 [template = i32] -// CHECK:STDOUT: %.loc5_44.2: type = converted %int.make_type_32.loc5_44, %.loc5_44.1 [template = i32] -// CHECK:STDOUT: %.loc5_47: type = struct_type {.a: %.30, .d: i32} [template = constants.%.31] -// CHECK:STDOUT: %b_ref.var: ref %.31 = var b_ref -// CHECK:STDOUT: %b_ref: ref %.31 = bind_name b_ref, %b_ref.var +// CHECK:STDOUT: %.loc5_37: type = struct_type {.b: %i32, .c: %tuple.type.2} [template = constants.%.28] +// CHECK:STDOUT: %.loc5_44.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_44: init type = call constants.%Int(%.loc5_44.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_44.2: type = value_of_initializer %int.make_type_signed.loc5_44 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_44.3: type = converted %int.make_type_signed.loc5_44, %.loc5_44.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_47: type = struct_type {.a: %.28, .d: %i32} [template = constants.%.29] +// CHECK:STDOUT: %b_ref.var: ref %.29 = var b_ref +// CHECK:STDOUT: %b_ref: ref %.29 = bind_name b_ref, %b_ref.var // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { -// CHECK:STDOUT: %S.patt.loc8_9.1: %.37 = symbolic_binding_pattern S, 0 [symbolic = %S.patt.loc8_9.2 (constants.%S.patt)] -// CHECK:STDOUT: %S.param_patt: %.37 = value_param_pattern %S.patt.loc8_9.1, runtime_param [symbolic = %S.patt.loc8_9.2 (constants.%S.patt)] +// CHECK:STDOUT: %S.patt.loc8_9.1: %.35 = symbolic_binding_pattern S, 0 [symbolic = %S.patt.loc8_9.2 (constants.%S.patt)] +// CHECK:STDOUT: %S.param_patt: %.35 = value_param_pattern %S.patt.loc8_9.1, runtime_param [symbolic = %S.patt.loc8_9.2 (constants.%S.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc8_18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_18.1: type = value_of_initializer %int.make_type_32.loc8_18 [template = i32] -// CHECK:STDOUT: %.loc8_18.2: type = converted %int.make_type_32.loc8_18, %.loc8_18.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc8_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_27.1: type = value_of_initializer %int.make_type_32.loc8_27 [template = i32] -// CHECK:STDOUT: %.loc8_27.2: type = converted %int.make_type_32.loc8_27, %.loc8_27.1 [template = i32] -// CHECK:STDOUT: %.loc8_30: type = struct_type {.a: i32, .b: i32} [template = constants.%.37] -// CHECK:STDOUT: %S.param: %.37 = value_param runtime_param -// CHECK:STDOUT: %S.loc8_9.1: %.37 = bind_symbolic_name S, 0, %S.param [symbolic = %S.loc8_9.2 (constants.%S)] +// CHECK:STDOUT: %.loc8_18.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8_18: init type = call constants.%Int(%.loc8_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_18.2: type = value_of_initializer %int.make_type_signed.loc8_18 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_18.3: type = converted %int.make_type_signed.loc8_18, %.loc8_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_27.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc8_27: init type = call constants.%Int(%.loc8_27.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_27.2: type = value_of_initializer %int.make_type_signed.loc8_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_27.3: type = converted %int.make_type_signed.loc8_27, %.loc8_27.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc8_30: type = struct_type {.a: %i32, .b: %i32} [template = constants.%.35] +// CHECK:STDOUT: %S.param: %.35 = value_param runtime_param +// CHECK:STDOUT: %S.loc8_9.1: %.35 = bind_symbolic_name S, 0, %S.param [symbolic = %S.loc8_9.2 (constants.%S)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %return.patt: %C.3 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C.3 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc9_19: Core.IntLiteral = int_value 1 [template = constants.%.40] -// CHECK:STDOUT: %.loc9_27: Core.IntLiteral = int_value 2 [template = constants.%.41] -// CHECK:STDOUT: %.loc9_28.1: %.42 = struct_literal (%.loc9_19, %.loc9_27) -// CHECK:STDOUT: %.loc9_28.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_28.3: = bound_method %.loc9_19, %.loc9_28.2 [template = constants.%.44] -// CHECK:STDOUT: %int.convert_checked.loc9_28.1: init i32 = call %.loc9_28.3(%.loc9_19) [template = constants.%.45] -// CHECK:STDOUT: %.loc9_28.4: i32 = value_of_initializer %int.convert_checked.loc9_28.1 [template = constants.%.45] -// CHECK:STDOUT: %.loc9_28.5: i32 = converted %.loc9_19, %.loc9_28.4 [template = constants.%.45] -// CHECK:STDOUT: %.loc9_28.6: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_28.7: = bound_method %.loc9_27, %.loc9_28.6 [template = constants.%.46] -// CHECK:STDOUT: %int.convert_checked.loc9_28.2: init i32 = call %.loc9_28.7(%.loc9_27) [template = constants.%.47] -// CHECK:STDOUT: %.loc9_28.8: i32 = value_of_initializer %int.convert_checked.loc9_28.2 [template = constants.%.47] -// CHECK:STDOUT: %.loc9_28.9: i32 = converted %.loc9_27, %.loc9_28.8 [template = constants.%.47] -// CHECK:STDOUT: %struct: %.37 = struct_value (%.loc9_28.5, %.loc9_28.9) [template = constants.%struct.4] -// CHECK:STDOUT: %.loc9_12: %.37 = converted %.loc9_28.1, %struct [template = constants.%struct.4] +// CHECK:STDOUT: %.loc9_19: Core.IntLiteral = int_value 1 [template = constants.%.38] +// CHECK:STDOUT: %.loc9_27: Core.IntLiteral = int_value 2 [template = constants.%.39] +// CHECK:STDOUT: %.loc9_28.1: %.40 = struct_literal (%.loc9_19, %.loc9_27) +// CHECK:STDOUT: %.loc9_28.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_28.3: = bound_method %.loc9_19, %.loc9_28.2 [template = constants.%.42] +// CHECK:STDOUT: %.loc9_28.4: = specific_function %.loc9_28.3, @Convert.2(constants.%.1) [template = constants.%.43] +// CHECK:STDOUT: %int.convert_checked.loc9_28.1: init %i32 = call %.loc9_28.4(%.loc9_19) [template = constants.%.44] +// CHECK:STDOUT: %.loc9_28.5: %i32 = value_of_initializer %int.convert_checked.loc9_28.1 [template = constants.%.44] +// CHECK:STDOUT: %.loc9_28.6: %i32 = converted %.loc9_19, %.loc9_28.5 [template = constants.%.44] +// CHECK:STDOUT: %.loc9_28.7: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_28.8: = bound_method %.loc9_27, %.loc9_28.7 [template = constants.%.45] +// CHECK:STDOUT: %.loc9_28.9: = specific_function %.loc9_28.8, @Convert.2(constants.%.1) [template = constants.%.46] +// CHECK:STDOUT: %int.convert_checked.loc9_28.2: init %i32 = call %.loc9_28.9(%.loc9_27) [template = constants.%.47] +// CHECK:STDOUT: %.loc9_28.10: %i32 = value_of_initializer %int.convert_checked.loc9_28.2 [template = constants.%.47] +// CHECK:STDOUT: %.loc9_28.11: %i32 = converted %.loc9_27, %.loc9_28.10 [template = constants.%.47] +// CHECK:STDOUT: %struct: %.35 = struct_value (%.loc9_28.6, %.loc9_28.11) [template = constants.%struct.4] +// CHECK:STDOUT: %.loc9_12: %.35 = converted %.loc9_28.1, %struct [template = constants.%struct.4] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%struct.4) [template = constants.%C.3] // CHECK:STDOUT: %return.param: ref %C.3 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %C.3 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(%S.loc8_9.1: %.37) { -// CHECK:STDOUT: %S.loc8_9.2: %.37 = bind_symbolic_name S, 0 [symbolic = %S.loc8_9.2 (constants.%S)] -// CHECK:STDOUT: %S.patt.loc8_9.2: %.37 = symbolic_binding_pattern S, 0 [symbolic = %S.patt.loc8_9.2 (constants.%S.patt)] +// CHECK:STDOUT: generic class @C(%S.loc8_9.1: %.35) { +// CHECK:STDOUT: %S.loc8_9.2: %.35 = bind_symbolic_name S, 0 [symbolic = %S.loc8_9.2 (constants.%S)] +// CHECK:STDOUT: %S.patt.loc8_9.2: %.35 = symbolic_binding_pattern S, 0 [symbolic = %S.patt.loc8_9.2 (constants.%S.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc8_34: = complete_type_witness %.38 [template = constants.%.39] +// CHECK:STDOUT: %.loc8_34: = complete_type_witness %.36 [template = constants.%.37] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 @@ -194,46 +207,50 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc4_30: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc4_31.1: %.3 = struct_literal (%.loc4_30) -// CHECK:STDOUT: %.loc4_31.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_31.3: = bound_method %.loc4_30, %.loc4_31.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc4: init i32 = call %.loc4_31.3(%.loc4_30) [template = constants.%.29] -// CHECK:STDOUT: %.loc4_31.4: init i32 = converted %.loc4_30, %int.convert_checked.loc4 [template = constants.%.29] -// CHECK:STDOUT: %.loc4_31.5: init %.1 = struct_init (%.loc4_31.4) to file.%a_ref.var [template = constants.%struct.1] -// CHECK:STDOUT: %.loc4_32: init %.1 = converted %.loc4_31.1, %.loc4_31.5 [template = constants.%struct.1] +// CHECK:STDOUT: %.loc4_30: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc4_31.1: %.4 = struct_literal (%.loc4_30) +// CHECK:STDOUT: %.loc4_31.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_31.3: = bound_method %.loc4_30, %.loc4_31.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc4_31.4: = specific_function %.loc4_31.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %.loc4_31.4(%.loc4_30) [template = constants.%.27] +// CHECK:STDOUT: %.loc4_31.5: init %i32 = converted %.loc4_30, %int.convert_checked.loc4 [template = constants.%.27] +// CHECK:STDOUT: %.loc4_31.6: init %.2 = struct_init (%.loc4_31.5) to file.%a_ref.var [template = constants.%struct.1] +// CHECK:STDOUT: %.loc4_32: init %.2 = converted %.loc4_31.1, %.loc4_31.6 [template = constants.%struct.1] // CHECK:STDOUT: assign file.%a_ref.var, %.loc4_32 -// CHECK:STDOUT: %.loc6_17: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc6_26: Core.IntLiteral = int_value 0 [template = constants.%.2] +// CHECK:STDOUT: %.loc6_17: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc6_26: Core.IntLiteral = int_value 0 [template = constants.%.3] // CHECK:STDOUT: %.loc6_28.1: %tuple.type.3 = tuple_literal (%.loc6_26) -// CHECK:STDOUT: %.loc6_29.1: %.35 = struct_literal (%.loc6_17, %.loc6_28.1) -// CHECK:STDOUT: %.loc6_37: Core.IntLiteral = int_value 0 [template = constants.%.2] -// CHECK:STDOUT: %.loc6_38.1: %.36 = struct_literal (%.loc6_29.1, %.loc6_37) -// CHECK:STDOUT: %.loc6_29.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_29.3: = bound_method %.loc6_17, %.loc6_29.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc6_29: init i32 = call %.loc6_29.3(%.loc6_17) [template = constants.%.29] -// CHECK:STDOUT: %.loc6_29.4: init i32 = converted %.loc6_17, %int.convert_checked.loc6_29 [template = constants.%.29] -// CHECK:STDOUT: %.loc6_38.2: ref %.30 = struct_access file.%b_ref.var, element0 -// CHECK:STDOUT: %.loc6_29.5: ref i32 = struct_access %.loc6_38.2, element0 -// CHECK:STDOUT: %.loc6_29.6: init i32 = initialize_from %.loc6_29.4 to %.loc6_29.5 [template = constants.%.29] -// CHECK:STDOUT: %.loc6_28.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_28.3: = bound_method %.loc6_26, %.loc6_28.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc6_28: init i32 = call %.loc6_28.3(%.loc6_26) [template = constants.%.29] -// CHECK:STDOUT: %.loc6_28.4: init i32 = converted %.loc6_26, %int.convert_checked.loc6_28 [template = constants.%.29] -// CHECK:STDOUT: %.loc6_29.7: ref %tuple.type.2 = struct_access %.loc6_38.2, element1 -// CHECK:STDOUT: %.loc6_28.5: init %tuple.type.2 = tuple_init (%.loc6_28.4) to %.loc6_29.7 [template = constants.%tuple] -// CHECK:STDOUT: %.loc6_29.8: init %tuple.type.2 = converted %.loc6_28.1, %.loc6_28.5 [template = constants.%tuple] -// CHECK:STDOUT: %.loc6_29.9: init %tuple.type.2 = initialize_from %.loc6_29.8 to %.loc6_29.7 [template = constants.%tuple] -// CHECK:STDOUT: %.loc6_29.10: init %.30 = struct_init (%.loc6_29.6, %.loc6_29.9) to %.loc6_38.2 [template = constants.%struct.2] -// CHECK:STDOUT: %.loc6_38.3: init %.30 = converted %.loc6_29.1, %.loc6_29.10 [template = constants.%struct.2] -// CHECK:STDOUT: %.loc6_38.4: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_38.5: = bound_method %.loc6_37, %.loc6_38.4 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc6_38: init i32 = call %.loc6_38.5(%.loc6_37) [template = constants.%.29] -// CHECK:STDOUT: %.loc6_38.6: init i32 = converted %.loc6_37, %int.convert_checked.loc6_38 [template = constants.%.29] -// CHECK:STDOUT: %.loc6_38.7: ref i32 = struct_access file.%b_ref.var, element1 -// CHECK:STDOUT: %.loc6_38.8: init i32 = initialize_from %.loc6_38.6 to %.loc6_38.7 [template = constants.%.29] -// CHECK:STDOUT: %.loc6_38.9: init %.31 = struct_init (%.loc6_38.3, %.loc6_38.8) to file.%b_ref.var [template = constants.%struct.3] -// CHECK:STDOUT: %.loc6_39: init %.31 = converted %.loc6_38.1, %.loc6_38.9 [template = constants.%struct.3] +// CHECK:STDOUT: %.loc6_29.1: %.33 = struct_literal (%.loc6_17, %.loc6_28.1) +// CHECK:STDOUT: %.loc6_37: Core.IntLiteral = int_value 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc6_38.1: %.34 = struct_literal (%.loc6_29.1, %.loc6_37) +// CHECK:STDOUT: %.loc6_29.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_29.3: = bound_method %.loc6_17, %.loc6_29.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc6_29.4: = specific_function %.loc6_29.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc6_29: init %i32 = call %.loc6_29.4(%.loc6_17) [template = constants.%.27] +// CHECK:STDOUT: %.loc6_29.5: init %i32 = converted %.loc6_17, %int.convert_checked.loc6_29 [template = constants.%.27] +// CHECK:STDOUT: %.loc6_38.2: ref %.28 = struct_access file.%b_ref.var, element0 +// CHECK:STDOUT: %.loc6_29.6: ref %i32 = struct_access %.loc6_38.2, element0 +// CHECK:STDOUT: %.loc6_29.7: init %i32 = initialize_from %.loc6_29.5 to %.loc6_29.6 [template = constants.%.27] +// CHECK:STDOUT: %.loc6_28.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_28.3: = bound_method %.loc6_26, %.loc6_28.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc6_28.4: = specific_function %.loc6_28.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %.loc6_28.4(%.loc6_26) [template = constants.%.27] +// CHECK:STDOUT: %.loc6_28.5: init %i32 = converted %.loc6_26, %int.convert_checked.loc6_28 [template = constants.%.27] +// CHECK:STDOUT: %.loc6_29.8: ref %tuple.type.2 = struct_access %.loc6_38.2, element1 +// CHECK:STDOUT: %.loc6_28.6: init %tuple.type.2 = tuple_init (%.loc6_28.5) to %.loc6_29.8 [template = constants.%tuple] +// CHECK:STDOUT: %.loc6_29.9: init %tuple.type.2 = converted %.loc6_28.1, %.loc6_28.6 [template = constants.%tuple] +// CHECK:STDOUT: %.loc6_29.10: init %tuple.type.2 = initialize_from %.loc6_29.9 to %.loc6_29.8 [template = constants.%tuple] +// CHECK:STDOUT: %.loc6_29.11: init %.28 = struct_init (%.loc6_29.7, %.loc6_29.10) to %.loc6_38.2 [template = constants.%struct.2] +// CHECK:STDOUT: %.loc6_38.3: init %.28 = converted %.loc6_29.1, %.loc6_29.11 [template = constants.%struct.2] +// CHECK:STDOUT: %.loc6_38.4: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_38.5: = bound_method %.loc6_37, %.loc6_38.4 [template = constants.%.25] +// CHECK:STDOUT: %.loc6_38.6: = specific_function %.loc6_38.5, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc6_38: init %i32 = call %.loc6_38.6(%.loc6_37) [template = constants.%.27] +// CHECK:STDOUT: %.loc6_38.7: init %i32 = converted %.loc6_37, %int.convert_checked.loc6_38 [template = constants.%.27] +// CHECK:STDOUT: %.loc6_38.8: ref %i32 = struct_access file.%b_ref.var, element1 +// CHECK:STDOUT: %.loc6_38.9: init %i32 = initialize_from %.loc6_38.7 to %.loc6_38.8 [template = constants.%.27] +// CHECK:STDOUT: %.loc6_38.10: init %.29 = struct_init (%.loc6_38.3, %.loc6_38.9) to file.%b_ref.var [template = constants.%struct.3] +// CHECK:STDOUT: %.loc6_39: init %.29 = converted %.loc6_38.1, %.loc6_38.10 [template = constants.%struct.3] // CHECK:STDOUT: assign file.%b_ref.var, %.loc6_39 // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -251,159 +268,146 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: --- implicit.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, imports.%import_ref.11 [symbolic] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.12 [template] -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %.5: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%.5)> [symbolic] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: = interface_witness (%Convert.2) [symbolic] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.3, @impl.2(%N) [symbolic] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic] -// CHECK:STDOUT: %.6: = interface_witness (%Convert.3) [symbolic] -// CHECK:STDOUT: %.7: type = int_type unsigned, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %.4: = interface_witness (%Convert.3) [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.4, @impl.3(%N) [symbolic] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] -// CHECK:STDOUT: %.8: = interface_witness (%Convert.4) [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %.5: = interface_witness (%Convert.4) [symbolic] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.5 [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.22 [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.5, %Convert.type.5 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.18 [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.5, @impl.4(%N) [symbolic] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] -// CHECK:STDOUT: %.11: = interface_witness (%Convert.6) [symbolic] -// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] -// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] -// CHECK:STDOUT: %.12: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %.8: = interface_witness (%Convert.6) [symbolic] // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] // CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%iN)> [symbolic] // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.9: type = assoc_entity_type %As.type.2, %Convert.type.7 [symbolic] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.28 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.7, @impl.5(%N) [symbolic] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] -// CHECK:STDOUT: %.13: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] -// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.35 [symbolic] -// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] -// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] -// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.36 [template] -// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.5)> [symbolic] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.8) [symbolic] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.8, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.9) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.9, @impl.7(%N) [symbolic] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] -// CHECK:STDOUT: %.17: = interface_witness (%Convert.10) [symbolic] -// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] -// CHECK:STDOUT: %.18: = interface_witness (%Convert.11) [symbolic] -// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] -// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] -// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.46 [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] -// CHECK:STDOUT: %.21: = interface_witness (%Convert.13) [symbolic] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] -// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.23: type = struct_type {.a: i32} [template] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %.14: type = assoc_entity_type %As.type.5, %Convert.type.11 [template] +// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.35 [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.12) [symbolic] +// CHECK:STDOUT: %.17: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.17 [template] +// CHECK:STDOUT: %.18: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.24: type = struct_type {.b: i32, .c: %tuple.type.2} [template] -// CHECK:STDOUT: %.25: type = struct_type {.a: %.24, .d: i32} [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] +// CHECK:STDOUT: %.19: type = struct_type {.b: %i32, .c: %tuple.type.2} [template] +// CHECK:STDOUT: %.20: type = struct_type {.a: %.19, .d: %i32} [template] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] -// CHECK:STDOUT: %.31: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %S: %.31 = bind_symbolic_name S, 0 [symbolic] -// CHECK:STDOUT: %S.patt: %.31 = symbolic_binding_pattern S, 0 [symbolic] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.33: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.34: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %.36: %.1 = assoc_entity element0, imports.%import_ref.56 [symbolic] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.37: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.38: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.39: i32 = int_value 1 [template] -// CHECK:STDOUT: %.40: = bound_method %.33, %Convert.15 [template] -// CHECK:STDOUT: %.41: i32 = int_value 2 [template] -// CHECK:STDOUT: %struct: %.31 = struct_value (%.39, %.41) [template] +// CHECK:STDOUT: %.26: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %S: %.26 = bind_symbolic_name S, 0 [symbolic] +// CHECK:STDOUT: %S.patt: %.26 = symbolic_binding_pattern S, 0 [symbolic] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.29: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] +// CHECK:STDOUT: %.31: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.13 [template] +// CHECK:STDOUT: %.32: %.31 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %.33: %.1 = assoc_entity element0, imports.%import_ref.42 [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.17) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.34: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.35: = bound_method %.27, %Convert.14 [template] +// CHECK:STDOUT: %.36: = specific_function %.35, @Convert.2(%.17) [template] +// CHECK:STDOUT: %.37: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.38: = bound_method %.28, %Convert.14 [template] +// CHECK:STDOUT: %.39: = specific_function %.38, @Convert.2(%.17) [template] +// CHECK:STDOUT: %.40: %i32 = int_value 2 [template] +// CHECK:STDOUT: %struct: %.26 = struct_value (%.37, %.40) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%struct) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: ref %.23 = import_ref Implicit//default, inst+17, loaded -// CHECK:STDOUT: %import_ref.2: ref %.25 = import_ref Implicit//default, inst+411, loaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+465, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+505, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1: ref %.18 = import_ref Implicit//default, inst+24, loaded +// CHECK:STDOUT: %import_ref.2: ref %.20 = import_ref Implicit//default, inst+393, loaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+452, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+496, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.53 -// CHECK:STDOUT: .ImplicitAs = %import_ref.55 +// CHECK:STDOUT: .Int = %import_ref.39 +// CHECK:STDOUT: .ImplicitAs = %import_ref.41 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+35, unloaded -// CHECK:STDOUT: %import_ref.6: @ImplicitAs.%.1 (%.1) = import_ref Implicit//default, inst+36, loaded [symbolic = @ImplicitAs.%.2 (constants.%.36)] -// CHECK:STDOUT: %import_ref.7 = import_ref Implicit//default, inst+37, unloaded -// CHECK:STDOUT: %import_ref.8: type = import_ref Implicit//default, inst+71, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.9: type = import_ref Implicit//default, inst+72, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.10: = import_ref Implicit//default, inst+73, loaded [template = constants.%.37] -// CHECK:STDOUT: %import_ref.11 = import_ref Implicit//default, inst+52, unloaded -// CHECK:STDOUT: %import_ref.13: type = import_ref Implicit//default, inst+83, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.14: type = import_ref Implicit//default, inst+84, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] -// CHECK:STDOUT: %import_ref.15 = import_ref Implicit//default, inst+85, unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref Implicit//default, inst+113, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.17: type = import_ref Implicit//default, inst+114, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.5)] -// CHECK:STDOUT: %import_ref.18 = import_ref Implicit//default, inst+115, unloaded -// CHECK:STDOUT: %import_ref.19: type = import_ref Implicit//default, inst+138, loaded [template = i32] -// CHECK:STDOUT: %import_ref.20: type = import_ref Implicit//default, inst+139, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.21 = import_ref Implicit//default, inst+140, unloaded -// CHECK:STDOUT: %import_ref.23: type = import_ref Implicit//default, inst+151, loaded [symbolic = @impl.5.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.24: type = import_ref Implicit//default, inst+152, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.25 = import_ref Implicit//default, inst+153, unloaded -// CHECK:STDOUT: %import_ref.26: type = import_ref Implicit//default, inst+178, loaded [symbolic = @impl.6.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.27: type = import_ref Implicit//default, inst+179, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.28 = import_ref Implicit//default, inst+180, unloaded -// CHECK:STDOUT: %import_ref.29 = import_ref Implicit//default, inst+210, unloaded -// CHECK:STDOUT: %import_ref.30 = import_ref Implicit//default, inst+211, unloaded -// CHECK:STDOUT: %import_ref.31 = import_ref Implicit//default, inst+212, unloaded -// CHECK:STDOUT: %import_ref.32: type = import_ref Implicit//default, inst+214, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.33: type = import_ref Implicit//default, inst+215, loaded [template = constants.%As.type.3] -// CHECK:STDOUT: %import_ref.34 = import_ref Implicit//default, inst+216, unloaded -// CHECK:STDOUT: %import_ref.35 = import_ref Implicit//default, inst+231, unloaded -// CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+253, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.38: type = import_ref Implicit//default, inst+254, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] -// CHECK:STDOUT: %import_ref.39 = import_ref Implicit//default, inst+255, unloaded -// CHECK:STDOUT: %import_ref.40: type = import_ref Implicit//default, inst+282, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.41: type = import_ref Implicit//default, inst+283, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] -// CHECK:STDOUT: %import_ref.42 = import_ref Implicit//default, inst+284, unloaded -// CHECK:STDOUT: %import_ref.43: type = import_ref Implicit//default, inst+307, loaded [template = i32] -// CHECK:STDOUT: %import_ref.44: type = import_ref Implicit//default, inst+308, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.45 = import_ref Implicit//default, inst+309, unloaded -// CHECK:STDOUT: %import_ref.47: type = import_ref Implicit//default, inst+320, loaded [symbolic = @impl.11.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.48: type = import_ref Implicit//default, inst+321, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.49 = import_ref Implicit//default, inst+322, unloaded -// CHECK:STDOUT: %import_ref.50: type = import_ref Implicit//default, inst+347, loaded [symbolic = @impl.12.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.51: type = import_ref Implicit//default, inst+348, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.52 = import_ref Implicit//default, inst+349, unloaded -// CHECK:STDOUT: %import_ref.54 = import_ref Implicit//default, inst+470, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+42, unloaded +// CHECK:STDOUT: %import_ref.6: @ImplicitAs.%.1 (%.1) = import_ref Implicit//default, inst+43, loaded [symbolic = @ImplicitAs.%.2 (constants.%.33)] +// CHECK:STDOUT: %import_ref.7 = import_ref Implicit//default, inst+44, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Implicit//default, inst+86, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Implicit//default, inst+87, loaded [symbolic = @impl.1.%ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: %import_ref.10: = import_ref Implicit//default, inst+88, loaded [symbolic = @impl.1.%.1 (constants.%.3)] +// CHECK:STDOUT: %import_ref.11 = import_ref Implicit//default, inst+59, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Implicit//default, inst+116, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Implicit//default, inst+117, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %import_ref.14 = import_ref Implicit//default, inst+118, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Implicit//default, inst+145, loaded [symbolic = @impl.3.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.16: type = import_ref Implicit//default, inst+146, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.17 = import_ref Implicit//default, inst+147, unloaded +// CHECK:STDOUT: %import_ref.19: type = import_ref Implicit//default, inst+177, loaded [symbolic = @impl.4.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.20: type = import_ref Implicit//default, inst+178, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.21 = import_ref Implicit//default, inst+179, unloaded +// CHECK:STDOUT: %import_ref.22 = import_ref Implicit//default, inst+209, unloaded +// CHECK:STDOUT: %import_ref.23 = import_ref Implicit//default, inst+210, unloaded +// CHECK:STDOUT: %import_ref.24 = import_ref Implicit//default, inst+211, unloaded +// CHECK:STDOUT: %import_ref.25: type = import_ref Implicit//default, inst+217, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.26: type = import_ref Implicit//default, inst+218, loaded [symbolic = @impl.5.%As.type (constants.%As.type.3)] +// CHECK:STDOUT: %import_ref.27 = import_ref Implicit//default, inst+219, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Implicit//default, inst+234, unloaded +// CHECK:STDOUT: %import_ref.29: type = import_ref Implicit//default, inst+271, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.30: type = import_ref Implicit//default, inst+272, loaded [symbolic = @impl.6.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.31 = import_ref Implicit//default, inst+273, unloaded +// CHECK:STDOUT: %import_ref.32: type = import_ref Implicit//default, inst+300, loaded [symbolic = @impl.7.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.33: type = import_ref Implicit//default, inst+301, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.34 = import_ref Implicit//default, inst+302, unloaded +// CHECK:STDOUT: %import_ref.36: type = import_ref Implicit//default, inst+332, loaded [symbolic = @impl.8.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+333, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.38 = import_ref Implicit//default, inst+334, unloaded +// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst+457, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -420,43 +424,49 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_32.loc4, %.loc4_13.1 [template = i32] -// CHECK:STDOUT: %.loc4_16: type = struct_type {.a: i32} [template = constants.%.23] -// CHECK:STDOUT: %a.var: ref %.23 = var a -// CHECK:STDOUT: %a: ref %.23 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc5_18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_18.1: type = value_of_initializer %int.make_type_32.loc5_18 [template = i32] -// CHECK:STDOUT: %.loc5_18.2: type = converted %int.make_type_32.loc5_18, %.loc5_18.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_28: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_32.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc5_28) -// CHECK:STDOUT: %.loc5_32.2: type = value_of_initializer %int.make_type_32.loc5_28 [template = i32] -// CHECK:STDOUT: %.loc5_32.3: type = converted %int.make_type_32.loc5_28, %.loc5_32.2 [template = i32] +// CHECK:STDOUT: %.loc4_13.1: Core.IntLiteral = int_value 32 [template = constants.%.17] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_13.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_13.3: type = converted %int.make_type_signed.loc4, %.loc4_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_16: type = struct_type {.a: %i32} [template = constants.%.18] +// CHECK:STDOUT: %a.var: ref %.18 = var a +// CHECK:STDOUT: %a: ref %.18 = bind_name a, %a.var +// CHECK:STDOUT: %.loc5_18.1: Core.IntLiteral = int_value 32 [template = constants.%.17] +// CHECK:STDOUT: %int.make_type_signed.loc5_18: init type = call constants.%Int(%.loc5_18.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_18.2: type = value_of_initializer %int.make_type_signed.loc5_18 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_18.3: type = converted %int.make_type_signed.loc5_18, %.loc5_18.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_28: Core.IntLiteral = int_value 32 [template = constants.%.17] +// CHECK:STDOUT: %int.make_type_signed.loc5_28: init type = call constants.%Int(%.loc5_28) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_32.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc5_28) +// CHECK:STDOUT: %.loc5_32.2: type = value_of_initializer %int.make_type_signed.loc5_28 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_32.3: type = converted %int.make_type_signed.loc5_28, %.loc5_32.2 [template = constants.%i32] // CHECK:STDOUT: %.loc5_32.4: type = converted %.loc5_32.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc5_33: type = struct_type {.b: i32, .c: %tuple.type.2} [template = constants.%.24] -// CHECK:STDOUT: %int.make_type_32.loc5_40: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_40.1: type = value_of_initializer %int.make_type_32.loc5_40 [template = i32] -// CHECK:STDOUT: %.loc5_40.2: type = converted %int.make_type_32.loc5_40, %.loc5_40.1 [template = i32] -// CHECK:STDOUT: %.loc5_43: type = struct_type {.a: %.24, .d: i32} [template = constants.%.25] -// CHECK:STDOUT: %b.var: ref %.25 = var b -// CHECK:STDOUT: %b: ref %.25 = bind_name b, %b.var +// CHECK:STDOUT: %.loc5_33: type = struct_type {.b: %i32, .c: %tuple.type.2} [template = constants.%.19] +// CHECK:STDOUT: %.loc5_40.1: Core.IntLiteral = int_value 32 [template = constants.%.17] +// CHECK:STDOUT: %int.make_type_signed.loc5_40: init type = call constants.%Int(%.loc5_40.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_40.2: type = value_of_initializer %int.make_type_signed.loc5_40 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_40.3: type = converted %int.make_type_signed.loc5_40, %.loc5_40.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_43: type = struct_type {.a: %.19, .d: %i32} [template = constants.%.20] +// CHECK:STDOUT: %b.var: ref %.20 = var b +// CHECK:STDOUT: %b: ref %.20 = bind_name b, %b.var // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] -// CHECK:STDOUT: %.loc6_16: Core.IntLiteral = int_value 1 [template = constants.%.32] -// CHECK:STDOUT: %.loc6_24: Core.IntLiteral = int_value 2 [template = constants.%.33] -// CHECK:STDOUT: %.loc6_25.1: %.34 = struct_literal (%.loc6_16, %.loc6_24) -// CHECK:STDOUT: %.loc6_25.2: %Convert.type.2 = interface_witness_access constants.%.37, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_25.3: = bound_method %.loc6_16, %.loc6_25.2 [template = constants.%.38] -// CHECK:STDOUT: %int.convert_checked.loc6_25.1: init i32 = call %.loc6_25.3(%.loc6_16) [template = constants.%.39] -// CHECK:STDOUT: %.loc6_25.4: i32 = value_of_initializer %int.convert_checked.loc6_25.1 [template = constants.%.39] -// CHECK:STDOUT: %.loc6_25.5: i32 = converted %.loc6_16, %.loc6_25.4 [template = constants.%.39] -// CHECK:STDOUT: %.loc6_25.6: %Convert.type.2 = interface_witness_access constants.%.37, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_25.7: = bound_method %.loc6_24, %.loc6_25.6 [template = constants.%.40] -// CHECK:STDOUT: %int.convert_checked.loc6_25.2: init i32 = call %.loc6_25.7(%.loc6_24) [template = constants.%.41] -// CHECK:STDOUT: %.loc6_25.8: i32 = value_of_initializer %int.convert_checked.loc6_25.2 [template = constants.%.41] -// CHECK:STDOUT: %.loc6_25.9: i32 = converted %.loc6_24, %.loc6_25.8 [template = constants.%.41] -// CHECK:STDOUT: %struct: %.31 = struct_value (%.loc6_25.5, %.loc6_25.9) [template = constants.%struct] -// CHECK:STDOUT: %.loc6_9: %.31 = converted %.loc6_25.1, %struct [template = constants.%struct] +// CHECK:STDOUT: %.loc6_16: Core.IntLiteral = int_value 1 [template = constants.%.27] +// CHECK:STDOUT: %.loc6_24: Core.IntLiteral = int_value 2 [template = constants.%.28] +// CHECK:STDOUT: %.loc6_25.1: %.29 = struct_literal (%.loc6_16, %.loc6_24) +// CHECK:STDOUT: %.loc6_25.2: %Convert.type.13 = interface_witness_access constants.%.34, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_25.3: = bound_method %.loc6_16, %.loc6_25.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc6_25.4: = specific_function %.loc6_25.3, @Convert.2(constants.%.17) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc6_25.1: init %i32 = call %.loc6_25.4(%.loc6_16) [template = constants.%.37] +// CHECK:STDOUT: %.loc6_25.5: %i32 = value_of_initializer %int.convert_checked.loc6_25.1 [template = constants.%.37] +// CHECK:STDOUT: %.loc6_25.6: %i32 = converted %.loc6_16, %.loc6_25.5 [template = constants.%.37] +// CHECK:STDOUT: %.loc6_25.7: %Convert.type.13 = interface_witness_access constants.%.34, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_25.8: = bound_method %.loc6_24, %.loc6_25.7 [template = constants.%.38] +// CHECK:STDOUT: %.loc6_25.9: = specific_function %.loc6_25.8, @Convert.2(constants.%.17) [template = constants.%.39] +// CHECK:STDOUT: %int.convert_checked.loc6_25.2: init %i32 = call %.loc6_25.9(%.loc6_24) [template = constants.%.40] +// CHECK:STDOUT: %.loc6_25.10: %i32 = value_of_initializer %int.convert_checked.loc6_25.2 [template = constants.%.40] +// CHECK:STDOUT: %.loc6_25.11: %i32 = converted %.loc6_24, %.loc6_25.10 [template = constants.%.40] +// CHECK:STDOUT: %struct: %.26 = struct_value (%.loc6_25.6, %.loc6_25.11) [template = constants.%struct] +// CHECK:STDOUT: %.loc6_9: %.26 = converted %.loc6_25.1, %struct [template = constants.%struct] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%struct) [template = constants.%C.3] // CHECK:STDOUT: %c.var: ref %C.3 = var c // CHECK:STDOUT: %c: ref %C.3 = bind_name c, %c.var @@ -489,180 +499,160 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] -// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.13)] -// CHECK:STDOUT: %.2: @As.%.1 (%.13) = assoc_entity element0, imports.%import_ref.35 [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.7) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %.2: @As.%.1 (%.9) = assoc_entity element0, imports.%import_ref.28 [symbolic = %.2 (constants.%.10)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.29 -// CHECK:STDOUT: .Convert = imports.%import_ref.30 -// CHECK:STDOUT: witness = (imports.%import_ref.31) +// CHECK:STDOUT: .Self = imports.%import_ref.22 +// CHECK:STDOUT: .Convert = imports.%import_ref.23 +// CHECK:STDOUT: witness = (imports.%import_ref.24) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: generic impl @impl.1(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.1(%N) [symbolic = %Convert.type (constants.%Convert.type.2)] +// CHECK:STDOUT: %Convert: @impl.1.%Convert.type (%Convert.type.2) = struct_value () [symbolic = %Convert (constants.%Convert.2)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] // CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.13 as imports.%import_ref.14 { +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.15 +// CHECK:STDOUT: witness = imports.%import_ref.14 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] // CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.16 as imports.%import_ref.17 { +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.18 +// CHECK:STDOUT: witness = imports.%import_ref.17 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.19 as imports.%import_ref.20 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.21 +// CHECK:STDOUT: generic impl @impl.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.4(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.4.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.19 as imports.%import_ref.20 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.21 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%iN)> [symbolic = %As.type (constants.%As.type.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] -// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.23 as imports.%import_ref.24 { +// CHECK:STDOUT: impl: imports.%import_ref.25 as imports.%import_ref.26 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.25 +// CHECK:STDOUT: witness = imports.%import_ref.27 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%uN)> [symbolic = %As.type (constants.%As.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] -// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.9)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.26 as imports.%import_ref.27 { +// CHECK:STDOUT: impl: imports.%import_ref.29 as imports.%import_ref.30 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.28 +// CHECK:STDOUT: witness = imports.%import_ref.31 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.7: imports.%import_ref.32 as imports.%import_ref.33 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.34 +// CHECK:STDOUT: generic impl @impl.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.7(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.7.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.32 as imports.%import_ref.33 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.34 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] -// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.12)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.12) = struct_value () [symbolic = %Convert (constants.%Convert.12)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.37 as imports.%import_ref.38 { +// CHECK:STDOUT: impl: imports.%import_ref.36 as imports.%import_ref.37 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.39 +// CHECK:STDOUT: witness = imports.%import_ref.38 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] -// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.40 as imports.%import_ref.41 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.42 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.10: imports.%import_ref.43 as imports.%import_ref.44 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.45 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] -// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.47 as imports.%import_ref.48 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.49 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] -// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.50 as imports.%import_ref.51 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.52 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%S: %.31) { -// CHECK:STDOUT: %S: %.31 = bind_symbolic_name S, 0 [symbolic = %S (constants.%S)] -// CHECK:STDOUT: %S.patt: %.31 = symbolic_binding_pattern S, 0 [symbolic = %S.patt (constants.%S.patt)] +// CHECK:STDOUT: generic class @C(constants.%S: %.26) { +// CHECK:STDOUT: %S: %.26 = bind_symbolic_name S, 0 [symbolic = %S (constants.%S)] +// CHECK:STDOUT: %S.patt: %.26 = symbolic_binding_pattern S, 0 [symbolic = %S.patt (constants.%S.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.54 +// CHECK:STDOUT: .Self = imports.%import_ref.40 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -676,38 +666,38 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { @@ -720,74 +710,72 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.11[%self.param_patt: Core.IntLiteral]() -> i32 = "int.convert_checked"; -// CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %C.3; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a_ref.ref: ref %.23 = name_ref a_ref, imports.%import_ref.1 -// CHECK:STDOUT: %.loc4_20.1: ref i32 = struct_access %a_ref.ref, element0 -// CHECK:STDOUT: %.loc4_20.2: i32 = bind_value %.loc4_20.1 -// CHECK:STDOUT: %.loc4_20.3: init %.23 = struct_init (%.loc4_20.2) to file.%a.var -// CHECK:STDOUT: %.loc4_25: init %.23 = converted %a_ref.ref, %.loc4_20.3 +// CHECK:STDOUT: %a_ref.ref: ref %.18 = name_ref a_ref, imports.%import_ref.1 +// CHECK:STDOUT: %.loc4_20.1: ref %i32 = struct_access %a_ref.ref, element0 +// CHECK:STDOUT: %.loc4_20.2: %i32 = bind_value %.loc4_20.1 +// CHECK:STDOUT: %.loc4_20.3: init %.18 = struct_init (%.loc4_20.2) to file.%a.var +// CHECK:STDOUT: %.loc4_25: init %.18 = converted %a_ref.ref, %.loc4_20.3 // CHECK:STDOUT: assign file.%a.var, %.loc4_25 -// CHECK:STDOUT: %b_ref.ref: ref %.25 = name_ref b_ref, imports.%import_ref.2 -// CHECK:STDOUT: %.loc5_47.1: ref %.24 = struct_access %b_ref.ref, element0 -// CHECK:STDOUT: %.loc5_47.2: ref i32 = struct_access %.loc5_47.1, element0 -// CHECK:STDOUT: %.loc5_47.3: i32 = bind_value %.loc5_47.2 -// CHECK:STDOUT: %.loc5_47.4: ref %.24 = struct_access file.%b.var, element0 -// CHECK:STDOUT: %.loc5_47.5: ref i32 = struct_access %.loc5_47.4, element0 -// CHECK:STDOUT: %.loc5_47.6: init i32 = initialize_from %.loc5_47.3 to %.loc5_47.5 +// CHECK:STDOUT: %b_ref.ref: ref %.20 = name_ref b_ref, imports.%import_ref.2 +// CHECK:STDOUT: %.loc5_47.1: ref %.19 = struct_access %b_ref.ref, element0 +// CHECK:STDOUT: %.loc5_47.2: ref %i32 = struct_access %.loc5_47.1, element0 +// CHECK:STDOUT: %.loc5_47.3: %i32 = bind_value %.loc5_47.2 +// CHECK:STDOUT: %.loc5_47.4: ref %.19 = struct_access file.%b.var, element0 +// CHECK:STDOUT: %.loc5_47.5: ref %i32 = struct_access %.loc5_47.4, element0 +// CHECK:STDOUT: %.loc5_47.6: init %i32 = initialize_from %.loc5_47.3 to %.loc5_47.5 // CHECK:STDOUT: %.loc5_47.7: ref %tuple.type.2 = struct_access %.loc5_47.1, element1 -// CHECK:STDOUT: %.loc5_47.8: ref i32 = tuple_access %.loc5_47.7, element0 -// CHECK:STDOUT: %.loc5_47.9: i32 = bind_value %.loc5_47.8 +// CHECK:STDOUT: %.loc5_47.8: ref %i32 = tuple_access %.loc5_47.7, element0 +// CHECK:STDOUT: %.loc5_47.9: %i32 = bind_value %.loc5_47.8 // CHECK:STDOUT: %.loc5_47.10: ref %tuple.type.2 = struct_access %.loc5_47.4, element1 // CHECK:STDOUT: %.loc5_47.11: init %tuple.type.2 = tuple_init (%.loc5_47.9) to %.loc5_47.10 // CHECK:STDOUT: %.loc5_47.12: init %tuple.type.2 = converted %.loc5_47.7, %.loc5_47.11 // CHECK:STDOUT: %.loc5_47.13: init %tuple.type.2 = initialize_from %.loc5_47.12 to %.loc5_47.10 -// CHECK:STDOUT: %.loc5_47.14: init %.24 = struct_init (%.loc5_47.6, %.loc5_47.13) to %.loc5_47.4 -// CHECK:STDOUT: %.loc5_47.15: init %.24 = converted %.loc5_47.1, %.loc5_47.14 -// CHECK:STDOUT: %.loc5_47.16: ref i32 = struct_access %b_ref.ref, element1 -// CHECK:STDOUT: %.loc5_47.17: i32 = bind_value %.loc5_47.16 -// CHECK:STDOUT: %.loc5_47.18: ref i32 = struct_access file.%b.var, element1 -// CHECK:STDOUT: %.loc5_47.19: init i32 = initialize_from %.loc5_47.17 to %.loc5_47.18 -// CHECK:STDOUT: %.loc5_47.20: init %.25 = struct_init (%.loc5_47.15, %.loc5_47.19) to file.%b.var -// CHECK:STDOUT: %.loc5_52: init %.25 = converted %b_ref.ref, %.loc5_47.20 +// CHECK:STDOUT: %.loc5_47.14: init %.19 = struct_init (%.loc5_47.6, %.loc5_47.13) to %.loc5_47.4 +// CHECK:STDOUT: %.loc5_47.15: init %.19 = converted %.loc5_47.1, %.loc5_47.14 +// CHECK:STDOUT: %.loc5_47.16: ref %i32 = struct_access %b_ref.ref, element1 +// CHECK:STDOUT: %.loc5_47.17: %i32 = bind_value %.loc5_47.16 +// CHECK:STDOUT: %.loc5_47.18: ref %i32 = struct_access file.%b.var, element1 +// CHECK:STDOUT: %.loc5_47.19: init %i32 = initialize_from %.loc5_47.17 to %.loc5_47.18 +// CHECK:STDOUT: %.loc5_47.20: init %.20 = struct_init (%.loc5_47.15, %.loc5_47.19) to file.%b.var +// CHECK:STDOUT: %.loc5_52: init %.20 = converted %b_ref.ref, %.loc5_47.20 // CHECK:STDOUT: assign file.%b.var, %.loc5_52 // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] // CHECK:STDOUT: %.loc6: ref %C.3 = splice_block file.%c.var {} @@ -801,17 +789,9 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 -// CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 -// CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.1 => constants.%.3 -// CHECK:STDOUT: %.2 => constants.%.4 +// CHECK:STDOUT: specific @ImplicitAs(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(%Dest) { @@ -819,6 +799,25 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.1.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -830,62 +829,38 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @ImplicitAs(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { @@ -893,46 +868,46 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5 // CHECK:STDOUT: %Convert => constants.%Convert.5 -// CHECK:STDOUT: %.1 => constants.%.9 -// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: specific @impl.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: specific @impl.3(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: specific @impl.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(%N) { +// CHECK:STDOUT: specific @impl.4(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.5(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%Dest) { @@ -940,17 +915,9 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.3 -// CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 -// CHECK:STDOUT: %Convert => constants.%Convert.9 -// CHECK:STDOUT: %.1 => constants.%.15 -// CHECK:STDOUT: %.2 => constants.%.16 +// CHECK:STDOUT: specific @As(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(%Dest) { @@ -958,6 +925,25 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.5.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @As(@Convert.6.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -969,62 +955,38 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.8.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.9.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(@impl.6.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: specific @impl.6(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(%N) { +// CHECK:STDOUT: specific @impl.6(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(Core.IntLiteral) { @@ -1032,46 +994,46 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %As.type => constants.%As.type.5 // CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 -// CHECK:STDOUT: %Convert => constants.%Convert.12 -// CHECK:STDOUT: %.1 => constants.%.19 -// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.11 +// CHECK:STDOUT: %Convert => constants.%Convert.11 +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.2 => constants.%.15 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: specific @impl.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(%N) { +// CHECK:STDOUT: specific @impl.7(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.9(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: specific @impl.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(%N) { +// CHECK:STDOUT: specific @impl.8(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.10(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%S) { @@ -1079,6 +1041,38 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %S.patt => constants.%S // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%i32) { +// CHECK:STDOUT: %Dest => constants.%i32 +// CHECK:STDOUT: %Dest.patt => constants.%i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.13 +// CHECK:STDOUT: %Convert => constants.%Convert.13 +// CHECK:STDOUT: %.1 => constants.%.31 +// CHECK:STDOUT: %.2 => constants.%.32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(constants.%.17) { +// CHECK:STDOUT: %N => constants.%.17 +// CHECK:STDOUT: %N.patt => constants.%.17 +// CHECK:STDOUT: %iN => constants.%i32 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.14 +// CHECK:STDOUT: %Convert => constants.%Convert.14 +// CHECK:STDOUT: %.1 => constants.%.34 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%.17) { +// CHECK:STDOUT: %N => constants.%.17 +// CHECK:STDOUT: %iN => constants.%i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%struct) { // CHECK:STDOUT: %S => constants.%struct // CHECK:STDOUT: %S.patt => constants.%struct @@ -1089,144 +1083,124 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: --- fail_bad_type.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, imports.%import_ref.11 [symbolic] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.12 [template] -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %.5: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%.5)> [symbolic] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: = interface_witness (%Convert.2) [symbolic] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.3, @impl.2(%N) [symbolic] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic] -// CHECK:STDOUT: %.6: = interface_witness (%Convert.3) [symbolic] -// CHECK:STDOUT: %.7: type = int_type unsigned, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %.4: = interface_witness (%Convert.3) [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.4, @impl.3(%N) [symbolic] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] -// CHECK:STDOUT: %.8: = interface_witness (%Convert.4) [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %.5: = interface_witness (%Convert.4) [symbolic] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.5 [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.22 [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.5, %Convert.type.5 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.18 [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.5, @impl.4(%N) [symbolic] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] -// CHECK:STDOUT: %.11: = interface_witness (%Convert.6) [symbolic] -// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] -// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] -// CHECK:STDOUT: %.12: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %.8: = interface_witness (%Convert.6) [symbolic] // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] // CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%iN)> [symbolic] // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.9: type = assoc_entity_type %As.type.2, %Convert.type.7 [symbolic] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.28 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.7, @impl.5(%N) [symbolic] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] -// CHECK:STDOUT: %.13: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] -// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.35 [symbolic] -// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] -// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] -// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.36 [template] -// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.5)> [symbolic] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.8) [symbolic] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.8, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.9) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.9, @impl.7(%N) [symbolic] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] -// CHECK:STDOUT: %.17: = interface_witness (%Convert.10) [symbolic] -// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] -// CHECK:STDOUT: %.18: = interface_witness (%Convert.11) [symbolic] -// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] -// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] -// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.46 [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] -// CHECK:STDOUT: %.21: = interface_witness (%Convert.13) [symbolic] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] -// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %.14: type = assoc_entity_type %As.type.5, %Convert.type.11 [template] +// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.35 [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.12) [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] -// CHECK:STDOUT: %.25: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %S: %.25 = bind_symbolic_name S, 0 [symbolic] -// CHECK:STDOUT: %S.patt: %.25 = symbolic_binding_pattern S, 0 [symbolic] -// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.28: type = struct_type {.c: Core.IntLiteral, .d: Core.IntLiteral} [template] +// CHECK:STDOUT: %.19: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.19 [template] +// CHECK:STDOUT: %.20: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %S: %.20 = bind_symbolic_name S, 0 [symbolic] +// CHECK:STDOUT: %S.patt: %.20 = symbolic_binding_pattern S, 0 [symbolic] +// CHECK:STDOUT: %.21: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.22: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.23: type = struct_type {.c: Core.IntLiteral, .d: Core.IntLiteral} [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.30: i32 = int_value 2 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %struct: %.25 = struct_value (%.31, %.30) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.26: %i32 = int_value 1 [template] +// CHECK:STDOUT: %struct: %.20 = struct_value (%.26, %.25) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%struct) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+17, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+411, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+465, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+505, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+24, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+393, unloaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+452, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+496, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+35, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Implicit//default, inst+36, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Implicit//default, inst+37, unloaded -// CHECK:STDOUT: %import_ref.8: type = import_ref Implicit//default, inst+71, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.9: type = import_ref Implicit//default, inst+72, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.10 = import_ref Implicit//default, inst+73, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Implicit//default, inst+52, unloaded -// CHECK:STDOUT: %import_ref.13: type = import_ref Implicit//default, inst+83, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.14: type = import_ref Implicit//default, inst+84, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] -// CHECK:STDOUT: %import_ref.15 = import_ref Implicit//default, inst+85, unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref Implicit//default, inst+113, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.17: type = import_ref Implicit//default, inst+114, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.5)] -// CHECK:STDOUT: %import_ref.18 = import_ref Implicit//default, inst+115, unloaded -// CHECK:STDOUT: %import_ref.19: type = import_ref Implicit//default, inst+138, loaded [template = i32] -// CHECK:STDOUT: %import_ref.20: type = import_ref Implicit//default, inst+139, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.21 = import_ref Implicit//default, inst+140, unloaded -// CHECK:STDOUT: %import_ref.23: type = import_ref Implicit//default, inst+151, loaded [symbolic = @impl.5.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.24: type = import_ref Implicit//default, inst+152, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.25 = import_ref Implicit//default, inst+153, unloaded -// CHECK:STDOUT: %import_ref.26: type = import_ref Implicit//default, inst+178, loaded [symbolic = @impl.6.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.27: type = import_ref Implicit//default, inst+179, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.28 = import_ref Implicit//default, inst+180, unloaded -// CHECK:STDOUT: %import_ref.29 = import_ref Implicit//default, inst+210, unloaded -// CHECK:STDOUT: %import_ref.30 = import_ref Implicit//default, inst+211, unloaded -// CHECK:STDOUT: %import_ref.31 = import_ref Implicit//default, inst+212, unloaded -// CHECK:STDOUT: %import_ref.32: type = import_ref Implicit//default, inst+214, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.33: type = import_ref Implicit//default, inst+215, loaded [template = constants.%As.type.3] -// CHECK:STDOUT: %import_ref.34 = import_ref Implicit//default, inst+216, unloaded -// CHECK:STDOUT: %import_ref.35 = import_ref Implicit//default, inst+231, unloaded -// CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+253, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.38: type = import_ref Implicit//default, inst+254, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] -// CHECK:STDOUT: %import_ref.39 = import_ref Implicit//default, inst+255, unloaded -// CHECK:STDOUT: %import_ref.40: type = import_ref Implicit//default, inst+282, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.41: type = import_ref Implicit//default, inst+283, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] -// CHECK:STDOUT: %import_ref.42 = import_ref Implicit//default, inst+284, unloaded -// CHECK:STDOUT: %import_ref.43: type = import_ref Implicit//default, inst+307, loaded [template = i32] -// CHECK:STDOUT: %import_ref.44: type = import_ref Implicit//default, inst+308, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.45 = import_ref Implicit//default, inst+309, unloaded -// CHECK:STDOUT: %import_ref.47: type = import_ref Implicit//default, inst+320, loaded [symbolic = @impl.11.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.48: type = import_ref Implicit//default, inst+321, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.49 = import_ref Implicit//default, inst+322, unloaded -// CHECK:STDOUT: %import_ref.50: type = import_ref Implicit//default, inst+347, loaded [symbolic = @impl.12.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.51: type = import_ref Implicit//default, inst+348, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.52 = import_ref Implicit//default, inst+349, unloaded -// CHECK:STDOUT: %import_ref.53 = import_ref Implicit//default, inst+470, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+42, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Implicit//default, inst+43, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Implicit//default, inst+44, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Implicit//default, inst+86, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Implicit//default, inst+87, loaded [symbolic = @impl.1.%ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: %import_ref.10 = import_ref Implicit//default, inst+88, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Implicit//default, inst+59, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Implicit//default, inst+116, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Implicit//default, inst+117, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %import_ref.14 = import_ref Implicit//default, inst+118, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Implicit//default, inst+145, loaded [symbolic = @impl.3.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.16: type = import_ref Implicit//default, inst+146, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.17 = import_ref Implicit//default, inst+147, unloaded +// CHECK:STDOUT: %import_ref.19: type = import_ref Implicit//default, inst+177, loaded [symbolic = @impl.4.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.20: type = import_ref Implicit//default, inst+178, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.21 = import_ref Implicit//default, inst+179, unloaded +// CHECK:STDOUT: %import_ref.22 = import_ref Implicit//default, inst+209, unloaded +// CHECK:STDOUT: %import_ref.23 = import_ref Implicit//default, inst+210, unloaded +// CHECK:STDOUT: %import_ref.24 = import_ref Implicit//default, inst+211, unloaded +// CHECK:STDOUT: %import_ref.25: type = import_ref Implicit//default, inst+217, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.26: type = import_ref Implicit//default, inst+218, loaded [symbolic = @impl.5.%As.type (constants.%As.type.3)] +// CHECK:STDOUT: %import_ref.27 = import_ref Implicit//default, inst+219, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Implicit//default, inst+234, unloaded +// CHECK:STDOUT: %import_ref.29: type = import_ref Implicit//default, inst+271, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.30: type = import_ref Implicit//default, inst+272, loaded [symbolic = @impl.6.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.31 = import_ref Implicit//default, inst+273, unloaded +// CHECK:STDOUT: %import_ref.32: type = import_ref Implicit//default, inst+300, loaded [symbolic = @impl.7.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.33: type = import_ref Implicit//default, inst+301, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.34 = import_ref Implicit//default, inst+302, unloaded +// CHECK:STDOUT: %import_ref.36: type = import_ref Implicit//default, inst+332, loaded [symbolic = @impl.8.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+333, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.38 = import_ref Implicit//default, inst+334, unloaded +// CHECK:STDOUT: %import_ref.39 = import_ref Implicit//default, inst+457, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1242,9 +1216,9 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] -// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 1 [template = constants.%.26] -// CHECK:STDOUT: %.loc11_28: Core.IntLiteral = int_value 2 [template = constants.%.27] -// CHECK:STDOUT: %.loc11_29: %.28 = struct_literal (%.loc11_20, %.loc11_28) +// CHECK:STDOUT: %.loc11_20: Core.IntLiteral = int_value 1 [template = constants.%.21] +// CHECK:STDOUT: %.loc11_28: Core.IntLiteral = int_value 2 [template = constants.%.22] +// CHECK:STDOUT: %.loc11_29: %.23 = struct_literal (%.loc11_20, %.loc11_28) // CHECK:STDOUT: %c_bad.var: ref = var c_bad // CHECK:STDOUT: %c_bad: ref = bind_name c_bad, %c_bad.var // CHECK:STDOUT: } @@ -1276,180 +1250,160 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] -// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.13)] -// CHECK:STDOUT: %.2: @As.%.1 (%.13) = assoc_entity element0, imports.%import_ref.35 [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.7) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %.2: @As.%.1 (%.9) = assoc_entity element0, imports.%import_ref.28 [symbolic = %.2 (constants.%.10)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.29 -// CHECK:STDOUT: .Convert = imports.%import_ref.30 -// CHECK:STDOUT: witness = (imports.%import_ref.31) +// CHECK:STDOUT: .Self = imports.%import_ref.22 +// CHECK:STDOUT: .Convert = imports.%import_ref.23 +// CHECK:STDOUT: witness = (imports.%import_ref.24) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: generic impl @impl.1(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.1(%N) [symbolic = %Convert.type (constants.%Convert.type.2)] +// CHECK:STDOUT: %Convert: @impl.1.%Convert.type (%Convert.type.2) = struct_value () [symbolic = %Convert (constants.%Convert.2)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] // CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.13 as imports.%import_ref.14 { +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.15 +// CHECK:STDOUT: witness = imports.%import_ref.14 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] // CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.16 as imports.%import_ref.17 { +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.18 +// CHECK:STDOUT: witness = imports.%import_ref.17 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.19 as imports.%import_ref.20 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.21 +// CHECK:STDOUT: generic impl @impl.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.4(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.4.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.19 as imports.%import_ref.20 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.21 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%iN)> [symbolic = %As.type (constants.%As.type.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] -// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.23 as imports.%import_ref.24 { +// CHECK:STDOUT: impl: imports.%import_ref.25 as imports.%import_ref.26 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.25 +// CHECK:STDOUT: witness = imports.%import_ref.27 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%uN)> [symbolic = %As.type (constants.%As.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] -// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.9)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.26 as imports.%import_ref.27 { +// CHECK:STDOUT: impl: imports.%import_ref.29 as imports.%import_ref.30 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.28 +// CHECK:STDOUT: witness = imports.%import_ref.31 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.7: imports.%import_ref.32 as imports.%import_ref.33 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.34 +// CHECK:STDOUT: generic impl @impl.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.7(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.7.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.32 as imports.%import_ref.33 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.34 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] -// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.12)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.12) = struct_value () [symbolic = %Convert (constants.%Convert.12)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.37 as imports.%import_ref.38 { +// CHECK:STDOUT: impl: imports.%import_ref.36 as imports.%import_ref.37 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.39 +// CHECK:STDOUT: witness = imports.%import_ref.38 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] -// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.40 as imports.%import_ref.41 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.42 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.10: imports.%import_ref.43 as imports.%import_ref.44 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.45 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] -// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.47 as imports.%import_ref.48 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.49 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] -// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.50 as imports.%import_ref.51 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.52 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%S: %.25) { -// CHECK:STDOUT: %S: %.25 = bind_symbolic_name S, 0 [symbolic = %S (constants.%S)] -// CHECK:STDOUT: %S.patt: %.25 = symbolic_binding_pattern S, 0 [symbolic = %S.patt (constants.%S.patt)] +// CHECK:STDOUT: generic class @C(constants.%S: %.20) { +// CHECK:STDOUT: %S: %.20 = bind_symbolic_name S, 0 [symbolic = %S (constants.%S)] +// CHECK:STDOUT: %S.patt: %.20 = symbolic_binding_pattern S, 0 [symbolic = %S.patt (constants.%S.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.53 +// CHECK:STDOUT: .Self = imports.%import_ref.39 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1463,38 +1417,38 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { @@ -1507,38 +1461,38 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %C.3; @@ -1557,17 +1511,9 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 -// CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 -// CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.1 => constants.%.3 -// CHECK:STDOUT: %.2 => constants.%.4 +// CHECK:STDOUT: specific @ImplicitAs(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(%Dest) { @@ -1575,6 +1521,25 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.1.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -1586,62 +1551,38 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @ImplicitAs(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { @@ -1649,46 +1590,46 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5 // CHECK:STDOUT: %Convert => constants.%Convert.5 -// CHECK:STDOUT: %.1 => constants.%.9 -// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: specific @impl.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: specific @impl.3(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: specific @impl.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(%N) { +// CHECK:STDOUT: specific @impl.4(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.5(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%Dest) { @@ -1696,17 +1637,9 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.3 -// CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 -// CHECK:STDOUT: %Convert => constants.%Convert.9 -// CHECK:STDOUT: %.1 => constants.%.15 -// CHECK:STDOUT: %.2 => constants.%.16 +// CHECK:STDOUT: specific @As(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(%Dest) { @@ -1714,6 +1647,25 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.5.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @As(@Convert.6.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -1725,62 +1677,38 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.8.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.9.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(@impl.6.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: specific @impl.6(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(%N) { +// CHECK:STDOUT: specific @impl.6(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(Core.IntLiteral) { @@ -1788,46 +1716,46 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %As.type => constants.%As.type.5 // CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 -// CHECK:STDOUT: %Convert => constants.%Convert.12 -// CHECK:STDOUT: %.1 => constants.%.19 -// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.11 +// CHECK:STDOUT: %Convert => constants.%Convert.11 +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.2 => constants.%.15 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: specific @impl.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(%N) { +// CHECK:STDOUT: specific @impl.7(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.9(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: specific @impl.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(%N) { +// CHECK:STDOUT: specific @impl.8(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.10(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%S) { @@ -1845,160 +1773,147 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: --- fail_bad_value.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, imports.%import_ref.11 [symbolic] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.12 [template] -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %.5: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%.5)> [symbolic] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: = interface_witness (%Convert.2) [symbolic] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.3, @impl.2(%N) [symbolic] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic] -// CHECK:STDOUT: %.6: = interface_witness (%Convert.3) [symbolic] -// CHECK:STDOUT: %.7: type = int_type unsigned, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %.4: = interface_witness (%Convert.3) [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.4, @impl.3(%N) [symbolic] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] -// CHECK:STDOUT: %.8: = interface_witness (%Convert.4) [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %.5: = interface_witness (%Convert.4) [symbolic] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.5 [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.22 [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.5, %Convert.type.5 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.18 [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.5, @impl.4(%N) [symbolic] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] -// CHECK:STDOUT: %.11: = interface_witness (%Convert.6) [symbolic] -// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] -// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] -// CHECK:STDOUT: %.12: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %.8: = interface_witness (%Convert.6) [symbolic] // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] // CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%iN)> [symbolic] // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.9: type = assoc_entity_type %As.type.2, %Convert.type.7 [symbolic] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.28 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.7, @impl.5(%N) [symbolic] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] -// CHECK:STDOUT: %.13: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] -// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.35 [symbolic] -// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] -// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] -// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.36 [template] -// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.5)> [symbolic] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.8) [symbolic] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.8, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.9) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.9, @impl.7(%N) [symbolic] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] -// CHECK:STDOUT: %.17: = interface_witness (%Convert.10) [symbolic] -// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] -// CHECK:STDOUT: %.18: = interface_witness (%Convert.11) [symbolic] -// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] -// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] -// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.46 [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] -// CHECK:STDOUT: %.21: = interface_witness (%Convert.13) [symbolic] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] -// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %.14: type = assoc_entity_type %As.type.5, %Convert.type.11 [template] +// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.35 [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.12) [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] -// CHECK:STDOUT: %.25: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %S: %.25 = bind_symbolic_name S, 0 [symbolic] -// CHECK:STDOUT: %S.patt: %.25 = symbolic_binding_pattern S, 0 [symbolic] -// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %.28: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %.30: %.1 = assoc_entity element0, imports.%import_ref.55 [symbolic] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.32: = bound_method %.26, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 3 [template] -// CHECK:STDOUT: %.34: = bound_method %.27, %Convert.15 [template] -// CHECK:STDOUT: %.35: i32 = int_value 4 [template] -// CHECK:STDOUT: %struct.1: %.25 = struct_value (%.33, %.35) [template] +// CHECK:STDOUT: %.19: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.19 [template] +// CHECK:STDOUT: %.20: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %S: %.20 = bind_symbolic_name S, 0 [symbolic] +// CHECK:STDOUT: %S.patt: %.20 = symbolic_binding_pattern S, 0 [symbolic] +// CHECK:STDOUT: %.21: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.22: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.23: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] +// CHECK:STDOUT: %.25: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.13 [template] +// CHECK:STDOUT: %.26: %.25 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %.27: %.1 = assoc_entity element0, imports.%import_ref.41 [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.19) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.28: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.29: = bound_method %.21, %Convert.14 [template] +// CHECK:STDOUT: %.30: = specific_function %.29, @Convert.2(%.19) [template] +// CHECK:STDOUT: %.31: %i32 = int_value 3 [template] +// CHECK:STDOUT: %.32: = bound_method %.22, %Convert.14 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.2(%.19) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 4 [template] +// CHECK:STDOUT: %struct.1: %.20 = struct_value (%.31, %.34) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%struct.1) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.37: i32 = int_value 2 [template] -// CHECK:STDOUT: %.38: i32 = int_value 1 [template] -// CHECK:STDOUT: %struct.2: %.25 = struct_value (%.38, %.37) [template] +// CHECK:STDOUT: %.36: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.37: %i32 = int_value 1 [template] +// CHECK:STDOUT: %struct.2: %.20 = struct_value (%.37, %.36) [template] // CHECK:STDOUT: %C.4: type = class_type @C, @C(%struct.2) [template] // CHECK:STDOUT: %ImplicitAs.type.7: type = facet_type <@ImplicitAs, @ImplicitAs(%C.3)> [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.1, @ImplicitAs(%C.3) [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.39: type = assoc_entity_type %ImplicitAs.type.7, %Convert.type.16 [template] -// CHECK:STDOUT: %.40: %.39 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.1, @ImplicitAs(%C.3) [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.38: type = assoc_entity_type %ImplicitAs.type.7, %Convert.type.15 [template] +// CHECK:STDOUT: %.39: %.38 = assoc_entity element0, imports.%import_ref.11 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+17, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+411, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+465, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+505, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+24, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+393, unloaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+452, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+496, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.54 +// CHECK:STDOUT: .ImplicitAs = %import_ref.40 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+35, unloaded -// CHECK:STDOUT: %import_ref.6: @ImplicitAs.%.1 (%.1) = import_ref Implicit//default, inst+36, loaded [symbolic = @ImplicitAs.%.2 (constants.%.30)] -// CHECK:STDOUT: %import_ref.7 = import_ref Implicit//default, inst+37, unloaded -// CHECK:STDOUT: %import_ref.8: type = import_ref Implicit//default, inst+71, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.9: type = import_ref Implicit//default, inst+72, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.10: = import_ref Implicit//default, inst+73, loaded [template = constants.%.31] -// CHECK:STDOUT: %import_ref.11 = import_ref Implicit//default, inst+52, unloaded -// CHECK:STDOUT: %import_ref.13: type = import_ref Implicit//default, inst+83, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.14: type = import_ref Implicit//default, inst+84, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] -// CHECK:STDOUT: %import_ref.15 = import_ref Implicit//default, inst+85, unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref Implicit//default, inst+113, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.17: type = import_ref Implicit//default, inst+114, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.5)] -// CHECK:STDOUT: %import_ref.18 = import_ref Implicit//default, inst+115, unloaded -// CHECK:STDOUT: %import_ref.19: type = import_ref Implicit//default, inst+138, loaded [template = i32] -// CHECK:STDOUT: %import_ref.20: type = import_ref Implicit//default, inst+139, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.21 = import_ref Implicit//default, inst+140, unloaded -// CHECK:STDOUT: %import_ref.23: type = import_ref Implicit//default, inst+151, loaded [symbolic = @impl.5.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.24: type = import_ref Implicit//default, inst+152, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.25 = import_ref Implicit//default, inst+153, unloaded -// CHECK:STDOUT: %import_ref.26: type = import_ref Implicit//default, inst+178, loaded [symbolic = @impl.6.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.27: type = import_ref Implicit//default, inst+179, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.28 = import_ref Implicit//default, inst+180, unloaded -// CHECK:STDOUT: %import_ref.29 = import_ref Implicit//default, inst+210, unloaded -// CHECK:STDOUT: %import_ref.30 = import_ref Implicit//default, inst+211, unloaded -// CHECK:STDOUT: %import_ref.31 = import_ref Implicit//default, inst+212, unloaded -// CHECK:STDOUT: %import_ref.32: type = import_ref Implicit//default, inst+214, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.33: type = import_ref Implicit//default, inst+215, loaded [template = constants.%As.type.3] -// CHECK:STDOUT: %import_ref.34 = import_ref Implicit//default, inst+216, unloaded -// CHECK:STDOUT: %import_ref.35 = import_ref Implicit//default, inst+231, unloaded -// CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+253, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.38: type = import_ref Implicit//default, inst+254, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] -// CHECK:STDOUT: %import_ref.39 = import_ref Implicit//default, inst+255, unloaded -// CHECK:STDOUT: %import_ref.40: type = import_ref Implicit//default, inst+282, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.41: type = import_ref Implicit//default, inst+283, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] -// CHECK:STDOUT: %import_ref.42 = import_ref Implicit//default, inst+284, unloaded -// CHECK:STDOUT: %import_ref.43: type = import_ref Implicit//default, inst+307, loaded [template = i32] -// CHECK:STDOUT: %import_ref.44: type = import_ref Implicit//default, inst+308, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.45 = import_ref Implicit//default, inst+309, unloaded -// CHECK:STDOUT: %import_ref.47: type = import_ref Implicit//default, inst+320, loaded [symbolic = @impl.11.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.48: type = import_ref Implicit//default, inst+321, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.49 = import_ref Implicit//default, inst+322, unloaded -// CHECK:STDOUT: %import_ref.50: type = import_ref Implicit//default, inst+347, loaded [symbolic = @impl.12.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.51: type = import_ref Implicit//default, inst+348, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.52 = import_ref Implicit//default, inst+349, unloaded -// CHECK:STDOUT: %import_ref.53 = import_ref Implicit//default, inst+470, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+42, unloaded +// CHECK:STDOUT: %import_ref.6: @ImplicitAs.%.1 (%.1) = import_ref Implicit//default, inst+43, loaded [symbolic = @ImplicitAs.%.2 (constants.%.27)] +// CHECK:STDOUT: %import_ref.7 = import_ref Implicit//default, inst+44, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Implicit//default, inst+86, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Implicit//default, inst+87, loaded [symbolic = @impl.1.%ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: %import_ref.10: = import_ref Implicit//default, inst+88, loaded [symbolic = @impl.1.%.1 (constants.%.3)] +// CHECK:STDOUT: %import_ref.11 = import_ref Implicit//default, inst+59, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Implicit//default, inst+116, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Implicit//default, inst+117, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %import_ref.14 = import_ref Implicit//default, inst+118, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Implicit//default, inst+145, loaded [symbolic = @impl.3.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.16: type = import_ref Implicit//default, inst+146, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.17 = import_ref Implicit//default, inst+147, unloaded +// CHECK:STDOUT: %import_ref.19: type = import_ref Implicit//default, inst+177, loaded [symbolic = @impl.4.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.20: type = import_ref Implicit//default, inst+178, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.21 = import_ref Implicit//default, inst+179, unloaded +// CHECK:STDOUT: %import_ref.22 = import_ref Implicit//default, inst+209, unloaded +// CHECK:STDOUT: %import_ref.23 = import_ref Implicit//default, inst+210, unloaded +// CHECK:STDOUT: %import_ref.24 = import_ref Implicit//default, inst+211, unloaded +// CHECK:STDOUT: %import_ref.25: type = import_ref Implicit//default, inst+217, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.26: type = import_ref Implicit//default, inst+218, loaded [symbolic = @impl.5.%As.type (constants.%As.type.3)] +// CHECK:STDOUT: %import_ref.27 = import_ref Implicit//default, inst+219, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Implicit//default, inst+234, unloaded +// CHECK:STDOUT: %import_ref.29: type = import_ref Implicit//default, inst+271, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.30: type = import_ref Implicit//default, inst+272, loaded [symbolic = @impl.6.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.31 = import_ref Implicit//default, inst+273, unloaded +// CHECK:STDOUT: %import_ref.32: type = import_ref Implicit//default, inst+300, loaded [symbolic = @impl.7.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.33: type = import_ref Implicit//default, inst+301, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.34 = import_ref Implicit//default, inst+302, unloaded +// CHECK:STDOUT: %import_ref.36: type = import_ref Implicit//default, inst+332, loaded [symbolic = @impl.8.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+333, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.38 = import_ref Implicit//default, inst+334, unloaded +// CHECK:STDOUT: %import_ref.39 = import_ref Implicit//default, inst+457, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -2014,21 +1929,23 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] -// CHECK:STDOUT: %.loc9_20: Core.IntLiteral = int_value 3 [template = constants.%.26] -// CHECK:STDOUT: %.loc9_28: Core.IntLiteral = int_value 4 [template = constants.%.27] -// CHECK:STDOUT: %.loc9_29.1: %.28 = struct_literal (%.loc9_20, %.loc9_28) -// CHECK:STDOUT: %.loc9_29.2: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_29.3: = bound_method %.loc9_20, %.loc9_29.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc9_29.1: init i32 = call %.loc9_29.3(%.loc9_20) [template = constants.%.33] -// CHECK:STDOUT: %.loc9_29.4: i32 = value_of_initializer %int.convert_checked.loc9_29.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc9_29.5: i32 = converted %.loc9_20, %.loc9_29.4 [template = constants.%.33] -// CHECK:STDOUT: %.loc9_29.6: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_29.7: = bound_method %.loc9_28, %.loc9_29.6 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc9_29.2: init i32 = call %.loc9_29.7(%.loc9_28) [template = constants.%.35] -// CHECK:STDOUT: %.loc9_29.8: i32 = value_of_initializer %int.convert_checked.loc9_29.2 [template = constants.%.35] -// CHECK:STDOUT: %.loc9_29.9: i32 = converted %.loc9_28, %.loc9_29.8 [template = constants.%.35] -// CHECK:STDOUT: %struct: %.25 = struct_value (%.loc9_29.5, %.loc9_29.9) [template = constants.%struct.1] -// CHECK:STDOUT: %.loc9_13: %.25 = converted %.loc9_29.1, %struct [template = constants.%struct.1] +// CHECK:STDOUT: %.loc9_20: Core.IntLiteral = int_value 3 [template = constants.%.21] +// CHECK:STDOUT: %.loc9_28: Core.IntLiteral = int_value 4 [template = constants.%.22] +// CHECK:STDOUT: %.loc9_29.1: %.23 = struct_literal (%.loc9_20, %.loc9_28) +// CHECK:STDOUT: %.loc9_29.2: %Convert.type.13 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_29.3: = bound_method %.loc9_20, %.loc9_29.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc9_29.4: = specific_function %.loc9_29.3, @Convert.2(constants.%.19) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc9_29.1: init %i32 = call %.loc9_29.4(%.loc9_20) [template = constants.%.31] +// CHECK:STDOUT: %.loc9_29.5: %i32 = value_of_initializer %int.convert_checked.loc9_29.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc9_29.6: %i32 = converted %.loc9_20, %.loc9_29.5 [template = constants.%.31] +// CHECK:STDOUT: %.loc9_29.7: %Convert.type.13 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_29.8: = bound_method %.loc9_28, %.loc9_29.7 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_29.9: = specific_function %.loc9_29.8, @Convert.2(constants.%.19) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc9_29.2: init %i32 = call %.loc9_29.9(%.loc9_28) [template = constants.%.34] +// CHECK:STDOUT: %.loc9_29.10: %i32 = value_of_initializer %int.convert_checked.loc9_29.2 [template = constants.%.34] +// CHECK:STDOUT: %.loc9_29.11: %i32 = converted %.loc9_28, %.loc9_29.10 [template = constants.%.34] +// CHECK:STDOUT: %struct: %.20 = struct_value (%.loc9_29.6, %.loc9_29.11) [template = constants.%struct.1] +// CHECK:STDOUT: %.loc9_13: %.20 = converted %.loc9_29.1, %struct [template = constants.%struct.1] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%struct.1) [template = constants.%C.3] // CHECK:STDOUT: %c_bad.var: ref %C.3 = var c_bad // CHECK:STDOUT: %c_bad: ref %C.3 = bind_name c_bad, %c_bad.var @@ -2061,180 +1978,160 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] -// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.13)] -// CHECK:STDOUT: %.2: @As.%.1 (%.13) = assoc_entity element0, imports.%import_ref.35 [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.7) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %.2: @As.%.1 (%.9) = assoc_entity element0, imports.%import_ref.28 [symbolic = %.2 (constants.%.10)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.29 -// CHECK:STDOUT: .Convert = imports.%import_ref.30 -// CHECK:STDOUT: witness = (imports.%import_ref.31) +// CHECK:STDOUT: .Self = imports.%import_ref.22 +// CHECK:STDOUT: .Convert = imports.%import_ref.23 +// CHECK:STDOUT: witness = (imports.%import_ref.24) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: generic impl @impl.1(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.1(%N) [symbolic = %Convert.type (constants.%Convert.type.2)] +// CHECK:STDOUT: %Convert: @impl.1.%Convert.type (%Convert.type.2) = struct_value () [symbolic = %Convert (constants.%Convert.2)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] // CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.13 as imports.%import_ref.14 { +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.15 +// CHECK:STDOUT: witness = imports.%import_ref.14 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] // CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.16 as imports.%import_ref.17 { +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.18 +// CHECK:STDOUT: witness = imports.%import_ref.17 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.19 as imports.%import_ref.20 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.21 +// CHECK:STDOUT: generic impl @impl.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.4(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.4.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.19 as imports.%import_ref.20 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.21 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%iN)> [symbolic = %As.type (constants.%As.type.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] -// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.23 as imports.%import_ref.24 { +// CHECK:STDOUT: impl: imports.%import_ref.25 as imports.%import_ref.26 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.25 +// CHECK:STDOUT: witness = imports.%import_ref.27 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%uN)> [symbolic = %As.type (constants.%As.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] -// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.9)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.26 as imports.%import_ref.27 { +// CHECK:STDOUT: impl: imports.%import_ref.29 as imports.%import_ref.30 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.28 +// CHECK:STDOUT: witness = imports.%import_ref.31 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.7: imports.%import_ref.32 as imports.%import_ref.33 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.34 +// CHECK:STDOUT: generic impl @impl.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.7(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.7.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.32 as imports.%import_ref.33 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.34 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] -// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.12)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.12) = struct_value () [symbolic = %Convert (constants.%Convert.12)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.37 as imports.%import_ref.38 { +// CHECK:STDOUT: impl: imports.%import_ref.36 as imports.%import_ref.37 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.39 +// CHECK:STDOUT: witness = imports.%import_ref.38 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] -// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.40 as imports.%import_ref.41 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.42 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.10: imports.%import_ref.43 as imports.%import_ref.44 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.45 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] -// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.47 as imports.%import_ref.48 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.49 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] -// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.50 as imports.%import_ref.51 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.52 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%S: %.25) { -// CHECK:STDOUT: %S: %.25 = bind_symbolic_name S, 0 [symbolic = %S (constants.%S)] -// CHECK:STDOUT: %S.patt: %.25 = symbolic_binding_pattern S, 0 [symbolic = %S.patt (constants.%S.patt)] +// CHECK:STDOUT: generic class @C(constants.%S: %.20) { +// CHECK:STDOUT: %S: %.20 = bind_symbolic_name S, 0 [symbolic = %S (constants.%S)] +// CHECK:STDOUT: %S.patt: %.20 = symbolic_binding_pattern S, 0 [symbolic = %S.patt (constants.%S.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.53 +// CHECK:STDOUT: .Self = imports.%import_ref.39 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2248,38 +2145,38 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { @@ -2292,42 +2189,40 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.11[%self.param_patt: Core.IntLiteral]() -> i32 = "int.convert_checked"; -// CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %C.4; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -2345,17 +2240,9 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 -// CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 -// CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.1 => constants.%.3 -// CHECK:STDOUT: %.2 => constants.%.4 +// CHECK:STDOUT: specific @ImplicitAs(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(%Dest) { @@ -2363,6 +2250,25 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.1.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -2374,62 +2280,38 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @ImplicitAs(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { @@ -2437,46 +2319,46 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5 // CHECK:STDOUT: %Convert => constants.%Convert.5 -// CHECK:STDOUT: %.1 => constants.%.9 -// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: specific @impl.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: specific @impl.3(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: specific @impl.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(%N) { +// CHECK:STDOUT: specific @impl.4(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.5(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%Dest) { @@ -2484,17 +2366,9 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.3 -// CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 -// CHECK:STDOUT: %Convert => constants.%Convert.9 -// CHECK:STDOUT: %.1 => constants.%.15 -// CHECK:STDOUT: %.2 => constants.%.16 +// CHECK:STDOUT: specific @As(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(%Dest) { @@ -2502,6 +2376,25 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.5.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @As(@Convert.6.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -2513,62 +2406,38 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.8.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.9.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(@impl.6.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: specific @impl.6(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(%N) { +// CHECK:STDOUT: specific @impl.6(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(Core.IntLiteral) { @@ -2576,46 +2445,46 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %As.type => constants.%As.type.5 // CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 -// CHECK:STDOUT: %Convert => constants.%Convert.12 -// CHECK:STDOUT: %.1 => constants.%.19 -// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.11 +// CHECK:STDOUT: %Convert => constants.%Convert.11 +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.2 => constants.%.15 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: specific @impl.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(%N) { +// CHECK:STDOUT: specific @impl.7(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.9(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: specific @impl.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(%N) { +// CHECK:STDOUT: specific @impl.8(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.10(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%S) { @@ -2623,6 +2492,38 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %S.patt => constants.%S // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%i32) { +// CHECK:STDOUT: %Dest => constants.%i32 +// CHECK:STDOUT: %Dest.patt => constants.%i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.13 +// CHECK:STDOUT: %Convert => constants.%Convert.13 +// CHECK:STDOUT: %.1 => constants.%.25 +// CHECK:STDOUT: %.2 => constants.%.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(constants.%.19) { +// CHECK:STDOUT: %N => constants.%.19 +// CHECK:STDOUT: %N.patt => constants.%.19 +// CHECK:STDOUT: %iN => constants.%i32 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.14 +// CHECK:STDOUT: %Convert => constants.%Convert.14 +// CHECK:STDOUT: %.1 => constants.%.28 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%.19) { +// CHECK:STDOUT: %N => constants.%.19 +// CHECK:STDOUT: %iN => constants.%i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%struct.1) { // CHECK:STDOUT: %S => constants.%struct.1 // CHECK:STDOUT: %S.patt => constants.%struct.1 @@ -2644,9 +2545,9 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.7 // CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.16 -// CHECK:STDOUT: %Convert => constants.%Convert.16 -// CHECK:STDOUT: %.1 => constants.%.39 -// CHECK:STDOUT: %.2 => constants.%.40 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.15 +// CHECK:STDOUT: %Convert => constants.%Convert.15 +// CHECK:STDOUT: %.1 => constants.%.38 +// CHECK:STDOUT: %.2 => constants.%.39 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/literal_member_access.carbon b/toolchain/check/testdata/struct/literal_member_access.carbon index fa68046e7486..14e5ab2446ed 100644 --- a/toolchain/check/testdata/struct/literal_member_access.carbon +++ b/toolchain/check/testdata/struct/literal_member_access.carbon @@ -17,21 +17,23 @@ fn F() -> i32 { // CHECK:STDOUT: --- literal_member_access.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.x: i32, .y: i32, .z: i32} [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.x: %i32, .y: %i32, .z: %i32} [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.5: type = struct_type {.a: Core.IntLiteral, .b: %.1, .c: Core.IntLiteral} [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.6: type = struct_type {.a: Core.IntLiteral, .b: %.2, .c: Core.IntLiteral} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -45,57 +47,61 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %return.patt: %.1 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.1 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %int.make_type_32.loc11_16 [template = i32] -// CHECK:STDOUT: %.loc11_16.2: type = converted %int.make_type_32.loc11_16, %.loc11_16.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_32.loc11_25 [template = i32] -// CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_32.loc11_25, %.loc11_25.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_34.1: type = value_of_initializer %int.make_type_32.loc11_34 [template = i32] -// CHECK:STDOUT: %.loc11_34.2: type = converted %int.make_type_32.loc11_34, %.loc11_34.1 [template = i32] -// CHECK:STDOUT: %.loc11_37: type = struct_type {.x: i32, .y: i32, .z: i32} [template = constants.%.1] -// CHECK:STDOUT: %return.param: ref %.1 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref %.1 = return_slot %return.param +// CHECK:STDOUT: %.loc11_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_16: init type = call constants.%Int(%.loc11_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_16.2: type = value_of_initializer %int.make_type_signed.loc11_16 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_16.3: type = converted %int.make_type_signed.loc11_16, %.loc11_16.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_25: init type = call constants.%Int(%.loc11_25.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.2: type = value_of_initializer %int.make_type_signed.loc11_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.3: type = converted %int.make_type_signed.loc11_25, %.loc11_25.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_34.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_34: init type = call constants.%Int(%.loc11_34.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_34.2: type = value_of_initializer %int.make_type_signed.loc11_34 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_34.3: type = converted %int.make_type_signed.loc11_34, %.loc11_34.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_37: type = struct_type {.x: %i32, .y: %i32, .z: %i32} [template = constants.%.2] +// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_32, %.loc13_11.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc13_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_11.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_11.3: type = converted %int.make_type_signed, %.loc13_11.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> %.1; +// CHECK:STDOUT: fn @G() -> %.2; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> i32 { +// CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc14_16: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_16: Core.IntLiteral = int_value 1 [template = constants.%.3] // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [template = constants.%G] -// CHECK:STDOUT: %.loc14_25.1: ref %.1 = temporary_storage -// CHECK:STDOUT: %G.call: init %.1 = call %G.ref() to %.loc14_25.1 -// CHECK:STDOUT: %.loc14_34: Core.IntLiteral = int_value 3 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_35.1: %.5 = struct_literal (%.loc14_16, %G.call, %.loc14_34) -// CHECK:STDOUT: %.loc14_25.2: ref %.1 = temporary %.loc14_25.1, %G.call -// CHECK:STDOUT: %.loc14_25.3: ref i32 = struct_access %.loc14_25.2, element0 -// CHECK:STDOUT: %.loc14_25.4: i32 = bind_value %.loc14_25.3 -// CHECK:STDOUT: %.loc14_25.5: ref i32 = struct_access %.loc14_25.2, element1 -// CHECK:STDOUT: %.loc14_25.6: i32 = bind_value %.loc14_25.5 -// CHECK:STDOUT: %.loc14_25.7: ref i32 = struct_access %.loc14_25.2, element2 -// CHECK:STDOUT: %.loc14_25.8: i32 = bind_value %.loc14_25.7 -// CHECK:STDOUT: %struct.loc14_25: %.1 = struct_value (%.loc14_25.4, %.loc14_25.6, %.loc14_25.8) -// CHECK:STDOUT: %.loc14_35.2: %.1 = converted %G.call, %struct.loc14_25 -// CHECK:STDOUT: %struct.loc14_35: %.5 = struct_value (%.loc14_16, %.loc14_35.2, %.loc14_34) -// CHECK:STDOUT: %.loc14_35.3: %.5 = converted %.loc14_35.1, %struct.loc14_35 -// CHECK:STDOUT: %.loc14_36: %.1 = struct_access %.loc14_35.3, element1 -// CHECK:STDOUT: %.loc14_38: i32 = struct_access %.loc14_36, element1 +// CHECK:STDOUT: %.loc14_25.1: ref %.2 = temporary_storage +// CHECK:STDOUT: %G.call: init %.2 = call %G.ref() to %.loc14_25.1 +// CHECK:STDOUT: %.loc14_34: Core.IntLiteral = int_value 3 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_35.1: %.6 = struct_literal (%.loc14_16, %G.call, %.loc14_34) +// CHECK:STDOUT: %.loc14_25.2: ref %.2 = temporary %.loc14_25.1, %G.call +// CHECK:STDOUT: %.loc14_25.3: ref %i32 = struct_access %.loc14_25.2, element0 +// CHECK:STDOUT: %.loc14_25.4: %i32 = bind_value %.loc14_25.3 +// CHECK:STDOUT: %.loc14_25.5: ref %i32 = struct_access %.loc14_25.2, element1 +// CHECK:STDOUT: %.loc14_25.6: %i32 = bind_value %.loc14_25.5 +// CHECK:STDOUT: %.loc14_25.7: ref %i32 = struct_access %.loc14_25.2, element2 +// CHECK:STDOUT: %.loc14_25.8: %i32 = bind_value %.loc14_25.7 +// CHECK:STDOUT: %struct.loc14_25: %.2 = struct_value (%.loc14_25.4, %.loc14_25.6, %.loc14_25.8) +// CHECK:STDOUT: %.loc14_35.2: %.2 = converted %G.call, %struct.loc14_25 +// CHECK:STDOUT: %struct.loc14_35: %.6 = struct_value (%.loc14_16, %.loc14_35.2, %.loc14_34) +// CHECK:STDOUT: %.loc14_35.3: %.6 = converted %.loc14_35.1, %struct.loc14_35 +// CHECK:STDOUT: %.loc14_36: %.2 = struct_access %.loc14_35.3, element1 +// CHECK:STDOUT: %.loc14_38: %i32 = struct_access %.loc14_36, element1 // CHECK:STDOUT: return %.loc14_38 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index edb4cf00dbb7..df9024e444dc 100644 --- a/toolchain/check/testdata/struct/member_access.carbon +++ b/toolchain/check/testdata/struct/member_access.carbon @@ -18,25 +18,28 @@ var z: i32 = y; // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: f64, .b: i32} [template] -// CHECK:STDOUT: %.4: f64 = float_literal 0 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.6: type = struct_type {.a: f64, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.30: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.31: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.32: i32 = int_value 1 [template] -// CHECK:STDOUT: %struct: %.2 = struct_value (%.4, %.32) [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.2 [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: f64, .b: %i32} [template] +// CHECK:STDOUT: %.5: f64 = float_literal 0 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.7: type = struct_type {.a: f64, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.2) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.27: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.28: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.2) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 1 [template] +// CHECK:STDOUT: %struct: %.3 = struct_value (%.5, %.30) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Float = %import_ref.1 -// CHECK:STDOUT: .Int32 = %import_ref.2 +// CHECK:STDOUT: .Int = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -55,46 +58,50 @@ var z: i32 = y; // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc11_13.1) [template = f64] // CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc11_13.3: type = converted %float.make_type, %.loc11_13.2 [template = f64] -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_22.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_22.2: type = converted %int.make_type_32.loc11, %.loc11_22.1 [template = i32] -// CHECK:STDOUT: %.loc11_25: type = struct_type {.a: f64, .b: i32} [template = constants.%.2] -// CHECK:STDOUT: %x.var: ref %.2 = var x -// CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %y.var: ref i32 = var y -// CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_8.2: type = converted %int.make_type_32.loc13, %.loc13_8.1 [template = i32] -// CHECK:STDOUT: %z.var: ref i32 = var z -// CHECK:STDOUT: %z: ref i32 = bind_name z, %z.var +// CHECK:STDOUT: %.loc11_22.1: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22.3: type = converted %int.make_type_signed.loc11, %.loc11_22.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25: type = struct_type {.a: f64, .b: %i32} [template = constants.%.3] +// CHECK:STDOUT: %x.var: ref %.3 = var x +// CHECK:STDOUT: %x: ref %.3 = bind_name x, %x.var +// CHECK:STDOUT: %.loc12_8.1: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.3: type = converted %int.make_type_signed.loc12, %.loc12_8.2 [template = constants.%i32] +// CHECK:STDOUT: %y.var: ref %i32 = var y +// CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var +// CHECK:STDOUT: %.loc13_8.1: Core.IntLiteral = int_value 32 [template = constants.%.2] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8.3: type = converted %int.make_type_signed.loc13, %.loc13_8.2 [template = constants.%i32] +// CHECK:STDOUT: %z.var: ref %i32 = var z +// CHECK:STDOUT: %z: ref %i32 = bind_name z, %z.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_35: f64 = float_literal 0 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_45: Core.IntLiteral = int_value 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_46.1: %.6 = struct_literal (%.loc11_35, %.loc11_45) +// CHECK:STDOUT: %.loc11_35: f64 = float_literal 0 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_45: Core.IntLiteral = int_value 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_46.1: %.7 = struct_literal (%.loc11_35, %.loc11_45) // CHECK:STDOUT: %.loc11_46.2: ref f64 = struct_access file.%x.var, element0 -// CHECK:STDOUT: %.loc11_46.3: init f64 = initialize_from %.loc11_35 to %.loc11_46.2 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_46.4: %Convert.type.2 = interface_witness_access constants.%.30, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_46.5: = bound_method %.loc11_45, %.loc11_46.4 [template = constants.%.31] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc11_46.5(%.loc11_45) [template = constants.%.32] -// CHECK:STDOUT: %.loc11_46.6: init i32 = converted %.loc11_45, %int.convert_checked [template = constants.%.32] -// CHECK:STDOUT: %.loc11_46.7: ref i32 = struct_access file.%x.var, element1 -// CHECK:STDOUT: %.loc11_46.8: init i32 = initialize_from %.loc11_46.6 to %.loc11_46.7 [template = constants.%.32] -// CHECK:STDOUT: %.loc11_46.9: init %.2 = struct_init (%.loc11_46.3, %.loc11_46.8) to file.%x.var [template = constants.%struct] -// CHECK:STDOUT: %.loc11_47: init %.2 = converted %.loc11_46.1, %.loc11_46.9 [template = constants.%struct] +// CHECK:STDOUT: %.loc11_46.3: init f64 = initialize_from %.loc11_35 to %.loc11_46.2 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_46.4: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_46.5: = bound_method %.loc11_45, %.loc11_46.4 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_46.6: = specific_function %.loc11_46.5, @Convert.2(constants.%.2) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc11_46.6(%.loc11_45) [template = constants.%.30] +// CHECK:STDOUT: %.loc11_46.7: init %i32 = converted %.loc11_45, %int.convert_checked [template = constants.%.30] +// CHECK:STDOUT: %.loc11_46.8: ref %i32 = struct_access file.%x.var, element1 +// CHECK:STDOUT: %.loc11_46.9: init %i32 = initialize_from %.loc11_46.7 to %.loc11_46.8 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_46.10: init %.3 = struct_init (%.loc11_46.3, %.loc11_46.9) to file.%x.var [template = constants.%struct] +// CHECK:STDOUT: %.loc11_47: init %.3 = converted %.loc11_46.1, %.loc11_46.10 [template = constants.%struct] // CHECK:STDOUT: assign file.%x.var, %.loc11_47 -// CHECK:STDOUT: %x.ref: ref %.2 = name_ref x, file.%x -// CHECK:STDOUT: %.loc12_15.1: ref i32 = struct_access %x.ref, element1 -// CHECK:STDOUT: %.loc12_15.2: i32 = bind_value %.loc12_15.1 +// CHECK:STDOUT: %x.ref: ref %.3 = name_ref x, file.%x +// CHECK:STDOUT: %.loc12_15.1: ref %i32 = struct_access %x.ref, element1 +// CHECK:STDOUT: %.loc12_15.2: %i32 = bind_value %.loc12_15.1 // CHECK:STDOUT: assign file.%y.var, %.loc12_15.2 -// CHECK:STDOUT: %y.ref: ref i32 = name_ref y, file.%y -// CHECK:STDOUT: %.loc13: i32 = bind_value %y.ref +// CHECK:STDOUT: %y.ref: ref %i32 = name_ref y, file.%y +// CHECK:STDOUT: %.loc13: %i32 = bind_value %y.ref // CHECK:STDOUT: assign file.%z.var, %.loc13 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/nested_struct_in_place.carbon b/toolchain/check/testdata/struct/nested_struct_in_place.carbon index fe6c7ea896a5..bd4b78c98a72 100644 --- a/toolchain/check/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/check/testdata/struct/nested_struct_in_place.carbon @@ -17,20 +17,22 @@ fn G() { // CHECK:STDOUT: --- nested_struct_in_place.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32, i32) [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32, %i32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: %tuple.type.2, .b: %tuple.type.2} [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %tuple.type.2, .b: %tuple.type.2} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -47,16 +49,19 @@ fn G() { // CHECK:STDOUT: %return.patt: %tuple.type.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_25.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_12, %int.make_type_32.loc11_17, %int.make_type_32.loc11_22) -// CHECK:STDOUT: %.loc11_25.2: type = value_of_initializer %int.make_type_32.loc11_12 [template = i32] -// CHECK:STDOUT: %.loc11_25.3: type = converted %int.make_type_32.loc11_12, %.loc11_25.2 [template = i32] -// CHECK:STDOUT: %.loc11_25.4: type = value_of_initializer %int.make_type_32.loc11_17 [template = i32] -// CHECK:STDOUT: %.loc11_25.5: type = converted %int.make_type_32.loc11_17, %.loc11_25.4 [template = i32] -// CHECK:STDOUT: %.loc11_25.6: type = value_of_initializer %int.make_type_32.loc11_22 [template = i32] -// CHECK:STDOUT: %.loc11_25.7: type = converted %int.make_type_32.loc11_22, %.loc11_25.6 [template = i32] +// CHECK:STDOUT: %.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_12: init type = call constants.%Int(%.loc11_12) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_17: init type = call constants.%Int(%.loc11_17) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_22: init type = call constants.%Int(%.loc11_22) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_12, %int.make_type_signed.loc11_17, %int.make_type_signed.loc11_22) +// CHECK:STDOUT: %.loc11_25.2: type = value_of_initializer %int.make_type_signed.loc11_12 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.3: type = converted %int.make_type_signed.loc11_12, %.loc11_25.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.4: type = value_of_initializer %int.make_type_signed.loc11_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.5: type = converted %int.make_type_signed.loc11_17, %.loc11_25.4 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.6: type = value_of_initializer %int.make_type_signed.loc11_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.7: type = converted %int.make_type_signed.loc11_22, %.loc11_25.6 [template = constants.%i32] // CHECK:STDOUT: %.loc11_25.8: type = converted %.loc11_25.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param @@ -68,40 +73,46 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc14_16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_26: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_29.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc14_16, %int.make_type_32.loc14_21, %int.make_type_32.loc14_26) -// CHECK:STDOUT: %.loc14_29.2: type = value_of_initializer %int.make_type_32.loc14_16 [template = i32] -// CHECK:STDOUT: %.loc14_29.3: type = converted %int.make_type_32.loc14_16, %.loc14_29.2 [template = i32] -// CHECK:STDOUT: %.loc14_29.4: type = value_of_initializer %int.make_type_32.loc14_21 [template = i32] -// CHECK:STDOUT: %.loc14_29.5: type = converted %int.make_type_32.loc14_21, %.loc14_29.4 [template = i32] -// CHECK:STDOUT: %.loc14_29.6: type = value_of_initializer %int.make_type_32.loc14_26 [template = i32] -// CHECK:STDOUT: %.loc14_29.7: type = converted %int.make_type_32.loc14_26, %.loc14_29.6 [template = i32] +// CHECK:STDOUT: %.loc14_16: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_16: init type = call constants.%Int(%.loc14_16) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_21: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_21: init type = call constants.%Int(%.loc14_21) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_26: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_26: init type = call constants.%Int(%.loc14_26) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_29.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_16, %int.make_type_signed.loc14_21, %int.make_type_signed.loc14_26) +// CHECK:STDOUT: %.loc14_29.2: type = value_of_initializer %int.make_type_signed.loc14_16 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_29.3: type = converted %int.make_type_signed.loc14_16, %.loc14_29.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_29.4: type = value_of_initializer %int.make_type_signed.loc14_21 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_29.5: type = converted %int.make_type_signed.loc14_21, %.loc14_29.4 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_29.6: type = value_of_initializer %int.make_type_signed.loc14_26 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_29.7: type = converted %int.make_type_signed.loc14_26, %.loc14_29.6 [template = constants.%i32] // CHECK:STDOUT: %.loc14_29.8: type = converted %.loc14_29.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %int.make_type_32.loc14_37: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_42: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_47: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_50.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc14_37, %int.make_type_32.loc14_42, %int.make_type_32.loc14_47) -// CHECK:STDOUT: %.loc14_50.2: type = value_of_initializer %int.make_type_32.loc14_37 [template = i32] -// CHECK:STDOUT: %.loc14_50.3: type = converted %int.make_type_32.loc14_37, %.loc14_50.2 [template = i32] -// CHECK:STDOUT: %.loc14_50.4: type = value_of_initializer %int.make_type_32.loc14_42 [template = i32] -// CHECK:STDOUT: %.loc14_50.5: type = converted %int.make_type_32.loc14_42, %.loc14_50.4 [template = i32] -// CHECK:STDOUT: %.loc14_50.6: type = value_of_initializer %int.make_type_32.loc14_47 [template = i32] -// CHECK:STDOUT: %.loc14_50.7: type = converted %int.make_type_32.loc14_47, %.loc14_50.6 [template = i32] +// CHECK:STDOUT: %.loc14_37: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_37: init type = call constants.%Int(%.loc14_37) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_42: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_42: init type = call constants.%Int(%.loc14_42) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_47: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_47: init type = call constants.%Int(%.loc14_47) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_50.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_37, %int.make_type_signed.loc14_42, %int.make_type_signed.loc14_47) +// CHECK:STDOUT: %.loc14_50.2: type = value_of_initializer %int.make_type_signed.loc14_37 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_50.3: type = converted %int.make_type_signed.loc14_37, %.loc14_50.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_50.4: type = value_of_initializer %int.make_type_signed.loc14_42 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_50.5: type = converted %int.make_type_signed.loc14_42, %.loc14_50.4 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_50.6: type = value_of_initializer %int.make_type_signed.loc14_47 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_50.7: type = converted %int.make_type_signed.loc14_47, %.loc14_50.6 [template = constants.%i32] // CHECK:STDOUT: %.loc14_50.8: type = converted %.loc14_50.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc14_51: type = struct_type {.a: %tuple.type.2, .b: %tuple.type.2} [template = constants.%.1] -// CHECK:STDOUT: %v.var: ref %.1 = var v -// CHECK:STDOUT: %v: ref %.1 = bind_name v, %v.var +// CHECK:STDOUT: %.loc14_51: type = struct_type {.a: %tuple.type.2, .b: %tuple.type.2} [template = constants.%.2] +// CHECK:STDOUT: %v.var: ref %.2 = var v +// CHECK:STDOUT: %v: ref %.2 = bind_name v, %v.var // CHECK:STDOUT: %F.ref.loc14_61: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %.loc14_74.1: ref %tuple.type.2 = struct_access %v.var, element0 // CHECK:STDOUT: %F.call.loc14_62: init %tuple.type.2 = call %F.ref.loc14_61() to %.loc14_74.1 // CHECK:STDOUT: %F.ref.loc14_71: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %.loc14_74.2: ref %tuple.type.2 = struct_access %v.var, element1 // CHECK:STDOUT: %F.call.loc14_72: init %tuple.type.2 = call %F.ref.loc14_71() to %.loc14_74.2 -// CHECK:STDOUT: %.loc14_74.3: %.1 = struct_literal (%F.call.loc14_62, %F.call.loc14_72) -// CHECK:STDOUT: %.loc14_74.4: init %.1 = struct_init (%F.call.loc14_62, %F.call.loc14_72) to %v.var -// CHECK:STDOUT: %.loc14_75: init %.1 = converted %.loc14_74.3, %.loc14_74.4 +// CHECK:STDOUT: %.loc14_74.3: %.2 = struct_literal (%F.call.loc14_62, %F.call.loc14_72) +// CHECK:STDOUT: %.loc14_74.4: init %.2 = struct_init (%F.call.loc14_62, %F.call.loc14_72) to %v.var +// CHECK:STDOUT: %.loc14_75: init %.2 = converted %.loc14_74.3, %.loc14_74.4 // CHECK:STDOUT: assign %v.var, %.loc14_75 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/one_entry.carbon b/toolchain/check/testdata/struct/one_entry.carbon index bd012ba4e432..90278e00d026 100644 --- a/toolchain/check/testdata/struct/one_entry.carbon +++ b/toolchain/check/testdata/struct/one_entry.carbon @@ -14,23 +14,26 @@ var y: {.a: i32} = x; // CHECK:STDOUT: --- one_entry.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %.3: type = struct_type {.a: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 4 [template] -// CHECK:STDOUT: %struct: %.1 = struct_value (%.29) [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %i32} [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.4: type = struct_type {.a: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 4 [template] +// CHECK:STDOUT: %struct: %.2 = struct_value (%.27) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -44,36 +47,39 @@ var y: {.a: i32} = x; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32.loc11, %.loc11_13.1 [template = i32] -// CHECK:STDOUT: %.loc11_16: type = struct_type {.a: i32} [template = constants.%.1] -// CHECK:STDOUT: %x.var: ref %.1 = var x -// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32.loc12, %.loc12_13.1 [template = i32] -// CHECK:STDOUT: %.loc12_16: type = struct_type {.a: i32} [template = constants.%.1] -// CHECK:STDOUT: %y.var: ref %.1 = var y -// CHECK:STDOUT: %y: ref %.1 = bind_name y, %y.var +// CHECK:STDOUT: %.loc11_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.3: type = converted %int.make_type_signed.loc11, %.loc11_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_16: type = struct_type {.a: %i32} [template = constants.%.2] +// CHECK:STDOUT: %x.var: ref %.2 = var x +// CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var +// CHECK:STDOUT: %.loc12_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_signed.loc12, %.loc12_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_16: type = struct_type {.a: %i32} [template = constants.%.2] +// CHECK:STDOUT: %y.var: ref %.2 = var y +// CHECK:STDOUT: %y: ref %.2 = bind_name y, %y.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 4 [template = constants.%.2] -// CHECK:STDOUT: %.loc11_27.1: %.3 = struct_literal (%.loc11_26) -// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_26, %.loc11_27.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc11_27.3(%.loc11_26) [template = constants.%.29] -// CHECK:STDOUT: %.loc11_27.4: init i32 = converted %.loc11_26, %int.convert_checked [template = constants.%.29] -// CHECK:STDOUT: %.loc11_27.5: init %.1 = struct_init (%.loc11_27.4) to file.%x.var [template = constants.%struct] -// CHECK:STDOUT: %.loc11_28: init %.1 = converted %.loc11_27.1, %.loc11_27.5 [template = constants.%struct] +// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 4 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_27.1: %.4 = struct_literal (%.loc11_26) +// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_26, %.loc11_27.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc11_27.4: = specific_function %.loc11_27.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc11_27.4(%.loc11_26) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_27.5: init %i32 = converted %.loc11_26, %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc11_27.6: init %.2 = struct_init (%.loc11_27.5) to file.%x.var [template = constants.%struct] +// CHECK:STDOUT: %.loc11_28: init %.2 = converted %.loc11_27.1, %.loc11_27.6 [template = constants.%struct] // CHECK:STDOUT: assign file.%x.var, %.loc11_28 -// CHECK:STDOUT: %x.ref: ref %.1 = name_ref x, file.%x -// CHECK:STDOUT: %.loc12_20.1: ref i32 = struct_access %x.ref, element0 -// CHECK:STDOUT: %.loc12_20.2: i32 = bind_value %.loc12_20.1 -// CHECK:STDOUT: %.loc12_20.3: init %.1 = struct_init (%.loc12_20.2) to file.%y.var -// CHECK:STDOUT: %.loc12_21: init %.1 = converted %x.ref, %.loc12_20.3 +// CHECK:STDOUT: %x.ref: ref %.2 = name_ref x, file.%x +// CHECK:STDOUT: %.loc12_20.1: ref %i32 = struct_access %x.ref, element0 +// CHECK:STDOUT: %.loc12_20.2: %i32 = bind_value %.loc12_20.1 +// CHECK:STDOUT: %.loc12_20.3: init %.2 = struct_init (%.loc12_20.2) to file.%y.var +// CHECK:STDOUT: %.loc12_21: init %.2 = converted %x.ref, %.loc12_20.3 // CHECK:STDOUT: assign file.%y.var, %.loc12_21 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/reorder_fields.carbon b/toolchain/check/testdata/struct/reorder_fields.carbon index 43c01b091f80..e9f3fc768bc4 100644 --- a/toolchain/check/testdata/struct/reorder_fields.carbon +++ b/toolchain/check/testdata/struct/reorder_fields.carbon @@ -20,24 +20,26 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: --- reorder_fields.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %MakeI32.type: type = fn_type @MakeI32 [template] // CHECK:STDOUT: %MakeI32: %MakeI32.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %MakeF64.type: type = fn_type @MakeF64 [template] // CHECK:STDOUT: %MakeF64: %MakeF64.type = struct_value () [template] -// CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: f64} [template] +// CHECK:STDOUT: %.3: type = struct_type {.a: %i32, .b: f64} [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = struct_type {.b: f64, .a: i32} [template] +// CHECK:STDOUT: %.5: type = struct_type {.b: f64, .a: %i32} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .Float = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -53,20 +55,21 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %MakeI32.decl: %MakeI32.type = fn_decl @MakeI32 [template = constants.%MakeI32] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_32, %.loc11_17.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc11_17.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_17.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed, %.loc11_17.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %MakeF64.decl: %MakeF64.type = fn_decl @MakeF64 [template = constants.%MakeF64] { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc12_17.1: Core.IntLiteral = int_value 64 [template = constants.%.1] +// CHECK:STDOUT: %.loc12_17.1: Core.IntLiteral = int_value 64 [template = constants.%.2] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc12_17.1) [template = f64] // CHECK:STDOUT: %.loc12_17.2: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc12_17.3: type = converted %float.make_type, %.loc12_17.2 [template = f64] @@ -74,71 +77,74 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %.3 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %.3 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_16.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] -// CHECK:STDOUT: %.loc14_16.2: type = converted %int.make_type_32.loc14, %.loc14_16.1 [template = i32] -// CHECK:STDOUT: %.loc14_25.1: Core.IntLiteral = int_value 64 [template = constants.%.1] +// CHECK:STDOUT: %.loc14_16.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%.loc14_16.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_16.2: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_16.3: type = converted %int.make_type_signed.loc14, %.loc14_16.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_25.1: Core.IntLiteral = int_value 64 [template = constants.%.2] // CHECK:STDOUT: %float.make_type.loc14: init type = call constants.%Float(%.loc14_25.1) [template = f64] // CHECK:STDOUT: %.loc14_25.2: type = value_of_initializer %float.make_type.loc14 [template = f64] // CHECK:STDOUT: %.loc14_25.3: type = converted %float.make_type.loc14, %.loc14_25.2 [template = f64] -// CHECK:STDOUT: %.loc14_28: type = struct_type {.a: i32, .b: f64} [template = constants.%.2] -// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param +// CHECK:STDOUT: %.loc14_28: type = struct_type {.a: %i32, .b: f64} [template = constants.%.3] +// CHECK:STDOUT: %return.param: ref %.3 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %.3 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @MakeI32() -> i32; +// CHECK:STDOUT: fn @MakeI32() -> %i32; // CHECK:STDOUT: // CHECK:STDOUT: fn @MakeF64() -> f64; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> %return: %.2 { +// CHECK:STDOUT: fn @F() -> %return: %.3 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_15.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_15.2: type = converted %int.make_type_32.loc15, %.loc15_15.1 [template = i32] -// CHECK:STDOUT: %.loc15_24.1: Core.IntLiteral = int_value 64 [template = constants.%.1] +// CHECK:STDOUT: %.loc15_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_15.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_15.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_15.3: type = converted %int.make_type_signed.loc15, %.loc15_15.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_24.1: Core.IntLiteral = int_value 64 [template = constants.%.2] // CHECK:STDOUT: %float.make_type.loc15: init type = call constants.%Float(%.loc15_24.1) [template = f64] // CHECK:STDOUT: %.loc15_24.2: type = value_of_initializer %float.make_type.loc15 [template = f64] // CHECK:STDOUT: %.loc15_24.3: type = converted %float.make_type.loc15, %.loc15_24.2 [template = f64] -// CHECK:STDOUT: %.loc15_27: type = struct_type {.a: i32, .b: f64} [template = constants.%.2] +// CHECK:STDOUT: %.loc15_27: type = struct_type {.a: %i32, .b: f64} [template = constants.%.3] // CHECK:STDOUT: %MakeF64.ref: %MakeF64.type = name_ref MakeF64, file.%MakeF64.decl [template = constants.%MakeF64] // CHECK:STDOUT: %MakeF64.call: init f64 = call %MakeF64.ref() // CHECK:STDOUT: %MakeI32.ref: %MakeI32.type = name_ref MakeI32, file.%MakeI32.decl [template = constants.%MakeI32] -// CHECK:STDOUT: %MakeI32.call: init i32 = call %MakeI32.ref() -// CHECK:STDOUT: %.loc15_62.1: %.4 = struct_literal (%MakeF64.call, %MakeI32.call) -// CHECK:STDOUT: %.loc15_62.2: i32 = value_of_initializer %MakeI32.call -// CHECK:STDOUT: %.loc15_62.3: i32 = converted %MakeI32.call, %.loc15_62.2 +// CHECK:STDOUT: %MakeI32.call: init %i32 = call %MakeI32.ref() +// CHECK:STDOUT: %.loc15_62.1: %.5 = struct_literal (%MakeF64.call, %MakeI32.call) +// CHECK:STDOUT: %.loc15_62.2: %i32 = value_of_initializer %MakeI32.call +// CHECK:STDOUT: %.loc15_62.3: %i32 = converted %MakeI32.call, %.loc15_62.2 // CHECK:STDOUT: %.loc15_62.4: f64 = value_of_initializer %MakeF64.call // CHECK:STDOUT: %.loc15_62.5: f64 = converted %MakeF64.call, %.loc15_62.4 -// CHECK:STDOUT: %struct.loc15: %.2 = struct_value (%.loc15_62.3, %.loc15_62.5) -// CHECK:STDOUT: %.loc15_63: %.2 = converted %.loc15_62.1, %struct.loc15 -// CHECK:STDOUT: %x: %.2 = bind_name x, %.loc15_63 -// CHECK:STDOUT: %.loc16_15.1: Core.IntLiteral = int_value 64 [template = constants.%.1] +// CHECK:STDOUT: %struct.loc15: %.3 = struct_value (%.loc15_62.3, %.loc15_62.5) +// CHECK:STDOUT: %.loc15_63: %.3 = converted %.loc15_62.1, %struct.loc15 +// CHECK:STDOUT: %x: %.3 = bind_name x, %.loc15_63 +// CHECK:STDOUT: %.loc16_15.1: Core.IntLiteral = int_value 64 [template = constants.%.2] // CHECK:STDOUT: %float.make_type.loc16: init type = call constants.%Float(%.loc16_15.1) [template = f64] // CHECK:STDOUT: %.loc16_15.2: type = value_of_initializer %float.make_type.loc16 [template = f64] // CHECK:STDOUT: %.loc16_15.3: type = converted %float.make_type.loc16, %.loc16_15.2 [template = f64] -// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_24.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] -// CHECK:STDOUT: %.loc16_24.2: type = converted %int.make_type_32.loc16, %.loc16_24.1 [template = i32] -// CHECK:STDOUT: %.loc16_27: type = struct_type {.b: f64, .a: i32} [template = constants.%.4] -// CHECK:STDOUT: %x.ref: %.2 = name_ref x, %x +// CHECK:STDOUT: %.loc16_24.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%.loc16_24.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_24.2: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_24.3: type = converted %int.make_type_signed.loc16, %.loc16_24.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_27: type = struct_type {.b: f64, .a: %i32} [template = constants.%.5] +// CHECK:STDOUT: %x.ref: %.3 = name_ref x, %x // CHECK:STDOUT: %.loc16_31.1: f64 = struct_access %x.ref, element1 -// CHECK:STDOUT: %.loc16_31.2: i32 = struct_access %x.ref, element0 -// CHECK:STDOUT: %struct.loc16: %.4 = struct_value (%.loc16_31.1, %.loc16_31.2) -// CHECK:STDOUT: %.loc16_32: %.4 = converted %x.ref, %struct.loc16 -// CHECK:STDOUT: %y: %.4 = bind_name y, %.loc16_32 -// CHECK:STDOUT: %y.ref: %.4 = name_ref y, %y -// CHECK:STDOUT: %.loc17_10.1: i32 = struct_access %y.ref, element1 -// CHECK:STDOUT: %.loc17_10.2: ref i32 = struct_access %return, element1 -// CHECK:STDOUT: %.loc17_10.3: init i32 = initialize_from %.loc17_10.1 to %.loc17_10.2 +// CHECK:STDOUT: %.loc16_31.2: %i32 = struct_access %x.ref, element0 +// CHECK:STDOUT: %struct.loc16: %.5 = struct_value (%.loc16_31.1, %.loc16_31.2) +// CHECK:STDOUT: %.loc16_32: %.5 = converted %x.ref, %struct.loc16 +// CHECK:STDOUT: %y: %.5 = bind_name y, %.loc16_32 +// CHECK:STDOUT: %y.ref: %.5 = name_ref y, %y +// CHECK:STDOUT: %.loc17_10.1: %i32 = struct_access %y.ref, element1 +// CHECK:STDOUT: %.loc17_10.2: ref %i32 = struct_access %return, element1 +// CHECK:STDOUT: %.loc17_10.3: init %i32 = initialize_from %.loc17_10.1 to %.loc17_10.2 // CHECK:STDOUT: %.loc17_10.4: f64 = struct_access %y.ref, element0 // CHECK:STDOUT: %.loc17_10.5: ref f64 = struct_access %return, element0 // CHECK:STDOUT: %.loc17_10.6: init f64 = initialize_from %.loc17_10.4 to %.loc17_10.5 -// CHECK:STDOUT: %.loc17_10.7: init %.2 = struct_init (%.loc17_10.3, %.loc17_10.6) to %return -// CHECK:STDOUT: %.loc17_11: init %.2 = converted %y.ref, %.loc17_10.7 +// CHECK:STDOUT: %.loc17_10.7: init %.3 = struct_init (%.loc17_10.3, %.loc17_10.6) to %return +// CHECK:STDOUT: %.loc17_11: init %.3 = converted %y.ref, %.loc17_10.7 // CHECK:STDOUT: return %.loc17_11 to %return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/tuple_as_element.carbon b/toolchain/check/testdata/struct/tuple_as_element.carbon index da8421a7e2a0..f077d82b97e4 100644 --- a/toolchain/check/testdata/struct/tuple_as_element.carbon +++ b/toolchain/check/testdata/struct/tuple_as_element.carbon @@ -14,30 +14,34 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: --- tuple_as_element.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: i32, .b: %tuple.type.2} [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %i32, .b: %tuple.type.2} [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %.5: type = struct_type {.a: Core.IntLiteral, .b: %tuple.type.3} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 2 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.33) [template] -// CHECK:STDOUT: %struct: %.1 = struct_value (%.31, %tuple) [template] +// CHECK:STDOUT: %.6: type = struct_type {.a: Core.IntLiteral, .b: %tuple.type.3} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 2 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.32) [template] +// CHECK:STDOUT: %struct: %.2 = struct_value (%.29, %tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -51,67 +55,73 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11_13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32.loc11_13 [template = i32] -// CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32.loc11_13, %.loc11_13.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_27.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_23) -// CHECK:STDOUT: %.loc11_27.2: type = value_of_initializer %int.make_type_32.loc11_23 [template = i32] -// CHECK:STDOUT: %.loc11_27.3: type = converted %int.make_type_32.loc11_23, %.loc11_27.2 [template = i32] +// CHECK:STDOUT: %.loc11_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_13: init type = call constants.%Int(%.loc11_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_signed.loc11_13 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.3: type = converted %int.make_type_signed.loc11_13, %.loc11_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_23: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_23: init type = call constants.%Int(%.loc11_23) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_27.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_23) +// CHECK:STDOUT: %.loc11_27.2: type = value_of_initializer %int.make_type_signed.loc11_23 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_27.3: type = converted %int.make_type_signed.loc11_23, %.loc11_27.2 [template = constants.%i32] // CHECK:STDOUT: %.loc11_27.4: type = converted %.loc11_27.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc11_28: type = struct_type {.a: i32, .b: %tuple.type.2} [template = constants.%.1] -// CHECK:STDOUT: %x.var: ref %.1 = var x -// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var -// CHECK:STDOUT: %int.make_type_32.loc12_13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32.loc12_13 [template = i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32.loc12_13, %.loc12_13.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc12_23: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_27.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc12_23) -// CHECK:STDOUT: %.loc12_27.2: type = value_of_initializer %int.make_type_32.loc12_23 [template = i32] -// CHECK:STDOUT: %.loc12_27.3: type = converted %int.make_type_32.loc12_23, %.loc12_27.2 [template = i32] +// CHECK:STDOUT: %.loc11_28: type = struct_type {.a: %i32, .b: %tuple.type.2} [template = constants.%.2] +// CHECK:STDOUT: %x.var: ref %.2 = var x +// CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var +// CHECK:STDOUT: %.loc12_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_13: init type = call constants.%Int(%.loc12_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_signed.loc12_13 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_signed.loc12_13, %.loc12_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_23: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_23: init type = call constants.%Int(%.loc12_23) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_27.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc12_23) +// CHECK:STDOUT: %.loc12_27.2: type = value_of_initializer %int.make_type_signed.loc12_23 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_27.3: type = converted %int.make_type_signed.loc12_23, %.loc12_27.2 [template = constants.%i32] // CHECK:STDOUT: %.loc12_27.4: type = converted %.loc12_27.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc12_28: type = struct_type {.a: i32, .b: %tuple.type.2} [template = constants.%.1] -// CHECK:STDOUT: %y.var: ref %.1 = var y -// CHECK:STDOUT: %y: ref %.1 = bind_name y, %y.var +// CHECK:STDOUT: %.loc12_28: type = struct_type {.a: %i32, .b: %tuple.type.2} [template = constants.%.2] +// CHECK:STDOUT: %y.var: ref %.2 = var y +// CHECK:STDOUT: %y: ref %.2 = bind_name y, %y.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_38: Core.IntLiteral = int_value 1 [template = constants.%.3] -// CHECK:STDOUT: %.loc11_47: Core.IntLiteral = int_value 2 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_38: Core.IntLiteral = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_47: Core.IntLiteral = int_value 2 [template = constants.%.5] // CHECK:STDOUT: %.loc11_49.1: %tuple.type.3 = tuple_literal (%.loc11_47) -// CHECK:STDOUT: %.loc11_50.1: %.5 = struct_literal (%.loc11_38, %.loc11_49.1) -// CHECK:STDOUT: %.loc11_50.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_50.3: = bound_method %.loc11_38, %.loc11_50.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_50: init i32 = call %.loc11_50.3(%.loc11_38) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_50.4: init i32 = converted %.loc11_38, %int.convert_checked.loc11_50 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_50.5: ref i32 = struct_access file.%x.var, element0 -// CHECK:STDOUT: %.loc11_50.6: init i32 = initialize_from %.loc11_50.4 to %.loc11_50.5 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_49.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_49.3: = bound_method %.loc11_47, %.loc11_49.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc11_49: init i32 = call %.loc11_49.3(%.loc11_47) [template = constants.%.33] -// CHECK:STDOUT: %.loc11_49.4: init i32 = converted %.loc11_47, %int.convert_checked.loc11_49 [template = constants.%.33] -// CHECK:STDOUT: %.loc11_50.7: ref %tuple.type.2 = struct_access file.%x.var, element1 -// CHECK:STDOUT: %.loc11_49.5: init %tuple.type.2 = tuple_init (%.loc11_49.4) to %.loc11_50.7 [template = constants.%tuple] -// CHECK:STDOUT: %.loc11_50.8: init %tuple.type.2 = converted %.loc11_49.1, %.loc11_49.5 [template = constants.%tuple] -// CHECK:STDOUT: %.loc11_50.9: init %tuple.type.2 = initialize_from %.loc11_50.8 to %.loc11_50.7 [template = constants.%tuple] -// CHECK:STDOUT: %.loc11_50.10: init %.1 = struct_init (%.loc11_50.6, %.loc11_50.9) to file.%x.var [template = constants.%struct] -// CHECK:STDOUT: %.loc11_51: init %.1 = converted %.loc11_50.1, %.loc11_50.10 [template = constants.%struct] +// CHECK:STDOUT: %.loc11_50.1: %.6 = struct_literal (%.loc11_38, %.loc11_49.1) +// CHECK:STDOUT: %.loc11_50.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_50.3: = bound_method %.loc11_38, %.loc11_50.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_50.4: = specific_function %.loc11_50.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc11_50: init %i32 = call %.loc11_50.4(%.loc11_38) [template = constants.%.29] +// CHECK:STDOUT: %.loc11_50.5: init %i32 = converted %.loc11_38, %int.convert_checked.loc11_50 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_50.6: ref %i32 = struct_access file.%x.var, element0 +// CHECK:STDOUT: %.loc11_50.7: init %i32 = initialize_from %.loc11_50.5 to %.loc11_50.6 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_49.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_49.3: = bound_method %.loc11_47, %.loc11_49.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_49.4: = specific_function %.loc11_49.3, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc11_49: init %i32 = call %.loc11_49.4(%.loc11_47) [template = constants.%.32] +// CHECK:STDOUT: %.loc11_49.5: init %i32 = converted %.loc11_47, %int.convert_checked.loc11_49 [template = constants.%.32] +// CHECK:STDOUT: %.loc11_50.8: ref %tuple.type.2 = struct_access file.%x.var, element1 +// CHECK:STDOUT: %.loc11_49.6: init %tuple.type.2 = tuple_init (%.loc11_49.5) to %.loc11_50.8 [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_50.9: init %tuple.type.2 = converted %.loc11_49.1, %.loc11_49.6 [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_50.10: init %tuple.type.2 = initialize_from %.loc11_50.9 to %.loc11_50.8 [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_50.11: init %.2 = struct_init (%.loc11_50.7, %.loc11_50.10) to file.%x.var [template = constants.%struct] +// CHECK:STDOUT: %.loc11_51: init %.2 = converted %.loc11_50.1, %.loc11_50.11 [template = constants.%struct] // CHECK:STDOUT: assign file.%x.var, %.loc11_51 -// CHECK:STDOUT: %x.ref: ref %.1 = name_ref x, file.%x -// CHECK:STDOUT: %.loc12_32.1: ref i32 = struct_access %x.ref, element0 -// CHECK:STDOUT: %.loc12_32.2: i32 = bind_value %.loc12_32.1 -// CHECK:STDOUT: %.loc12_32.3: ref i32 = struct_access file.%y.var, element0 -// CHECK:STDOUT: %.loc12_32.4: init i32 = initialize_from %.loc12_32.2 to %.loc12_32.3 +// CHECK:STDOUT: %x.ref: ref %.2 = name_ref x, file.%x +// CHECK:STDOUT: %.loc12_32.1: ref %i32 = struct_access %x.ref, element0 +// CHECK:STDOUT: %.loc12_32.2: %i32 = bind_value %.loc12_32.1 +// CHECK:STDOUT: %.loc12_32.3: ref %i32 = struct_access file.%y.var, element0 +// CHECK:STDOUT: %.loc12_32.4: init %i32 = initialize_from %.loc12_32.2 to %.loc12_32.3 // CHECK:STDOUT: %.loc12_32.5: ref %tuple.type.2 = struct_access %x.ref, element1 -// CHECK:STDOUT: %.loc12_32.6: ref i32 = tuple_access %.loc12_32.5, element0 -// CHECK:STDOUT: %.loc12_32.7: i32 = bind_value %.loc12_32.6 +// CHECK:STDOUT: %.loc12_32.6: ref %i32 = tuple_access %.loc12_32.5, element0 +// CHECK:STDOUT: %.loc12_32.7: %i32 = bind_value %.loc12_32.6 // CHECK:STDOUT: %.loc12_32.8: ref %tuple.type.2 = struct_access file.%y.var, element1 // CHECK:STDOUT: %.loc12_32.9: init %tuple.type.2 = tuple_init (%.loc12_32.7) to %.loc12_32.8 // CHECK:STDOUT: %.loc12_32.10: init %tuple.type.2 = converted %.loc12_32.5, %.loc12_32.9 // CHECK:STDOUT: %.loc12_32.11: init %tuple.type.2 = initialize_from %.loc12_32.10 to %.loc12_32.8 -// CHECK:STDOUT: %.loc12_32.12: init %.1 = struct_init (%.loc12_32.4, %.loc12_32.11) to file.%y.var -// CHECK:STDOUT: %.loc12_33: init %.1 = converted %x.ref, %.loc12_32.12 +// CHECK:STDOUT: %.loc12_32.12: init %.2 = struct_init (%.loc12_32.4, %.loc12_32.11) to file.%y.var +// CHECK:STDOUT: %.loc12_33: init %.2 = converted %x.ref, %.loc12_32.12 // CHECK:STDOUT: assign file.%y.var, %.loc12_33 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/two_entries.carbon b/toolchain/check/testdata/struct/two_entries.carbon index 9cbbe99ae47b..c718e9bd3e5a 100644 --- a/toolchain/check/testdata/struct/two_entries.carbon +++ b/toolchain/check/testdata/struct/two_entries.carbon @@ -17,26 +17,30 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: --- two_entries.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.5: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 2 [template] -// CHECK:STDOUT: %struct: %.1 = struct_value (%.31, %.33) [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] +// CHECK:STDOUT: %.2: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.6: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 2 [template] +// CHECK:STDOUT: %struct: %.2 = struct_value (%.29, %.32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -52,89 +56,101 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11_13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32.loc11_13 [template = i32] -// CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32.loc11_13, %.loc11_13.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_22.1: type = value_of_initializer %int.make_type_32.loc11_22 [template = i32] -// CHECK:STDOUT: %.loc11_22.2: type = converted %int.make_type_32.loc11_22, %.loc11_22.1 [template = i32] -// CHECK:STDOUT: %.loc11_25: type = struct_type {.a: i32, .b: i32} [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32.loc12_13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32.loc12_13 [template = i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32.loc12_13, %.loc12_13.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc12_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_22.1: type = value_of_initializer %int.make_type_32.loc12_22 [template = i32] -// CHECK:STDOUT: %.loc12_22.2: type = converted %int.make_type_32.loc12_22, %.loc12_22.1 [template = i32] -// CHECK:STDOUT: %.loc12_25: type = struct_type {.a: i32, .b: i32} [template = constants.%.1] -// CHECK:STDOUT: %int.make_type_32.loc14_13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32.loc14_13 [template = i32] -// CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32.loc14_13, %.loc14_13.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_22.1: type = value_of_initializer %int.make_type_32.loc14_22 [template = i32] -// CHECK:STDOUT: %.loc14_22.2: type = converted %int.make_type_32.loc14_22, %.loc14_22.1 [template = i32] -// CHECK:STDOUT: %.loc14_25: type = struct_type {.a: i32, .b: i32} [template = constants.%.1] -// CHECK:STDOUT: %x.var: ref %.1 = var x -// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var -// CHECK:STDOUT: %int.make_type_32.loc15_13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_13.1: type = value_of_initializer %int.make_type_32.loc15_13 [template = i32] -// CHECK:STDOUT: %.loc15_13.2: type = converted %int.make_type_32.loc15_13, %.loc15_13.1 [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc15_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_22.1: type = value_of_initializer %int.make_type_32.loc15_22 [template = i32] -// CHECK:STDOUT: %.loc15_22.2: type = converted %int.make_type_32.loc15_22, %.loc15_22.1 [template = i32] -// CHECK:STDOUT: %.loc15_25: type = struct_type {.a: i32, .b: i32} [template = constants.%.1] -// CHECK:STDOUT: %y.var: ref %.1 = var y -// CHECK:STDOUT: %y: ref %.1 = bind_name y, %y.var +// CHECK:STDOUT: %.loc11_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_13: init type = call constants.%Int(%.loc11_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_signed.loc11_13 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.3: type = converted %int.make_type_signed.loc11_13, %.loc11_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_22: init type = call constants.%Int(%.loc11_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22.2: type = value_of_initializer %int.make_type_signed.loc11_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22.3: type = converted %int.make_type_signed.loc11_22, %.loc11_22.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25: type = struct_type {.a: %i32, .b: %i32} [template = constants.%.2] +// CHECK:STDOUT: %.loc12_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_13: init type = call constants.%Int(%.loc12_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_signed.loc12_13 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_signed.loc12_13, %.loc12_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_22: init type = call constants.%Int(%.loc12_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_22.2: type = value_of_initializer %int.make_type_signed.loc12_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_22.3: type = converted %int.make_type_signed.loc12_22, %.loc12_22.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_25: type = struct_type {.a: %i32, .b: %i32} [template = constants.%.2] +// CHECK:STDOUT: %.loc14_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_13: init type = call constants.%Int(%.loc14_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_13.2: type = value_of_initializer %int.make_type_signed.loc14_13 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_13.3: type = converted %int.make_type_signed.loc14_13, %.loc14_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_22: init type = call constants.%Int(%.loc14_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_22.2: type = value_of_initializer %int.make_type_signed.loc14_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_22.3: type = converted %int.make_type_signed.loc14_22, %.loc14_22.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_25: type = struct_type {.a: %i32, .b: %i32} [template = constants.%.2] +// CHECK:STDOUT: %x.var: ref %.2 = var x +// CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var +// CHECK:STDOUT: %.loc15_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15_13: init type = call constants.%Int(%.loc15_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_13.2: type = value_of_initializer %int.make_type_signed.loc15_13 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_13.3: type = converted %int.make_type_signed.loc15_13, %.loc15_13.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_22.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15_22: init type = call constants.%Int(%.loc15_22.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_22.2: type = value_of_initializer %int.make_type_signed.loc15_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_22.3: type = converted %int.make_type_signed.loc15_22, %.loc15_22.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_25: type = struct_type {.a: %i32, .b: %i32} [template = constants.%.2] +// CHECK:STDOUT: %y.var: ref %.2 = var y +// CHECK:STDOUT: %y: ref %.2 = bind_name y, %y.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_35: Core.IntLiteral = int_value 1 [template = constants.%.3] -// CHECK:STDOUT: %.loc11_43: Core.IntLiteral = int_value 2 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_44.1: %.5 = struct_literal (%.loc11_35, %.loc11_43) -// CHECK:STDOUT: %.loc11_44.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_44.3: = bound_method %.loc11_35, %.loc11_44.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_44.1: init i32 = call %.loc11_44.3(%.loc11_35) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_44.4: i32 = value_of_initializer %int.convert_checked.loc11_44.1 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_44.5: i32 = converted %.loc11_35, %.loc11_44.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_44.6: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_44.7: = bound_method %.loc11_43, %.loc11_44.6 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc11_44.2: init i32 = call %.loc11_44.7(%.loc11_43) [template = constants.%.33] -// CHECK:STDOUT: %.loc11_44.8: i32 = value_of_initializer %int.convert_checked.loc11_44.2 [template = constants.%.33] -// CHECK:STDOUT: %.loc11_44.9: i32 = converted %.loc11_43, %.loc11_44.8 [template = constants.%.33] -// CHECK:STDOUT: %struct: %.1 = struct_value (%.loc11_44.5, %.loc11_44.9) [template = constants.%struct] -// CHECK:STDOUT: %.loc11_45: %.1 = converted %.loc11_44.1, %struct [template = constants.%struct] -// CHECK:STDOUT: %v: %.1 = bind_name v, %.loc11_45 -// CHECK:STDOUT: %v.ref: %.1 = name_ref v, %v -// CHECK:STDOUT: %w: %.1 = bind_name w, %v.ref -// CHECK:STDOUT: %.loc14_35: Core.IntLiteral = int_value 1 [template = constants.%.3] -// CHECK:STDOUT: %.loc14_43: Core.IntLiteral = int_value 2 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_44.1: %.5 = struct_literal (%.loc14_35, %.loc14_43) -// CHECK:STDOUT: %.loc14_44.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_44.3: = bound_method %.loc14_35, %.loc14_44.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc14_44.1: init i32 = call %.loc14_44.3(%.loc14_35) [template = constants.%.31] -// CHECK:STDOUT: %.loc14_44.4: init i32 = converted %.loc14_35, %int.convert_checked.loc14_44.1 [template = constants.%.31] -// CHECK:STDOUT: %.loc14_44.5: ref i32 = struct_access file.%x.var, element0 -// CHECK:STDOUT: %.loc14_44.6: init i32 = initialize_from %.loc14_44.4 to %.loc14_44.5 [template = constants.%.31] -// CHECK:STDOUT: %.loc14_44.7: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_44.8: = bound_method %.loc14_43, %.loc14_44.7 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc14_44.2: init i32 = call %.loc14_44.8(%.loc14_43) [template = constants.%.33] -// CHECK:STDOUT: %.loc14_44.9: init i32 = converted %.loc14_43, %int.convert_checked.loc14_44.2 [template = constants.%.33] -// CHECK:STDOUT: %.loc14_44.10: ref i32 = struct_access file.%x.var, element1 -// CHECK:STDOUT: %.loc14_44.11: init i32 = initialize_from %.loc14_44.9 to %.loc14_44.10 [template = constants.%.33] -// CHECK:STDOUT: %.loc14_44.12: init %.1 = struct_init (%.loc14_44.6, %.loc14_44.11) to file.%x.var [template = constants.%struct] -// CHECK:STDOUT: %.loc14_45: init %.1 = converted %.loc14_44.1, %.loc14_44.12 [template = constants.%struct] +// CHECK:STDOUT: %.loc11_35: Core.IntLiteral = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_43: Core.IntLiteral = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_44.1: %.6 = struct_literal (%.loc11_35, %.loc11_43) +// CHECK:STDOUT: %.loc11_44.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_44.3: = bound_method %.loc11_35, %.loc11_44.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_44.4: = specific_function %.loc11_44.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc11_44.1: init %i32 = call %.loc11_44.4(%.loc11_35) [template = constants.%.29] +// CHECK:STDOUT: %.loc11_44.5: %i32 = value_of_initializer %int.convert_checked.loc11_44.1 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_44.6: %i32 = converted %.loc11_35, %.loc11_44.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_44.7: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_44.8: = bound_method %.loc11_43, %.loc11_44.7 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_44.9: = specific_function %.loc11_44.8, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc11_44.2: init %i32 = call %.loc11_44.9(%.loc11_43) [template = constants.%.32] +// CHECK:STDOUT: %.loc11_44.10: %i32 = value_of_initializer %int.convert_checked.loc11_44.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc11_44.11: %i32 = converted %.loc11_43, %.loc11_44.10 [template = constants.%.32] +// CHECK:STDOUT: %struct: %.2 = struct_value (%.loc11_44.6, %.loc11_44.11) [template = constants.%struct] +// CHECK:STDOUT: %.loc11_45: %.2 = converted %.loc11_44.1, %struct [template = constants.%struct] +// CHECK:STDOUT: %v: %.2 = bind_name v, %.loc11_45 +// CHECK:STDOUT: %v.ref: %.2 = name_ref v, %v +// CHECK:STDOUT: %w: %.2 = bind_name w, %v.ref +// CHECK:STDOUT: %.loc14_35: Core.IntLiteral = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc14_43: Core.IntLiteral = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_44.1: %.6 = struct_literal (%.loc14_35, %.loc14_43) +// CHECK:STDOUT: %.loc14_44.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_44.3: = bound_method %.loc14_35, %.loc14_44.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc14_44.4: = specific_function %.loc14_44.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc14_44.1: init %i32 = call %.loc14_44.4(%.loc14_35) [template = constants.%.29] +// CHECK:STDOUT: %.loc14_44.5: init %i32 = converted %.loc14_35, %int.convert_checked.loc14_44.1 [template = constants.%.29] +// CHECK:STDOUT: %.loc14_44.6: ref %i32 = struct_access file.%x.var, element0 +// CHECK:STDOUT: %.loc14_44.7: init %i32 = initialize_from %.loc14_44.5 to %.loc14_44.6 [template = constants.%.29] +// CHECK:STDOUT: %.loc14_44.8: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_44.9: = bound_method %.loc14_43, %.loc14_44.8 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_44.10: = specific_function %.loc14_44.9, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc14_44.2: init %i32 = call %.loc14_44.10(%.loc14_43) [template = constants.%.32] +// CHECK:STDOUT: %.loc14_44.11: init %i32 = converted %.loc14_43, %int.convert_checked.loc14_44.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc14_44.12: ref %i32 = struct_access file.%x.var, element1 +// CHECK:STDOUT: %.loc14_44.13: init %i32 = initialize_from %.loc14_44.11 to %.loc14_44.12 [template = constants.%.32] +// CHECK:STDOUT: %.loc14_44.14: init %.2 = struct_init (%.loc14_44.7, %.loc14_44.13) to file.%x.var [template = constants.%struct] +// CHECK:STDOUT: %.loc14_45: init %.2 = converted %.loc14_44.1, %.loc14_44.14 [template = constants.%struct] // CHECK:STDOUT: assign file.%x.var, %.loc14_45 -// CHECK:STDOUT: %x.ref: ref %.1 = name_ref x, file.%x -// CHECK:STDOUT: %.loc15_29.1: ref i32 = struct_access %x.ref, element0 -// CHECK:STDOUT: %.loc15_29.2: i32 = bind_value %.loc15_29.1 -// CHECK:STDOUT: %.loc15_29.3: ref i32 = struct_access file.%y.var, element0 -// CHECK:STDOUT: %.loc15_29.4: init i32 = initialize_from %.loc15_29.2 to %.loc15_29.3 -// CHECK:STDOUT: %.loc15_29.5: ref i32 = struct_access %x.ref, element1 -// CHECK:STDOUT: %.loc15_29.6: i32 = bind_value %.loc15_29.5 -// CHECK:STDOUT: %.loc15_29.7: ref i32 = struct_access file.%y.var, element1 -// CHECK:STDOUT: %.loc15_29.8: init i32 = initialize_from %.loc15_29.6 to %.loc15_29.7 -// CHECK:STDOUT: %.loc15_29.9: init %.1 = struct_init (%.loc15_29.4, %.loc15_29.8) to file.%y.var -// CHECK:STDOUT: %.loc15_30: init %.1 = converted %x.ref, %.loc15_29.9 +// CHECK:STDOUT: %x.ref: ref %.2 = name_ref x, file.%x +// CHECK:STDOUT: %.loc15_29.1: ref %i32 = struct_access %x.ref, element0 +// CHECK:STDOUT: %.loc15_29.2: %i32 = bind_value %.loc15_29.1 +// CHECK:STDOUT: %.loc15_29.3: ref %i32 = struct_access file.%y.var, element0 +// CHECK:STDOUT: %.loc15_29.4: init %i32 = initialize_from %.loc15_29.2 to %.loc15_29.3 +// CHECK:STDOUT: %.loc15_29.5: ref %i32 = struct_access %x.ref, element1 +// CHECK:STDOUT: %.loc15_29.6: %i32 = bind_value %.loc15_29.5 +// CHECK:STDOUT: %.loc15_29.7: ref %i32 = struct_access file.%y.var, element1 +// CHECK:STDOUT: %.loc15_29.8: init %i32 = initialize_from %.loc15_29.6 to %.loc15_29.7 +// CHECK:STDOUT: %.loc15_29.9: init %.2 = struct_init (%.loc15_29.4, %.loc15_29.8) to file.%y.var +// CHECK:STDOUT: %.loc15_30: init %.2 = converted %x.ref, %.loc15_29.9 // CHECK:STDOUT: assign file.%y.var, %.loc15_30 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/element_access.carbon b/toolchain/check/testdata/tuple/access/element_access.carbon index d01fe14d1631..c90b76fd6305 100644 --- a/toolchain/check/testdata/tuple/access/element_access.carbon +++ b/toolchain/check/testdata/tuple/access/element_access.carbon @@ -15,25 +15,28 @@ var c: i32 = b.0; // CHECK:STDOUT: --- element_access.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 12 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.27) [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 12 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.25) [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -48,48 +51,52 @@ var c: i32 = b.0; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_13.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11) -// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_13.3: type = converted %int.make_type_32.loc11, %.loc11_13.2 [template = i32] +// CHECK:STDOUT: %.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11) +// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.3: type = converted %int.make_type_signed.loc11, %.loc11_13.2 [template = constants.%i32] // CHECK:STDOUT: %.loc11_13.4: type = converted %.loc11_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_13.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc12) -// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_32.loc12, %.loc12_13.2 [template = i32] +// CHECK:STDOUT: %.loc12_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc12) +// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_signed.loc12, %.loc12_13.2 [template = constants.%i32] // CHECK:STDOUT: %.loc12_13.4: type = converted %.loc12_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %b.var: ref %tuple.type.2 = var b // CHECK:STDOUT: %b: ref %tuple.type.2 = bind_name b, %b.var -// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] -// CHECK:STDOUT: %.loc13_8.2: type = converted %int.make_type_32.loc13, %.loc13_8.1 [template = i32] -// CHECK:STDOUT: %c.var: ref i32 = var c -// CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var +// CHECK:STDOUT: %.loc13_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%.loc13_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8.2: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_8.3: type = converted %int.make_type_signed.loc13, %.loc13_8.2 [template = constants.%i32] +// CHECK:STDOUT: %c.var: ref %i32 = var c +// CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_18: Core.IntLiteral = int_value 12 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_18: Core.IntLiteral = int_value 12 [template = constants.%.2] // CHECK:STDOUT: %.loc11_21.1: %tuple.type.3 = tuple_literal (%.loc11_18) -// CHECK:STDOUT: %.loc11_21.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_21.3: = bound_method %.loc11_18, %.loc11_21.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc11_21.3(%.loc11_18) [template = constants.%.27] -// CHECK:STDOUT: %.loc11_21.4: init i32 = converted %.loc11_18, %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc11_21.5: init %tuple.type.2 = tuple_init (%.loc11_21.4) to file.%a.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc11_22: init %tuple.type.2 = converted %.loc11_21.1, %.loc11_21.5 [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_21.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_21.3: = bound_method %.loc11_18, %.loc11_21.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc11_21.4: = specific_function %.loc11_21.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc11_21.4(%.loc11_18) [template = constants.%.25] +// CHECK:STDOUT: %.loc11_21.5: init %i32 = converted %.loc11_18, %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc11_21.6: init %tuple.type.2 = tuple_init (%.loc11_21.5) to file.%a.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_22: init %tuple.type.2 = converted %.loc11_21.1, %.loc11_21.6 [template = constants.%tuple] // CHECK:STDOUT: assign file.%a.var, %.loc11_22 // CHECK:STDOUT: %a.ref: ref %tuple.type.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc12_17.1: ref i32 = tuple_access %a.ref, element0 -// CHECK:STDOUT: %.loc12_17.2: i32 = bind_value %.loc12_17.1 +// CHECK:STDOUT: %.loc12_17.1: ref %i32 = tuple_access %a.ref, element0 +// CHECK:STDOUT: %.loc12_17.2: %i32 = bind_value %.loc12_17.1 // CHECK:STDOUT: %.loc12_17.3: init %tuple.type.2 = tuple_init (%.loc12_17.2) to file.%b.var // CHECK:STDOUT: %.loc12_18: init %tuple.type.2 = converted %a.ref, %.loc12_17.3 // CHECK:STDOUT: assign file.%b.var, %.loc12_18 // CHECK:STDOUT: %b.ref: ref %tuple.type.2 = name_ref b, file.%b -// CHECK:STDOUT: %.loc13_16: Core.IntLiteral = int_value 0 [template = constants.%.28] -// CHECK:STDOUT: %.loc13_15.1: ref i32 = tuple_access %b.ref, element0 -// CHECK:STDOUT: %.loc13_15.2: i32 = bind_value %.loc13_15.1 +// CHECK:STDOUT: %.loc13_16: Core.IntLiteral = int_value 0 [template = constants.%.26] +// CHECK:STDOUT: %.loc13_15.1: ref %i32 = tuple_access %b.ref, element0 +// CHECK:STDOUT: %.loc13_15.2: %i32 = bind_value %.loc13_15.1 // CHECK:STDOUT: assign file.%c.var, %.loc13_15.2 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/fail_access_error.carbon b/toolchain/check/testdata/tuple/access/fail_access_error.carbon index 5fb1dcde490c..c42387ffc233 100644 --- a/toolchain/check/testdata/tuple/access/fail_access_error.carbon +++ b/toolchain/check/testdata/tuple/access/fail_access_error.carbon @@ -17,27 +17,31 @@ var b: i32 = a.(oops); // CHECK:STDOUT: --- fail_access_error.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 12 [template] -// CHECK:STDOUT: %.30: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 6 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.29, %.31) [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 12 [template] +// CHECK:STDOUT: %.28: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 6 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.27, %.30) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -51,42 +55,47 @@ var b: i32 = a.(oops); // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] -// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_32.loc11_9, %.loc11_17.2 [template = i32] -// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] -// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_32.loc11_14, %.loc11_17.4 [template = i32] +// CHECK:STDOUT: %.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%.loc11_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14) +// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_9, %.loc11_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_signed.loc11_14, %.loc11_17.4 [template = constants.%i32] // CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed.loc15, %.loc15_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 12 [template = constants.%.2] -// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 6 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 12 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 6 [template = constants.%.4] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.3 = tuple_literal (%.loc11_22, %.loc11_26) -// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_22, %.loc11_27.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init i32 = call %.loc11_27.3(%.loc11_22) [template = constants.%.29] -// CHECK:STDOUT: %.loc11_27.4: init i32 = converted %.loc11_22, %int.convert_checked.loc11_27.1 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_27.5: ref i32 = tuple_access file.%a.var, element0 -// CHECK:STDOUT: %.loc11_27.6: init i32 = initialize_from %.loc11_27.4 to %.loc11_27.5 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_27.7: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.8: = bound_method %.loc11_26, %.loc11_27.7 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init i32 = call %.loc11_27.8(%.loc11_26) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_27.9: init i32 = converted %.loc11_26, %int.convert_checked.loc11_27.2 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_27.10: ref i32 = tuple_access file.%a.var, element1 -// CHECK:STDOUT: %.loc11_27.11: init i32 = initialize_from %.loc11_27.9 to %.loc11_27.10 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_27.12: init %tuple.type.2 = tuple_init (%.loc11_27.6, %.loc11_27.11) to file.%a.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc11_28: init %tuple.type.2 = converted %.loc11_27.1, %.loc11_27.12 [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_22, %.loc11_27.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc11_27.4: = specific_function %.loc11_27.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %.loc11_27.4(%.loc11_22) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_27.5: init %i32 = converted %.loc11_22, %int.convert_checked.loc11_27.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_27.6: ref %i32 = tuple_access file.%a.var, element0 +// CHECK:STDOUT: %.loc11_27.7: init %i32 = initialize_from %.loc11_27.5 to %.loc11_27.6 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_27.8: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.9: = bound_method %.loc11_26, %.loc11_27.8 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_27.10: = specific_function %.loc11_27.9, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %.loc11_27.10(%.loc11_26) [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.11: init %i32 = converted %.loc11_26, %int.convert_checked.loc11_27.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.12: ref %i32 = tuple_access file.%a.var, element1 +// CHECK:STDOUT: %.loc11_27.13: init %i32 = initialize_from %.loc11_27.11 to %.loc11_27.12 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.14: init %tuple.type.2 = tuple_init (%.loc11_27.7, %.loc11_27.13) to file.%a.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_28: init %tuple.type.2 = converted %.loc11_27.1, %.loc11_27.14 [template = constants.%tuple] // CHECK:STDOUT: assign file.%a.var, %.loc11_28 // CHECK:STDOUT: %a.ref: ref %tuple.type.2 = name_ref a, file.%a // CHECK:STDOUT: %oops.ref: = name_ref oops, [template = ] diff --git a/toolchain/check/testdata/tuple/access/fail_large_index.carbon b/toolchain/check/testdata/tuple/access/fail_large_index.carbon index d894d77eabe6..98c986a00a10 100644 --- a/toolchain/check/testdata/tuple/access/fail_large_index.carbon +++ b/toolchain/check/testdata/tuple/access/fail_large_index.carbon @@ -23,26 +23,29 @@ var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDOUT: --- fail_large_index.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 12 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.27) [template] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 2147483647 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 12 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.25) [template] +// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 2147483647 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -58,54 +61,59 @@ var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_13.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11) -// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_13.3: type = converted %int.make_type_32.loc11, %.loc11_13.2 [template = i32] +// CHECK:STDOUT: %.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11) +// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.3: type = converted %int.make_type_signed.loc11, %.loc11_13.2 [template = constants.%i32] // CHECK:STDOUT: %.loc11_13.4: type = converted %.loc11_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_13.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc12) -// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_32.loc12, %.loc12_13.2 [template = i32] +// CHECK:STDOUT: %.loc12_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc12) +// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_signed.loc12, %.loc12_13.2 [template = constants.%i32] // CHECK:STDOUT: %.loc12_13.4: type = converted %.loc12_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %b.var: ref %tuple.type.2 = var b // CHECK:STDOUT: %b: ref %tuple.type.2 = bind_name b, %b.var -// CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_8.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] -// CHECK:STDOUT: %.loc17_8.2: type = converted %int.make_type_32.loc17, %.loc17_8.1 [template = i32] -// CHECK:STDOUT: %c.var: ref i32 = var c -// CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var -// CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc21_8.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] -// CHECK:STDOUT: %.loc21_8.2: type = converted %int.make_type_32.loc21, %.loc21_8.1 [template = i32] -// CHECK:STDOUT: %d.var: ref i32 = var d -// CHECK:STDOUT: %d: ref i32 = bind_name d, %d.var +// CHECK:STDOUT: %.loc17_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%.loc17_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_8.2: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_8.3: type = converted %int.make_type_signed.loc17, %.loc17_8.2 [template = constants.%i32] +// CHECK:STDOUT: %c.var: ref %i32 = var c +// CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var +// CHECK:STDOUT: %.loc21_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%.loc21_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_8.2: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_8.3: type = converted %int.make_type_signed.loc21, %.loc21_8.2 [template = constants.%i32] +// CHECK:STDOUT: %d.var: ref %i32 = var d +// CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_18: Core.IntLiteral = int_value 12 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_18: Core.IntLiteral = int_value 12 [template = constants.%.2] // CHECK:STDOUT: %.loc11_21.1: %tuple.type.3 = tuple_literal (%.loc11_18) -// CHECK:STDOUT: %.loc11_21.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_21.3: = bound_method %.loc11_18, %.loc11_21.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc11_21.3(%.loc11_18) [template = constants.%.27] -// CHECK:STDOUT: %.loc11_21.4: init i32 = converted %.loc11_18, %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc11_21.5: init %tuple.type.2 = tuple_init (%.loc11_21.4) to file.%a.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc11_22: init %tuple.type.2 = converted %.loc11_21.1, %.loc11_21.5 [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_21.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_21.3: = bound_method %.loc11_18, %.loc11_21.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc11_21.4: = specific_function %.loc11_21.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc11_21.4(%.loc11_18) [template = constants.%.25] +// CHECK:STDOUT: %.loc11_21.5: init %i32 = converted %.loc11_18, %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc11_21.6: init %tuple.type.2 = tuple_init (%.loc11_21.5) to file.%a.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_22: init %tuple.type.2 = converted %.loc11_21.1, %.loc11_21.6 [template = constants.%tuple] // CHECK:STDOUT: assign file.%a.var, %.loc11_22 // CHECK:STDOUT: %a.ref: ref %tuple.type.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc12_17.1: ref i32 = tuple_access %a.ref, element0 -// CHECK:STDOUT: %.loc12_17.2: i32 = bind_value %.loc12_17.1 +// CHECK:STDOUT: %.loc12_17.1: ref %i32 = tuple_access %a.ref, element0 +// CHECK:STDOUT: %.loc12_17.2: %i32 = bind_value %.loc12_17.1 // CHECK:STDOUT: %.loc12_17.3: init %tuple.type.2 = tuple_init (%.loc12_17.2) to file.%b.var // CHECK:STDOUT: %.loc12_18: init %tuple.type.2 = converted %a.ref, %.loc12_17.3 // CHECK:STDOUT: assign file.%b.var, %.loc12_18 // CHECK:STDOUT: %b.ref.loc17: ref %tuple.type.2 = name_ref b, file.%b -// CHECK:STDOUT: %.loc17: Core.IntLiteral = int_value 1 [template = constants.%.28] +// CHECK:STDOUT: %.loc17: Core.IntLiteral = int_value 1 [template = constants.%.26] // CHECK:STDOUT: assign file.%c.var, // CHECK:STDOUT: %b.ref.loc21: ref %tuple.type.2 = name_ref b, file.%b -// CHECK:STDOUT: %.loc21: Core.IntLiteral = int_value 2147483647 [template = constants.%.29] +// CHECK:STDOUT: %.loc21: Core.IntLiteral = int_value 2147483647 [template = constants.%.27] // CHECK:STDOUT: assign file.%d.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon index 66631993fa9e..9bcde9b52c72 100644 --- a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon @@ -17,30 +17,34 @@ var b: i32 = a.(-10); // CHECK:STDOUT: --- fail_negative_indexing.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 12 [template] -// CHECK:STDOUT: %.30: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 6 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.29, %.31) [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 10 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 12 [template] +// CHECK:STDOUT: %.28: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 6 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.27, %.30) [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Negate = %import_ref.51 +// CHECK:STDOUT: .Negate = %import_ref.38 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -53,45 +57,50 @@ var b: i32 = a.(-10); // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] -// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_32.loc11_9, %.loc11_17.2 [template = i32] -// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] -// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_32.loc11_14, %.loc11_17.4 [template = i32] +// CHECK:STDOUT: %.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%.loc11_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14) +// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_9, %.loc11_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_signed.loc11_14, %.loc11_17.4 [template = constants.%i32] // CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed.loc15, %.loc15_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 12 [template = constants.%.2] -// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 6 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 12 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 6 [template = constants.%.4] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.3 = tuple_literal (%.loc11_22, %.loc11_26) -// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_22, %.loc11_27.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init i32 = call %.loc11_27.3(%.loc11_22) [template = constants.%.29] -// CHECK:STDOUT: %.loc11_27.4: init i32 = converted %.loc11_22, %int.convert_checked.loc11_27.1 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_27.5: ref i32 = tuple_access file.%a.var, element0 -// CHECK:STDOUT: %.loc11_27.6: init i32 = initialize_from %.loc11_27.4 to %.loc11_27.5 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_27.7: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.8: = bound_method %.loc11_26, %.loc11_27.7 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init i32 = call %.loc11_27.8(%.loc11_26) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_27.9: init i32 = converted %.loc11_26, %int.convert_checked.loc11_27.2 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_27.10: ref i32 = tuple_access file.%a.var, element1 -// CHECK:STDOUT: %.loc11_27.11: init i32 = initialize_from %.loc11_27.9 to %.loc11_27.10 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_27.12: init %tuple.type.2 = tuple_init (%.loc11_27.6, %.loc11_27.11) to file.%a.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc11_28: init %tuple.type.2 = converted %.loc11_27.1, %.loc11_27.12 [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_22, %.loc11_27.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc11_27.4: = specific_function %.loc11_27.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %.loc11_27.4(%.loc11_22) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_27.5: init %i32 = converted %.loc11_22, %int.convert_checked.loc11_27.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_27.6: ref %i32 = tuple_access file.%a.var, element0 +// CHECK:STDOUT: %.loc11_27.7: init %i32 = initialize_from %.loc11_27.5 to %.loc11_27.6 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_27.8: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.9: = bound_method %.loc11_26, %.loc11_27.8 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_27.10: = specific_function %.loc11_27.9, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %.loc11_27.10(%.loc11_26) [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.11: init %i32 = converted %.loc11_26, %int.convert_checked.loc11_27.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.12: ref %i32 = tuple_access file.%a.var, element1 +// CHECK:STDOUT: %.loc11_27.13: init %i32 = initialize_from %.loc11_27.11 to %.loc11_27.12 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.14: init %tuple.type.2 = tuple_init (%.loc11_27.7, %.loc11_27.13) to file.%a.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_28: init %tuple.type.2 = converted %.loc11_27.1, %.loc11_27.14 [template = constants.%tuple] // CHECK:STDOUT: assign file.%a.var, %.loc11_28 // CHECK:STDOUT: %a.ref: ref %tuple.type.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc15: Core.IntLiteral = int_value 10 [template = constants.%.32] +// CHECK:STDOUT: %.loc15: Core.IntLiteral = int_value 10 [template = constants.%.31] // CHECK:STDOUT: assign file.%b.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon index 1b35b6a1c932..035c2f0bb922 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon @@ -18,30 +18,35 @@ var c: i32 = a.(b); // CHECK:STDOUT: --- fail_non_deterministic_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 2 [template] -// CHECK:STDOUT: %.30: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 3 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.29, %.31) [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %.33: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.34: i32 = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.28: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 3 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.27, %.30) [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.32: = bound_method %.31, %Convert.14 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -56,56 +61,63 @@ var c: i32 = a.(b); // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] -// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_32.loc11_9, %.loc11_17.2 [template = i32] -// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] -// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_32.loc11_14, %.loc11_17.4 [template = i32] +// CHECK:STDOUT: %.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%.loc11_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14) +// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_9, %.loc11_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_signed.loc11_14, %.loc11_17.4 [template = constants.%i32] // CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_8.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] -// CHECK:STDOUT: %.loc16_8.2: type = converted %int.make_type_32.loc16, %.loc16_8.1 [template = i32] -// CHECK:STDOUT: %c.var: ref i32 = var c -// CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var +// CHECK:STDOUT: %.loc12_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.3: type = converted %int.make_type_signed.loc12, %.loc12_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc16_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%.loc16_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_8.2: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_8.3: type = converted %int.make_type_signed.loc16, %.loc16_8.2 [template = constants.%i32] +// CHECK:STDOUT: %c.var: ref %i32 = var c +// CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc11_25: Core.IntLiteral = int_value 3 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_25: Core.IntLiteral = int_value 3 [template = constants.%.4] // CHECK:STDOUT: %.loc11_26.1: %tuple.type.3 = tuple_literal (%.loc11_22, %.loc11_25) -// CHECK:STDOUT: %.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_26.3: = bound_method %.loc11_22, %.loc11_26.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc11_26.1: init i32 = call %.loc11_26.3(%.loc11_22) [template = constants.%.29] -// CHECK:STDOUT: %.loc11_26.4: init i32 = converted %.loc11_22, %int.convert_checked.loc11_26.1 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_26.5: ref i32 = tuple_access file.%a.var, element0 -// CHECK:STDOUT: %.loc11_26.6: init i32 = initialize_from %.loc11_26.4 to %.loc11_26.5 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_26.7: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_26.8: = bound_method %.loc11_25, %.loc11_26.7 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_26.2: init i32 = call %.loc11_26.8(%.loc11_25) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_26.9: init i32 = converted %.loc11_25, %int.convert_checked.loc11_26.2 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_26.10: ref i32 = tuple_access file.%a.var, element1 -// CHECK:STDOUT: %.loc11_26.11: init i32 = initialize_from %.loc11_26.9 to %.loc11_26.10 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_26.12: init %tuple.type.2 = tuple_init (%.loc11_26.6, %.loc11_26.11) to file.%a.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc11_27: init %tuple.type.2 = converted %.loc11_26.1, %.loc11_26.12 [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_26.3: = bound_method %.loc11_22, %.loc11_26.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc11_26.4: = specific_function %.loc11_26.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %.loc11_26.4(%.loc11_22) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_26.5: init %i32 = converted %.loc11_22, %int.convert_checked.loc11_26.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_26.6: ref %i32 = tuple_access file.%a.var, element0 +// CHECK:STDOUT: %.loc11_26.7: init %i32 = initialize_from %.loc11_26.5 to %.loc11_26.6 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_26.8: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_26.9: = bound_method %.loc11_25, %.loc11_26.8 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_26.10: = specific_function %.loc11_26.9, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %.loc11_26.10(%.loc11_25) [template = constants.%.30] +// CHECK:STDOUT: %.loc11_26.11: init %i32 = converted %.loc11_25, %int.convert_checked.loc11_26.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_26.12: ref %i32 = tuple_access file.%a.var, element1 +// CHECK:STDOUT: %.loc11_26.13: init %i32 = initialize_from %.loc11_26.11 to %.loc11_26.12 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_26.14: init %tuple.type.2 = tuple_init (%.loc11_26.7, %.loc11_26.13) to file.%a.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_27: init %tuple.type.2 = converted %.loc11_26.1, %.loc11_26.14 [template = constants.%tuple] // CHECK:STDOUT: assign file.%a.var, %.loc11_27 -// CHECK:STDOUT: %.loc12_14: Core.IntLiteral = int_value 0 [template = constants.%.32] -// CHECK:STDOUT: %.loc12_15.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc12_15.2: = bound_method %.loc12_14, %.loc12_15.1 [template = constants.%.33] -// CHECK:STDOUT: %int.convert_checked.loc12: init i32 = call %.loc12_15.2(%.loc12_14) [template = constants.%.34] -// CHECK:STDOUT: %.loc12_15.3: init i32 = converted %.loc12_14, %int.convert_checked.loc12 [template = constants.%.34] -// CHECK:STDOUT: assign file.%b.var, %.loc12_15.3 +// CHECK:STDOUT: %.loc12_14: Core.IntLiteral = int_value 0 [template = constants.%.31] +// CHECK:STDOUT: %.loc12_15.1: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc12_15.2: = bound_method %.loc12_14, %.loc12_15.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc12_15.3: = specific_function %.loc12_15.2, @Convert.2(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %.loc12_15.3(%.loc12_14) [template = constants.%.34] +// CHECK:STDOUT: %.loc12_15.4: init %i32 = converted %.loc12_14, %int.convert_checked.loc12 [template = constants.%.34] +// CHECK:STDOUT: assign file.%b.var, %.loc12_15.4 // CHECK:STDOUT: %a.ref: ref %tuple.type.2 = name_ref a, file.%a -// CHECK:STDOUT: %b.ref: ref i32 = name_ref b, file.%b +// CHECK:STDOUT: %b.ref: ref %i32 = name_ref b, file.%b // CHECK:STDOUT: assign file.%c.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon index d278dc140439..46447c05f5cd 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon @@ -20,28 +20,32 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: --- fail_non_int_indexing.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 12 [template] -// CHECK:STDOUT: %.30: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 6 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.29, %.31) [template] -// CHECK:STDOUT: %.32: f64 = float_literal 2.6000000000000001 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 12 [template] +// CHECK:STDOUT: %.28: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 6 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.27, %.30) [template] +// CHECK:STDOUT: %.31: f64 = float_literal 2.6000000000000001 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -55,45 +59,50 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] -// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_32.loc11_9, %.loc11_17.2 [template = i32] -// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] -// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_32.loc11_14, %.loc11_17.4 [template = i32] +// CHECK:STDOUT: %.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%.loc11_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14) +// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_9, %.loc11_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_signed.loc11_14, %.loc11_17.4 [template = constants.%i32] // CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_8.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] -// CHECK:STDOUT: %.loc18_8.2: type = converted %int.make_type_32.loc18, %.loc18_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc18_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%.loc18_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_8.2: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_8.3: type = converted %int.make_type_signed.loc18, %.loc18_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 12 [template = constants.%.2] -// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 6 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 12 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 6 [template = constants.%.4] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.3 = tuple_literal (%.loc11_22, %.loc11_26) -// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_22, %.loc11_27.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init i32 = call %.loc11_27.3(%.loc11_22) [template = constants.%.29] -// CHECK:STDOUT: %.loc11_27.4: init i32 = converted %.loc11_22, %int.convert_checked.loc11_27.1 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_27.5: ref i32 = tuple_access file.%a.var, element0 -// CHECK:STDOUT: %.loc11_27.6: init i32 = initialize_from %.loc11_27.4 to %.loc11_27.5 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_27.7: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.8: = bound_method %.loc11_26, %.loc11_27.7 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init i32 = call %.loc11_27.8(%.loc11_26) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_27.9: init i32 = converted %.loc11_26, %int.convert_checked.loc11_27.2 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_27.10: ref i32 = tuple_access file.%a.var, element1 -// CHECK:STDOUT: %.loc11_27.11: init i32 = initialize_from %.loc11_27.9 to %.loc11_27.10 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_27.12: init %tuple.type.2 = tuple_init (%.loc11_27.6, %.loc11_27.11) to file.%a.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc11_28: init %tuple.type.2 = converted %.loc11_27.1, %.loc11_27.12 [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_22, %.loc11_27.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc11_27.4: = specific_function %.loc11_27.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %.loc11_27.4(%.loc11_22) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_27.5: init %i32 = converted %.loc11_22, %int.convert_checked.loc11_27.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_27.6: ref %i32 = tuple_access file.%a.var, element0 +// CHECK:STDOUT: %.loc11_27.7: init %i32 = initialize_from %.loc11_27.5 to %.loc11_27.6 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_27.8: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.9: = bound_method %.loc11_26, %.loc11_27.8 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_27.10: = specific_function %.loc11_27.9, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %.loc11_27.10(%.loc11_26) [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.11: init %i32 = converted %.loc11_26, %int.convert_checked.loc11_27.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.12: ref %i32 = tuple_access file.%a.var, element1 +// CHECK:STDOUT: %.loc11_27.13: init %i32 = initialize_from %.loc11_27.11 to %.loc11_27.12 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.14: init %tuple.type.2 = tuple_init (%.loc11_27.7, %.loc11_27.13) to file.%a.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_28: init %tuple.type.2 = converted %.loc11_27.1, %.loc11_27.14 [template = constants.%tuple] // CHECK:STDOUT: assign file.%a.var, %.loc11_28 // CHECK:STDOUT: %a.ref: ref %tuple.type.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc18_17.1: f64 = float_literal 2.6000000000000001 [template = constants.%.32] +// CHECK:STDOUT: %.loc18_17.1: f64 = float_literal 2.6000000000000001 [template = constants.%.31] // CHECK:STDOUT: %.loc18_17.2: Core.IntLiteral = converted %.loc18_17.1, [template = ] // CHECK:STDOUT: assign file.%b.var, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon index 27d1e860f16e..dd4e5f3a7abd 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon @@ -29,27 +29,28 @@ fn Main() { // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.6: type = array_type %.5, i32 [template] -// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.5 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.7: type = array_type %.6, %i32 [template] +// CHECK:STDOUT: %.9: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.9: i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.33: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.34: = bound_method %.8, %Convert.15 [template] -// CHECK:STDOUT: %.35: i32 = int_value 5 [template] -// CHECK:STDOUT: %.36: i32 = int_value 1 [template] -// CHECK:STDOUT: %array: %.6 = tuple_value (%.35, %.35) [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.5) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.29: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.30: = bound_method %.9, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.5) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 5 [template] +// CHECK:STDOUT: %array: %.7 = tuple_value (%.32, %.32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .IndexWith = %import_ref.1 -// CHECK:STDOUT: .Int32 = %import_ref.6 +// CHECK:STDOUT: .Int = %import_ref.6 // CHECK:STDOUT: .ImplicitAs = %import_ref.7 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -69,39 +70,43 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc16_3: Core.IntLiteral = int_value 0 [template = constants.%.1] // CHECK:STDOUT: %.loc16_5: Core.IntLiteral = int_value 1 [template = constants.%.2] -// CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_24: Core.IntLiteral = int_value 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc18_19.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] -// CHECK:STDOUT: %.loc18_19.2: type = converted %int.make_type_32.loc18, %.loc18_19.1 [template = i32] -// CHECK:STDOUT: %.loc18_25: type = array_type %.loc18_24, i32 [template = constants.%.6] -// CHECK:STDOUT: %non_tuple.var: ref %.6 = var non_tuple -// CHECK:STDOUT: %non_tuple: ref %.6 = bind_name non_tuple, %non_tuple.var -// CHECK:STDOUT: %.loc18_30: Core.IntLiteral = int_value 5 [template = constants.%.8] -// CHECK:STDOUT: %.loc18_33: Core.IntLiteral = int_value 5 [template = constants.%.8] +// CHECK:STDOUT: %.loc18_19.1: Core.IntLiteral = int_value 32 [template = constants.%.5] +// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%.loc18_19.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_24: Core.IntLiteral = int_value 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc18_19.2: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_19.3: type = converted %int.make_type_signed.loc18, %.loc18_19.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_25: type = array_type %.loc18_24, %i32 [template = constants.%.7] +// CHECK:STDOUT: %non_tuple.var: ref %.7 = var non_tuple +// CHECK:STDOUT: %non_tuple: ref %.7 = bind_name non_tuple, %non_tuple.var +// CHECK:STDOUT: %.loc18_30: Core.IntLiteral = int_value 5 [template = constants.%.9] +// CHECK:STDOUT: %.loc18_33: Core.IntLiteral = int_value 5 [template = constants.%.9] // CHECK:STDOUT: %.loc18_34.1: %tuple.type = tuple_literal (%.loc18_30, %.loc18_33) -// CHECK:STDOUT: %.loc18_34.2: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_34.3: = bound_method %.loc18_30, %.loc18_34.2 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc18_34.1: init i32 = call %.loc18_34.3(%.loc18_30) [template = constants.%.35] -// CHECK:STDOUT: %.loc18_34.4: init i32 = converted %.loc18_30, %int.convert_checked.loc18_34.1 [template = constants.%.35] -// CHECK:STDOUT: %.loc18_34.5: i32 = int_value 0 [template = constants.%.9] -// CHECK:STDOUT: %.loc18_34.6: ref i32 = array_index %non_tuple.var, %.loc18_34.5 -// CHECK:STDOUT: %.loc18_34.7: init i32 = initialize_from %.loc18_34.4 to %.loc18_34.6 [template = constants.%.35] -// CHECK:STDOUT: %.loc18_34.8: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_34.9: = bound_method %.loc18_33, %.loc18_34.8 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc18_34.2: init i32 = call %.loc18_34.9(%.loc18_33) [template = constants.%.35] -// CHECK:STDOUT: %.loc18_34.10: init i32 = converted %.loc18_33, %int.convert_checked.loc18_34.2 [template = constants.%.35] -// CHECK:STDOUT: %.loc18_34.11: i32 = int_value 1 [template = constants.%.36] -// CHECK:STDOUT: %.loc18_34.12: ref i32 = array_index %non_tuple.var, %.loc18_34.11 -// CHECK:STDOUT: %.loc18_34.13: init i32 = initialize_from %.loc18_34.10 to %.loc18_34.12 [template = constants.%.35] -// CHECK:STDOUT: %.loc18_34.14: init %.6 = array_init (%.loc18_34.7, %.loc18_34.13) to %non_tuple.var [template = constants.%array] -// CHECK:STDOUT: %.loc18_35: init %.6 = converted %.loc18_34.1, %.loc18_34.14 [template = constants.%array] +// CHECK:STDOUT: %.loc18_34.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_34.3: = bound_method %.loc18_30, %.loc18_34.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc18_34.4: = specific_function %.loc18_34.3, @Convert.2(constants.%.5) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc18_34.1: init %i32 = call %.loc18_34.4(%.loc18_30) [template = constants.%.32] +// CHECK:STDOUT: %.loc18_34.5: init %i32 = converted %.loc18_30, %int.convert_checked.loc18_34.1 [template = constants.%.32] +// CHECK:STDOUT: %.loc18_34.6: Core.IntLiteral = int_value 0 [template = constants.%.1] +// CHECK:STDOUT: %.loc18_34.7: ref %i32 = array_index %non_tuple.var, %.loc18_34.6 +// CHECK:STDOUT: %.loc18_34.8: init %i32 = initialize_from %.loc18_34.5 to %.loc18_34.7 [template = constants.%.32] +// CHECK:STDOUT: %.loc18_34.9: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_34.10: = bound_method %.loc18_33, %.loc18_34.9 [template = constants.%.30] +// CHECK:STDOUT: %.loc18_34.11: = specific_function %.loc18_34.10, @Convert.2(constants.%.5) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc18_34.2: init %i32 = call %.loc18_34.11(%.loc18_33) [template = constants.%.32] +// CHECK:STDOUT: %.loc18_34.12: init %i32 = converted %.loc18_33, %int.convert_checked.loc18_34.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc18_34.13: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc18_34.14: ref %i32 = array_index %non_tuple.var, %.loc18_34.13 +// CHECK:STDOUT: %.loc18_34.15: init %i32 = initialize_from %.loc18_34.12 to %.loc18_34.14 [template = constants.%.32] +// CHECK:STDOUT: %.loc18_34.16: init %.7 = array_init (%.loc18_34.8, %.loc18_34.15) to %non_tuple.var [template = constants.%array] +// CHECK:STDOUT: %.loc18_35: init %.7 = converted %.loc18_34.1, %.loc18_34.16 [template = constants.%array] // CHECK:STDOUT: assign %non_tuple.var, %.loc18_35 -// CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc22_14.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] -// CHECK:STDOUT: %.loc22_14.2: type = converted %int.make_type_32.loc22, %.loc22_14.1 [template = i32] -// CHECK:STDOUT: %first.var: ref i32 = var first -// CHECK:STDOUT: %first: ref i32 = bind_name first, %first.var -// CHECK:STDOUT: %non_tuple.ref: ref %.6 = name_ref non_tuple, %non_tuple +// CHECK:STDOUT: %.loc22_14.1: Core.IntLiteral = int_value 32 [template = constants.%.5] +// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%.loc22_14.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc22_14.2: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] +// CHECK:STDOUT: %.loc22_14.3: type = converted %int.make_type_signed.loc22, %.loc22_14.2 [template = constants.%i32] +// CHECK:STDOUT: %first.var: ref %i32 = var first +// CHECK:STDOUT: %first: ref %i32 = bind_name first, %first.var +// CHECK:STDOUT: %non_tuple.ref: ref %.7 = name_ref non_tuple, %non_tuple // CHECK:STDOUT: %.loc22_30: Core.IntLiteral = int_value 0 [template = constants.%.1] // CHECK:STDOUT: assign %first.var, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon index dd740d1b5de3..8d74cb14c3a2 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon @@ -17,28 +17,32 @@ var b: i32 = a.2; // CHECK:STDOUT: --- fail_out_of_bound_access.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 12 [template] -// CHECK:STDOUT: %.30: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 6 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.29, %.31) [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 12 [template] +// CHECK:STDOUT: %.28: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 6 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.27, %.30) [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -52,45 +56,50 @@ var b: i32 = a.2; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] -// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_32.loc11_9, %.loc11_17.2 [template = i32] -// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] -// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_32.loc11_14, %.loc11_17.4 [template = i32] +// CHECK:STDOUT: %.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%.loc11_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14) +// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_9, %.loc11_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_signed.loc11_14, %.loc11_17.4 [template = constants.%i32] // CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed.loc15, %.loc15_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 12 [template = constants.%.2] -// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 6 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 12 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 6 [template = constants.%.4] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.3 = tuple_literal (%.loc11_22, %.loc11_26) -// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_22, %.loc11_27.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init i32 = call %.loc11_27.3(%.loc11_22) [template = constants.%.29] -// CHECK:STDOUT: %.loc11_27.4: init i32 = converted %.loc11_22, %int.convert_checked.loc11_27.1 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_27.5: ref i32 = tuple_access file.%a.var, element0 -// CHECK:STDOUT: %.loc11_27.6: init i32 = initialize_from %.loc11_27.4 to %.loc11_27.5 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_27.7: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_27.8: = bound_method %.loc11_26, %.loc11_27.7 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init i32 = call %.loc11_27.8(%.loc11_26) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_27.9: init i32 = converted %.loc11_26, %int.convert_checked.loc11_27.2 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_27.10: ref i32 = tuple_access file.%a.var, element1 -// CHECK:STDOUT: %.loc11_27.11: init i32 = initialize_from %.loc11_27.9 to %.loc11_27.10 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_27.12: init %tuple.type.2 = tuple_init (%.loc11_27.6, %.loc11_27.11) to file.%a.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc11_28: init %tuple.type.2 = converted %.loc11_27.1, %.loc11_27.12 [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.3: = bound_method %.loc11_22, %.loc11_27.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc11_27.4: = specific_function %.loc11_27.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %.loc11_27.4(%.loc11_22) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_27.5: init %i32 = converted %.loc11_22, %int.convert_checked.loc11_27.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_27.6: ref %i32 = tuple_access file.%a.var, element0 +// CHECK:STDOUT: %.loc11_27.7: init %i32 = initialize_from %.loc11_27.5 to %.loc11_27.6 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_27.8: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_27.9: = bound_method %.loc11_26, %.loc11_27.8 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_27.10: = specific_function %.loc11_27.9, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %.loc11_27.10(%.loc11_26) [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.11: init %i32 = converted %.loc11_26, %int.convert_checked.loc11_27.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.12: ref %i32 = tuple_access file.%a.var, element1 +// CHECK:STDOUT: %.loc11_27.13: init %i32 = initialize_from %.loc11_27.11 to %.loc11_27.12 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_27.14: init %tuple.type.2 = tuple_init (%.loc11_27.7, %.loc11_27.13) to file.%a.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_28: init %tuple.type.2 = converted %.loc11_27.1, %.loc11_27.14 [template = constants.%tuple] // CHECK:STDOUT: assign file.%a.var, %.loc11_28 // CHECK:STDOUT: %a.ref: ref %tuple.type.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc15: Core.IntLiteral = int_value 2 [template = constants.%.32] +// CHECK:STDOUT: %.loc15: Core.IntLiteral = int_value 2 [template = constants.%.31] // CHECK:STDOUT: assign file.%b.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon index 7563519d7216..fd907632cdac 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon @@ -17,30 +17,34 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: --- fail_out_of_bound_not_literal.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 34 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 34 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 12 [template] -// CHECK:STDOUT: %.30: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 34 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.29, %.31) [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.33: type = struct_type {.index: Core.IntLiteral} [template] -// CHECK:STDOUT: %struct: %.33 = struct_value (%.32) [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 12 [template] +// CHECK:STDOUT: %.28: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 34 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.27, %.30) [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.32: type = struct_type {.index: Core.IntLiteral} [template] +// CHECK:STDOUT: %struct: %.32 = struct_value (%.31) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -54,49 +58,54 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] -// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_32.loc11_9, %.loc11_17.2 [template = i32] -// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] -// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_32.loc11_14, %.loc11_17.4 [template = i32] +// CHECK:STDOUT: %.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%.loc11_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14) +// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_9, %.loc11_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_signed.loc11_14, %.loc11_17.4 [template = constants.%i32] // CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc15_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%.loc15_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.2: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_8.3: type = converted %int.make_type_signed.loc15, %.loc15_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 12 [template = constants.%.2] -// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 34 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 12 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 34 [template = constants.%.4] // CHECK:STDOUT: %.loc11_28.1: %tuple.type.3 = tuple_literal (%.loc11_22, %.loc11_26) -// CHECK:STDOUT: %.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_28.3: = bound_method %.loc11_22, %.loc11_28.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init i32 = call %.loc11_28.3(%.loc11_22) [template = constants.%.29] -// CHECK:STDOUT: %.loc11_28.4: init i32 = converted %.loc11_22, %int.convert_checked.loc11_28.1 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_28.5: ref i32 = tuple_access file.%a.var, element0 -// CHECK:STDOUT: %.loc11_28.6: init i32 = initialize_from %.loc11_28.4 to %.loc11_28.5 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_28.7: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_28.8: = bound_method %.loc11_26, %.loc11_28.7 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init i32 = call %.loc11_28.8(%.loc11_26) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_28.9: init i32 = converted %.loc11_26, %int.convert_checked.loc11_28.2 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_28.10: ref i32 = tuple_access file.%a.var, element1 -// CHECK:STDOUT: %.loc11_28.11: init i32 = initialize_from %.loc11_28.9 to %.loc11_28.10 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_28.12: init %tuple.type.2 = tuple_init (%.loc11_28.6, %.loc11_28.11) to file.%a.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc11_29: init %tuple.type.2 = converted %.loc11_28.1, %.loc11_28.12 [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_28.3: = bound_method %.loc11_22, %.loc11_28.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc11_28.4: = specific_function %.loc11_28.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %.loc11_28.4(%.loc11_22) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_28.5: init %i32 = converted %.loc11_22, %int.convert_checked.loc11_28.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_28.6: ref %i32 = tuple_access file.%a.var, element0 +// CHECK:STDOUT: %.loc11_28.7: init %i32 = initialize_from %.loc11_28.5 to %.loc11_28.6 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_28.8: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_28.9: = bound_method %.loc11_26, %.loc11_28.8 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_28.10: = specific_function %.loc11_28.9, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %.loc11_28.10(%.loc11_26) [template = constants.%.30] +// CHECK:STDOUT: %.loc11_28.11: init %i32 = converted %.loc11_26, %int.convert_checked.loc11_28.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_28.12: ref %i32 = tuple_access file.%a.var, element1 +// CHECK:STDOUT: %.loc11_28.13: init %i32 = initialize_from %.loc11_28.11 to %.loc11_28.12 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_28.14: init %tuple.type.2 = tuple_init (%.loc11_28.7, %.loc11_28.13) to file.%a.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_29: init %tuple.type.2 = converted %.loc11_28.1, %.loc11_28.14 [template = constants.%tuple] // CHECK:STDOUT: assign file.%a.var, %.loc11_29 // CHECK:STDOUT: %a.ref: ref %tuple.type.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc15_27: Core.IntLiteral = int_value 2 [template = constants.%.32] -// CHECK:STDOUT: %.loc15_28.1: %.33 = struct_literal (%.loc15_27) -// CHECK:STDOUT: %struct: %.33 = struct_value (%.loc15_27) [template = constants.%struct] -// CHECK:STDOUT: %.loc15_28.2: %.33 = converted %.loc15_28.1, %struct [template = constants.%struct] -// CHECK:STDOUT: %.loc15_29: Core.IntLiteral = struct_access %.loc15_28.2, element0 [template = constants.%.32] +// CHECK:STDOUT: %.loc15_27: Core.IntLiteral = int_value 2 [template = constants.%.31] +// CHECK:STDOUT: %.loc15_28.1: %.32 = struct_literal (%.loc15_27) +// CHECK:STDOUT: %struct: %.32 = struct_value (%.loc15_27) [template = constants.%struct] +// CHECK:STDOUT: %.loc15_28.2: %.32 = converted %.loc15_28.1, %struct [template = constants.%struct] +// CHECK:STDOUT: %.loc15_29: Core.IntLiteral = struct_access %.loc15_28.2, element0 [template = constants.%.31] // CHECK:STDOUT: assign file.%b.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/index_not_literal.carbon b/toolchain/check/testdata/tuple/access/index_not_literal.carbon index 42c9653db5d5..ef7c9d196c50 100644 --- a/toolchain/check/testdata/tuple/access/index_not_literal.carbon +++ b/toolchain/check/testdata/tuple/access/index_not_literal.carbon @@ -14,30 +14,34 @@ var b: i32 = a.({.index = 1}.index); // CHECK:STDOUT: --- index_not_literal.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 34 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 34 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 12 [template] -// CHECK:STDOUT: %.30: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 34 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.29, %.31) [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.33: type = struct_type {.index: Core.IntLiteral} [template] -// CHECK:STDOUT: %struct: %.33 = struct_value (%.32) [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 12 [template] +// CHECK:STDOUT: %.28: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 34 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.27, %.30) [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.32: type = struct_type {.index: Core.IntLiteral} [template] +// CHECK:STDOUT: %struct: %.32 = struct_value (%.31) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -51,51 +55,56 @@ var b: i32 = a.({.index = 1}.index); // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] -// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_32.loc11_9, %.loc11_17.2 [template = i32] -// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] -// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_32.loc11_14, %.loc11_17.4 [template = i32] +// CHECK:STDOUT: %.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%.loc11_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14) +// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_9, %.loc11_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_signed.loc11_14, %.loc11_17.4 [template = constants.%i32] // CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %.loc12_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_8.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_8.3: type = converted %int.make_type_signed.loc12, %.loc12_8.2 [template = constants.%i32] +// CHECK:STDOUT: %b.var: ref %i32 = var b +// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 12 [template = constants.%.2] -// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 34 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 12 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_26: Core.IntLiteral = int_value 34 [template = constants.%.4] // CHECK:STDOUT: %.loc11_28.1: %tuple.type.3 = tuple_literal (%.loc11_22, %.loc11_26) -// CHECK:STDOUT: %.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_28.3: = bound_method %.loc11_22, %.loc11_28.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init i32 = call %.loc11_28.3(%.loc11_22) [template = constants.%.29] -// CHECK:STDOUT: %.loc11_28.4: init i32 = converted %.loc11_22, %int.convert_checked.loc11_28.1 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_28.5: ref i32 = tuple_access file.%a.var, element0 -// CHECK:STDOUT: %.loc11_28.6: init i32 = initialize_from %.loc11_28.4 to %.loc11_28.5 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_28.7: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_28.8: = bound_method %.loc11_26, %.loc11_28.7 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init i32 = call %.loc11_28.8(%.loc11_26) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_28.9: init i32 = converted %.loc11_26, %int.convert_checked.loc11_28.2 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_28.10: ref i32 = tuple_access file.%a.var, element1 -// CHECK:STDOUT: %.loc11_28.11: init i32 = initialize_from %.loc11_28.9 to %.loc11_28.10 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_28.12: init %tuple.type.2 = tuple_init (%.loc11_28.6, %.loc11_28.11) to file.%a.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc11_29: init %tuple.type.2 = converted %.loc11_28.1, %.loc11_28.12 [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_28.3: = bound_method %.loc11_22, %.loc11_28.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc11_28.4: = specific_function %.loc11_28.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %.loc11_28.4(%.loc11_22) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_28.5: init %i32 = converted %.loc11_22, %int.convert_checked.loc11_28.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_28.6: ref %i32 = tuple_access file.%a.var, element0 +// CHECK:STDOUT: %.loc11_28.7: init %i32 = initialize_from %.loc11_28.5 to %.loc11_28.6 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_28.8: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_28.9: = bound_method %.loc11_26, %.loc11_28.8 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_28.10: = specific_function %.loc11_28.9, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %.loc11_28.10(%.loc11_26) [template = constants.%.30] +// CHECK:STDOUT: %.loc11_28.11: init %i32 = converted %.loc11_26, %int.convert_checked.loc11_28.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_28.12: ref %i32 = tuple_access file.%a.var, element1 +// CHECK:STDOUT: %.loc11_28.13: init %i32 = initialize_from %.loc11_28.11 to %.loc11_28.12 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_28.14: init %tuple.type.2 = tuple_init (%.loc11_28.7, %.loc11_28.13) to file.%a.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_29: init %tuple.type.2 = converted %.loc11_28.1, %.loc11_28.14 [template = constants.%tuple] // CHECK:STDOUT: assign file.%a.var, %.loc11_29 // CHECK:STDOUT: %a.ref: ref %tuple.type.2 = name_ref a, file.%a -// CHECK:STDOUT: %.loc12_27: Core.IntLiteral = int_value 1 [template = constants.%.32] -// CHECK:STDOUT: %.loc12_28.1: %.33 = struct_literal (%.loc12_27) -// CHECK:STDOUT: %struct: %.33 = struct_value (%.loc12_27) [template = constants.%struct] -// CHECK:STDOUT: %.loc12_28.2: %.33 = converted %.loc12_28.1, %struct [template = constants.%struct] -// CHECK:STDOUT: %.loc12_29: Core.IntLiteral = struct_access %.loc12_28.2, element0 [template = constants.%.32] -// CHECK:STDOUT: %.loc12_15.1: ref i32 = tuple_access %a.ref, element1 -// CHECK:STDOUT: %.loc12_15.2: i32 = bind_value %.loc12_15.1 +// CHECK:STDOUT: %.loc12_27: Core.IntLiteral = int_value 1 [template = constants.%.31] +// CHECK:STDOUT: %.loc12_28.1: %.32 = struct_literal (%.loc12_27) +// CHECK:STDOUT: %struct: %.32 = struct_value (%.loc12_27) [template = constants.%struct] +// CHECK:STDOUT: %.loc12_28.2: %.32 = converted %.loc12_28.1, %struct [template = constants.%struct] +// CHECK:STDOUT: %.loc12_29: Core.IntLiteral = struct_access %.loc12_28.2, element0 [template = constants.%.31] +// CHECK:STDOUT: %.loc12_15.1: ref %i32 = tuple_access %a.ref, element1 +// CHECK:STDOUT: %.loc12_15.2: %i32 = bind_value %.loc12_15.1 // CHECK:STDOUT: assign file.%b.var, %.loc12_15.2 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/return_value_access.carbon b/toolchain/check/testdata/tuple/access/return_value_access.carbon index 19e010353468..30d7d80577f9 100644 --- a/toolchain/check/testdata/tuple/access/return_value_access.carbon +++ b/toolchain/check/testdata/tuple/access/return_value_access.carbon @@ -17,28 +17,31 @@ fn Run() -> i32 { // CHECK:STDOUT: --- return_value_access.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32) [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.27) [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.25) [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -56,49 +59,52 @@ fn Run() -> i32 { // CHECK:STDOUT: %return.patt: %tuple.type.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_16.1: %tuple.type.1 = tuple_literal (%int.make_type_32) -// CHECK:STDOUT: %.loc11_16.2: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc11_16.3: type = converted %int.make_type_32, %.loc11_16.2 [template = i32] +// CHECK:STDOUT: %.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc11_12) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_16.1: %tuple.type.1 = tuple_literal (%int.make_type_signed) +// CHECK:STDOUT: %.loc11_16.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc11_16.3: type = converted %int.make_type_signed, %.loc11_16.2 [template = constants.%i32] // CHECK:STDOUT: %.loc11_16.4: type = converted %.loc11_16.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { -// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32, %.loc13_13.1 [template = i32] -// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref i32 = return_slot %return.param +// CHECK:STDOUT: %.loc13_13.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc13_13.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_13.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc13_13.3: type = converted %int.make_type_signed, %.loc13_13.2 [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %tuple.type.2 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_28: Core.IntLiteral = int_value 0 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_28: Core.IntLiteral = int_value 0 [template = constants.%.2] // CHECK:STDOUT: %.loc11_30.1: %tuple.type.3 = tuple_literal (%.loc11_28) -// CHECK:STDOUT: %.loc11_30.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_30.3: = bound_method %.loc11_28, %.loc11_30.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc11_30.3(%.loc11_28) [template = constants.%.27] -// CHECK:STDOUT: %.loc11_30.4: i32 = value_of_initializer %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc11_30.5: i32 = converted %.loc11_28, %.loc11_30.4 [template = constants.%.27] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.loc11_30.5) [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_30.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_30.3: = bound_method %.loc11_28, %.loc11_30.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc11_30.4: = specific_function %.loc11_30.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc11_30.4(%.loc11_28) [template = constants.%.25] +// CHECK:STDOUT: %.loc11_30.5: %i32 = value_of_initializer %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc11_30.6: %i32 = converted %.loc11_28, %.loc11_30.5 [template = constants.%.25] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.loc11_30.6) [template = constants.%tuple] // CHECK:STDOUT: %.loc11_31: %tuple.type.2 = converted %.loc11_30.1, %tuple [template = constants.%tuple] // CHECK:STDOUT: return %.loc11_31 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Run() -> i32 { +// CHECK:STDOUT: fn @Run() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %F.call: init %tuple.type.2 = call %F.ref() -// CHECK:STDOUT: %.loc14_14: Core.IntLiteral = int_value 0 [template = constants.%.1] +// CHECK:STDOUT: %.loc14_14: Core.IntLiteral = int_value 0 [template = constants.%.2] // CHECK:STDOUT: %.loc14_11.1: ref %tuple.type.2 = temporary_storage // CHECK:STDOUT: %.loc14_11.2: ref %tuple.type.2 = temporary %.loc14_11.1, %F.call -// CHECK:STDOUT: %.loc14_13.1: ref i32 = tuple_access %.loc14_11.2, element0 -// CHECK:STDOUT: %.loc14_13.2: i32 = bind_value %.loc14_13.1 +// CHECK:STDOUT: %.loc14_13.1: ref %i32 = tuple_access %.loc14_11.2, element0 +// CHECK:STDOUT: %.loc14_13.2: %i32 = bind_value %.loc14_13.1 // CHECK:STDOUT: return %.loc14_13.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/tuple/fail_assign_nested.carbon b/toolchain/check/testdata/tuple/fail_assign_nested.carbon index f81aaebd3206..5a4f0247616f 100644 --- a/toolchain/check/testdata/tuple/fail_assign_nested.carbon +++ b/toolchain/check/testdata/tuple/fail_assign_nested.carbon @@ -16,25 +16,27 @@ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDOUT: --- fail_assign_nested.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%tuple.type.1, %tuple.type.1) [template] -// CHECK:STDOUT: %tuple.type.3: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %tuple.type.3: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %tuple.type.4: type = tuple_type (%tuple.type.3, %tuple.type.3) [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %tuple.type.6: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.8: Core.IntLiteral = int_value 5 [template] +// CHECK:STDOUT: %.9: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.7: type = tuple_type (%tuple.type.6, %tuple.type.6) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -46,22 +48,26 @@ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc14_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_18: %tuple.type.1 = tuple_literal (%int.make_type_32.loc14_10, %int.make_type_32.loc14_15) -// CHECK:STDOUT: %int.make_type_32.loc14_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_30: %tuple.type.1 = tuple_literal (%int.make_type_32.loc14_22, %int.make_type_32.loc14_27) +// CHECK:STDOUT: %.loc14_10: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_10: init type = call constants.%Int(%.loc14_10) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_15: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_15: init type = call constants.%Int(%.loc14_15) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_18: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_10, %int.make_type_signed.loc14_15) +// CHECK:STDOUT: %.loc14_22: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_22: init type = call constants.%Int(%.loc14_22) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_27: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_27: init type = call constants.%Int(%.loc14_27) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_30: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_22, %int.make_type_signed.loc14_27) // CHECK:STDOUT: %.loc14_31.1: %tuple.type.2 = tuple_literal (%.loc14_18, %.loc14_30) -// CHECK:STDOUT: %.loc14_31.2: type = value_of_initializer %int.make_type_32.loc14_10 [template = i32] -// CHECK:STDOUT: %.loc14_31.3: type = converted %int.make_type_32.loc14_10, %.loc14_31.2 [template = i32] -// CHECK:STDOUT: %.loc14_31.4: type = value_of_initializer %int.make_type_32.loc14_15 [template = i32] -// CHECK:STDOUT: %.loc14_31.5: type = converted %int.make_type_32.loc14_15, %.loc14_31.4 [template = i32] +// CHECK:STDOUT: %.loc14_31.2: type = value_of_initializer %int.make_type_signed.loc14_10 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_31.3: type = converted %int.make_type_signed.loc14_10, %.loc14_31.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_31.4: type = value_of_initializer %int.make_type_signed.loc14_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_31.5: type = converted %int.make_type_signed.loc14_15, %.loc14_31.4 [template = constants.%i32] // CHECK:STDOUT: %.loc14_31.6: type = converted %.loc14_18, constants.%tuple.type.3 [template = constants.%tuple.type.3] -// CHECK:STDOUT: %.loc14_31.7: type = value_of_initializer %int.make_type_32.loc14_22 [template = i32] -// CHECK:STDOUT: %.loc14_31.8: type = converted %int.make_type_32.loc14_22, %.loc14_31.7 [template = i32] -// CHECK:STDOUT: %.loc14_31.9: type = value_of_initializer %int.make_type_32.loc14_27 [template = i32] -// CHECK:STDOUT: %.loc14_31.10: type = converted %int.make_type_32.loc14_27, %.loc14_31.9 [template = i32] +// CHECK:STDOUT: %.loc14_31.7: type = value_of_initializer %int.make_type_signed.loc14_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_31.8: type = converted %int.make_type_signed.loc14_22, %.loc14_31.7 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_31.9: type = value_of_initializer %int.make_type_signed.loc14_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_31.10: type = converted %int.make_type_signed.loc14_27, %.loc14_31.9 [template = constants.%i32] // CHECK:STDOUT: %.loc14_31.11: type = converted %.loc14_30, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %.loc14_31.12: type = converted %.loc14_31.1, constants.%tuple.type.4 [template = constants.%tuple.type.4] // CHECK:STDOUT: %x.var: ref %tuple.type.4 = var x @@ -70,13 +76,13 @@ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc14_37: Core.IntLiteral = int_value 1 [template = constants.%.3] -// CHECK:STDOUT: %.loc14_40: Core.IntLiteral = int_value 2 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_43: Core.IntLiteral = int_value 3 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_37: Core.IntLiteral = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc14_40: Core.IntLiteral = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_43: Core.IntLiteral = int_value 3 [template = constants.%.6] // CHECK:STDOUT: %.loc14_44: %tuple.type.6 = tuple_literal (%.loc14_37, %.loc14_40, %.loc14_43) -// CHECK:STDOUT: %.loc14_48: Core.IntLiteral = int_value 4 [template = constants.%.6] -// CHECK:STDOUT: %.loc14_51: Core.IntLiteral = int_value 5 [template = constants.%.7] -// CHECK:STDOUT: %.loc14_54: Core.IntLiteral = int_value 6 [template = constants.%.8] +// CHECK:STDOUT: %.loc14_48: Core.IntLiteral = int_value 4 [template = constants.%.7] +// CHECK:STDOUT: %.loc14_51: Core.IntLiteral = int_value 5 [template = constants.%.8] +// CHECK:STDOUT: %.loc14_54: Core.IntLiteral = int_value 6 [template = constants.%.9] // CHECK:STDOUT: %.loc14_55: %tuple.type.6 = tuple_literal (%.loc14_48, %.loc14_51, %.loc14_54) // CHECK:STDOUT: %.loc14_56: %tuple.type.7 = tuple_literal (%.loc14_44, %.loc14_55) // CHECK:STDOUT: assign file.%x.var, diff --git a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon index 2edf3d1b16bb..e8ebf885a20e 100644 --- a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon @@ -19,24 +19,27 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: --- fail_element_type_mismatch.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.3: f64 = float_literal 65.890000000000001 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.4: f64 = float_literal 65.890000000000001 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, f64) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -49,13 +52,15 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc17_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc17_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_17.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc17_9, %int.make_type_32.loc17_14) -// CHECK:STDOUT: %.loc17_17.2: type = value_of_initializer %int.make_type_32.loc17_9 [template = i32] -// CHECK:STDOUT: %.loc17_17.3: type = converted %int.make_type_32.loc17_9, %.loc17_17.2 [template = i32] -// CHECK:STDOUT: %.loc17_17.4: type = value_of_initializer %int.make_type_32.loc17_14 [template = i32] -// CHECK:STDOUT: %.loc17_17.5: type = converted %int.make_type_32.loc17_14, %.loc17_17.4 [template = i32] +// CHECK:STDOUT: %.loc17_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc17_9: init type = call constants.%Int(%.loc17_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc17_14: init type = call constants.%Int(%.loc17_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc17_9, %int.make_type_signed.loc17_14) +// CHECK:STDOUT: %.loc17_17.2: type = value_of_initializer %int.make_type_signed.loc17_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_17.3: type = converted %int.make_type_signed.loc17_9, %.loc17_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_17.4: type = value_of_initializer %int.make_type_signed.loc17_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc17_17.5: type = converted %int.make_type_signed.loc17_14, %.loc17_17.4 [template = constants.%i32] // CHECK:STDOUT: %.loc17_17.6: type = converted %.loc17_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var @@ -63,16 +68,17 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc17_22: Core.IntLiteral = int_value 2 [template = constants.%.2] -// CHECK:STDOUT: %.loc17_25: f64 = float_literal 65.890000000000001 [template = constants.%.3] +// CHECK:STDOUT: %.loc17_22: Core.IntLiteral = int_value 2 [template = constants.%.3] +// CHECK:STDOUT: %.loc17_25: f64 = float_literal 65.890000000000001 [template = constants.%.4] // CHECK:STDOUT: %.loc17_30.1: %tuple.type.3 = tuple_literal (%.loc17_22, %.loc17_25) -// CHECK:STDOUT: %.loc17_30.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc17_30.3: = bound_method %.loc17_22, %.loc17_30.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc17_30.3(%.loc17_22) [template = constants.%.29] -// CHECK:STDOUT: %.loc17_30.4: init i32 = converted %.loc17_22, %int.convert_checked [template = constants.%.29] -// CHECK:STDOUT: %.loc17_30.5: ref i32 = tuple_access file.%x.var, element0 -// CHECK:STDOUT: %.loc17_30.6: init i32 = initialize_from %.loc17_30.4 to %.loc17_30.5 [template = constants.%.29] -// CHECK:STDOUT: %.loc17_30.7: i32 = converted %.loc17_25, [template = ] +// CHECK:STDOUT: %.loc17_30.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc17_30.3: = bound_method %.loc17_22, %.loc17_30.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc17_30.4: = specific_function %.loc17_30.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc17_30.4(%.loc17_22) [template = constants.%.27] +// CHECK:STDOUT: %.loc17_30.5: init %i32 = converted %.loc17_22, %int.convert_checked [template = constants.%.27] +// CHECK:STDOUT: %.loc17_30.6: ref %i32 = tuple_access file.%x.var, element0 +// CHECK:STDOUT: %.loc17_30.7: init %i32 = initialize_from %.loc17_30.5 to %.loc17_30.6 [template = constants.%.27] +// CHECK:STDOUT: %.loc17_30.8: %i32 = converted %.loc17_25, [template = ] // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon b/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon index fe8eafce3dd0..6192e5a881af 100644 --- a/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon @@ -24,17 +24,19 @@ var p: Incomplete* = &t[1]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, %Incomplete) [template] -// CHECK:STDOUT: %.1: type = ptr_type %Incomplete [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %Incomplete) [template] +// CHECK:STDOUT: %.2: type = ptr_type %Incomplete [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -49,18 +51,19 @@ var p: Incomplete* = &t[1]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {} -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc19_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc19_9) [template = constants.%i32] // CHECK:STDOUT: %Incomplete.ref.loc19: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] -// CHECK:STDOUT: %.loc19_24.1: %tuple.type.1 = tuple_literal (%int.make_type_32, %Incomplete.ref.loc19) -// CHECK:STDOUT: %.loc19_24.2: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc19_24.3: type = converted %int.make_type_32, %.loc19_24.2 [template = i32] +// CHECK:STDOUT: %.loc19_24.1: %tuple.type.1 = tuple_literal (%int.make_type_signed, %Incomplete.ref.loc19) +// CHECK:STDOUT: %.loc19_24.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc19_24.3: type = converted %int.make_type_signed, %.loc19_24.2 [template = constants.%i32] // CHECK:STDOUT: %.loc19_24.4: type = converted %.loc19_24.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %t.var: ref = var t // CHECK:STDOUT: %t: ref = bind_name t, %t.var // CHECK:STDOUT: %Incomplete.ref.loc21: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] -// CHECK:STDOUT: %.loc21: type = ptr_type %Incomplete [template = constants.%.1] -// CHECK:STDOUT: %p.var: ref %.1 = var p -// CHECK:STDOUT: %p: ref %.1 = bind_name p, %p.var +// CHECK:STDOUT: %.loc21: type = ptr_type %Incomplete [template = constants.%.2] +// CHECK:STDOUT: %p.var: ref %.2 = var p +// CHECK:STDOUT: %p: ref %.2 = bind_name p, %p.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Incomplete; @@ -68,7 +71,7 @@ var p: Incomplete* = &t[1]; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %t.ref: ref = name_ref t, file.%t -// CHECK:STDOUT: %.loc21_25: Core.IntLiteral = int_value 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc21_25: Core.IntLiteral = int_value 1 [template = constants.%.3] // CHECK:STDOUT: %.loc21_22: = addr_of [template = ] // CHECK:STDOUT: assign file.%p.var, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/tuple/fail_too_few_element.carbon b/toolchain/check/testdata/tuple/fail_too_few_element.carbon index 457bf892f169..af0f74dfc209 100644 --- a/toolchain/check/testdata/tuple/fail_too_few_element.carbon +++ b/toolchain/check/testdata/tuple/fail_too_few_element.carbon @@ -16,17 +16,19 @@ var x: (i32, i32) = (2, ); // CHECK:STDOUT: --- fail_too_few_element.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -38,13 +40,15 @@ var x: (i32, i32) = (2, ); // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc14_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_17.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc14_9, %int.make_type_32.loc14_14) -// CHECK:STDOUT: %.loc14_17.2: type = value_of_initializer %int.make_type_32.loc14_9 [template = i32] -// CHECK:STDOUT: %.loc14_17.3: type = converted %int.make_type_32.loc14_9, %.loc14_17.2 [template = i32] -// CHECK:STDOUT: %.loc14_17.4: type = value_of_initializer %int.make_type_32.loc14_14 [template = i32] -// CHECK:STDOUT: %.loc14_17.5: type = converted %int.make_type_32.loc14_14, %.loc14_17.4 [template = i32] +// CHECK:STDOUT: %.loc14_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_9: init type = call constants.%Int(%.loc14_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_14: init type = call constants.%Int(%.loc14_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_9, %int.make_type_signed.loc14_14) +// CHECK:STDOUT: %.loc14_17.2: type = value_of_initializer %int.make_type_signed.loc14_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_17.3: type = converted %int.make_type_signed.loc14_9, %.loc14_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_17.4: type = value_of_initializer %int.make_type_signed.loc14_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_17.5: type = converted %int.make_type_signed.loc14_14, %.loc14_17.4 [template = constants.%i32] // CHECK:STDOUT: %.loc14_17.6: type = converted %.loc14_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var @@ -52,7 +56,7 @@ var x: (i32, i32) = (2, ); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc14_22: Core.IntLiteral = int_value 2 [template = constants.%.2] +// CHECK:STDOUT: %.loc14_22: Core.IntLiteral = int_value 2 [template = constants.%.3] // CHECK:STDOUT: %.loc14_25: %tuple.type.3 = tuple_literal (%.loc14_22) // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/tuple/fail_type_assign.carbon b/toolchain/check/testdata/tuple/fail_type_assign.carbon index c688c1606d9d..d74a8de54a8d 100644 --- a/toolchain/check/testdata/tuple/fail_type_assign.carbon +++ b/toolchain/check/testdata/tuple/fail_type_assign.carbon @@ -19,15 +19,17 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: --- fail_type_assign.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32) [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -40,10 +42,11 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_14.1: %tuple.type.1 = tuple_literal (%int.make_type_32) -// CHECK:STDOUT: %.loc17_14.2: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc17_14.3: type = converted %int.make_type_32, %.loc17_14.2 [template = i32] +// CHECK:STDOUT: %.loc17_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc17_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_14.1: %tuple.type.1 = tuple_literal (%int.make_type_signed) +// CHECK:STDOUT: %.loc17_14.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc17_14.3: type = converted %int.make_type_signed, %.loc17_14.2 [template = constants.%i32] // CHECK:STDOUT: %.loc17_14.4: type = converted %.loc17_14.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var @@ -51,9 +54,10 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc17_24.1: %tuple.type.1 = tuple_literal (%int.make_type_32) -// CHECK:STDOUT: %.loc17_24.2: i32 = converted %int.make_type_32, [template = ] +// CHECK:STDOUT: %.loc17_19: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc17_19) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_24.1: %tuple.type.1 = tuple_literal (%int.make_type_signed) +// CHECK:STDOUT: %.loc17_24.2: %i32 = converted %int.make_type_signed, [template = ] // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index 1be2025e4b34..3583f44d95d2 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -45,10 +45,10 @@ var c_bad: C((1, 2, 3)) = F(); impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C((3, 4)) = F(); @@ -56,48 +56,54 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: --- implicit.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 0 [template] -// CHECK:STDOUT: %tuple.1: %tuple.type.2 = tuple_value (%.27) [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 0 [template] +// CHECK:STDOUT: %tuple.1: %tuple.type.2 = tuple_value (%.25) [template] // CHECK:STDOUT: %tuple.type.4: type = tuple_type (%tuple.type.1, type) [template] // CHECK:STDOUT: %tuple.type.5: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.6: type = tuple_type (%tuple.type.4, %tuple.type.5) [template] -// CHECK:STDOUT: %tuple.type.7: type = tuple_type (%tuple.type.2, i32) [template] -// CHECK:STDOUT: %tuple.type.8: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %tuple.type.7: type = tuple_type (%tuple.type.2, %i32) [template] +// CHECK:STDOUT: %tuple.type.8: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %tuple.type.9: type = tuple_type (%tuple.type.7, %tuple.type.8) [template] -// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %tuple.type.11: type = tuple_type (%tuple.type.3, Core.IntLiteral) [template] -// CHECK:STDOUT: %.32: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.33: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %tuple.type.12: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %tuple.type.13: type = tuple_type (%tuple.type.11, %tuple.type.12) [template] -// CHECK:STDOUT: %.34: = bound_method %.31, %Convert.15 [template] -// CHECK:STDOUT: %.35: i32 = int_value 1 [template] -// CHECK:STDOUT: %tuple.2: %tuple.type.7 = tuple_value (%tuple.1, %.35) [template] -// CHECK:STDOUT: %.36: = bound_method %.32, %Convert.15 [template] -// CHECK:STDOUT: %.37: i32 = int_value 2 [template] -// CHECK:STDOUT: %.38: = bound_method %.33, %Convert.15 [template] -// CHECK:STDOUT: %.39: i32 = int_value 3 [template] -// CHECK:STDOUT: %tuple.3: %tuple.type.8 = tuple_value (%.37, %.39) [template] +// CHECK:STDOUT: %.32: = bound_method %.29, %Convert.14 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 1 [template] +// CHECK:STDOUT: %tuple.2: %tuple.type.7 = tuple_value (%tuple.1, %.34) [template] +// CHECK:STDOUT: %.35: = bound_method %.30, %Convert.14 [template] +// CHECK:STDOUT: %.36: = specific_function %.35, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.37: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.38: = bound_method %.31, %Convert.14 [template] +// CHECK:STDOUT: %.39: = specific_function %.38, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.40: %i32 = int_value 3 [template] +// CHECK:STDOUT: %tuple.3: %tuple.type.8 = tuple_value (%.37, %.40) [template] // CHECK:STDOUT: %tuple.4: %tuple.type.9 = tuple_value (%tuple.2, %tuple.3) [template] // CHECK:STDOUT: %X: %tuple.type.8 = bind_symbolic_name X, 0 [symbolic] // CHECK:STDOUT: %X.patt: %tuple.type.8 = symbolic_binding_pattern X, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%X) [symbolic] -// CHECK:STDOUT: %.40: type = struct_type {} [template] -// CHECK:STDOUT: %.41: = complete_type_witness %.40 [template] -// CHECK:STDOUT: %tuple.5: %tuple.type.8 = tuple_value (%.35, %.37) [template] +// CHECK:STDOUT: %.41: type = struct_type {} [template] +// CHECK:STDOUT: %.42: = complete_type_witness %.41 [template] +// CHECK:STDOUT: %tuple.5: %tuple.type.8 = tuple_value (%.34, %.37) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%tuple.5) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -105,7 +111,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -121,31 +127,36 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_17.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc4) -// CHECK:STDOUT: %.loc4_17.2: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_17.3: type = converted %int.make_type_32.loc4, %.loc4_17.2 [template = i32] +// CHECK:STDOUT: %.loc4_13: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_13) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc4) +// CHECK:STDOUT: %.loc4_17.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_17.3: type = converted %int.make_type_signed.loc4, %.loc4_17.2 [template = constants.%i32] // CHECK:STDOUT: %.loc4_17.4: type = converted %.loc4_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a_ref.var: ref %tuple.type.2 = var a_ref // CHECK:STDOUT: %a_ref: ref %tuple.type.2 = bind_name a_ref, %a_ref.var -// CHECK:STDOUT: %int.make_type_32.loc5_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_19: %tuple.type.1 = tuple_literal (%int.make_type_32.loc5_15) -// CHECK:STDOUT: %int.make_type_32.loc5_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_25: %tuple.type.4 = tuple_literal (%.loc5_19, %int.make_type_32.loc5_22) -// CHECK:STDOUT: %int.make_type_32.loc5_29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_37: %tuple.type.5 = tuple_literal (%int.make_type_32.loc5_29, %int.make_type_32.loc5_34) +// CHECK:STDOUT: %.loc5_15: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_15: init type = call constants.%Int(%.loc5_15) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc5_15) +// CHECK:STDOUT: %.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_22: init type = call constants.%Int(%.loc5_22) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_25: %tuple.type.4 = tuple_literal (%.loc5_19, %int.make_type_signed.loc5_22) +// CHECK:STDOUT: %.loc5_29: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_29: init type = call constants.%Int(%.loc5_29) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_34: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc5_34: init type = call constants.%Int(%.loc5_34) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_37: %tuple.type.5 = tuple_literal (%int.make_type_signed.loc5_29, %int.make_type_signed.loc5_34) // CHECK:STDOUT: %.loc5_38.1: %tuple.type.6 = tuple_literal (%.loc5_25, %.loc5_37) -// CHECK:STDOUT: %.loc5_38.2: type = value_of_initializer %int.make_type_32.loc5_15 [template = i32] -// CHECK:STDOUT: %.loc5_38.3: type = converted %int.make_type_32.loc5_15, %.loc5_38.2 [template = i32] +// CHECK:STDOUT: %.loc5_38.2: type = value_of_initializer %int.make_type_signed.loc5_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_38.3: type = converted %int.make_type_signed.loc5_15, %.loc5_38.2 [template = constants.%i32] // CHECK:STDOUT: %.loc5_38.4: type = converted %.loc5_19, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc5_38.5: type = value_of_initializer %int.make_type_32.loc5_22 [template = i32] -// CHECK:STDOUT: %.loc5_38.6: type = converted %int.make_type_32.loc5_22, %.loc5_38.5 [template = i32] +// CHECK:STDOUT: %.loc5_38.5: type = value_of_initializer %int.make_type_signed.loc5_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_38.6: type = converted %int.make_type_signed.loc5_22, %.loc5_38.5 [template = constants.%i32] // CHECK:STDOUT: %.loc5_38.7: type = converted %.loc5_25, constants.%tuple.type.7 [template = constants.%tuple.type.7] -// CHECK:STDOUT: %.loc5_38.8: type = value_of_initializer %int.make_type_32.loc5_29 [template = i32] -// CHECK:STDOUT: %.loc5_38.9: type = converted %int.make_type_32.loc5_29, %.loc5_38.8 [template = i32] -// CHECK:STDOUT: %.loc5_38.10: type = value_of_initializer %int.make_type_32.loc5_34 [template = i32] -// CHECK:STDOUT: %.loc5_38.11: type = converted %int.make_type_32.loc5_34, %.loc5_38.10 [template = i32] +// CHECK:STDOUT: %.loc5_38.8: type = value_of_initializer %int.make_type_signed.loc5_29 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_38.9: type = converted %int.make_type_signed.loc5_29, %.loc5_38.8 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_38.10: type = value_of_initializer %int.make_type_signed.loc5_34 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_38.11: type = converted %int.make_type_signed.loc5_34, %.loc5_38.10 [template = constants.%i32] // CHECK:STDOUT: %.loc5_38.12: type = converted %.loc5_37, constants.%tuple.type.8 [template = constants.%tuple.type.8] // CHECK:STDOUT: %.loc5_38.13: type = converted %.loc5_38.1, constants.%tuple.type.9 [template = constants.%tuple.type.9] // CHECK:STDOUT: %b_ref.var: ref %tuple.type.9 = var b_ref @@ -154,13 +165,15 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %X.patt.loc7_9.1: %tuple.type.8 = symbolic_binding_pattern X, 0 [symbolic = %X.patt.loc7_9.2 (constants.%X.patt)] // CHECK:STDOUT: %X.param_patt: %tuple.type.8 = value_param_pattern %X.patt.loc7_9.1, runtime_param [symbolic = %X.patt.loc7_9.2 (constants.%X.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc7_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc7_22.1: %tuple.type.5 = tuple_literal (%int.make_type_32.loc7_14, %int.make_type_32.loc7_19) -// CHECK:STDOUT: %.loc7_22.2: type = value_of_initializer %int.make_type_32.loc7_14 [template = i32] -// CHECK:STDOUT: %.loc7_22.3: type = converted %int.make_type_32.loc7_14, %.loc7_22.2 [template = i32] -// CHECK:STDOUT: %.loc7_22.4: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] -// CHECK:STDOUT: %.loc7_22.5: type = converted %int.make_type_32.loc7_19, %.loc7_22.4 [template = i32] +// CHECK:STDOUT: %.loc7_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_14: init type = call constants.%Int(%.loc7_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_22.1: %tuple.type.5 = tuple_literal (%int.make_type_signed.loc7_14, %int.make_type_signed.loc7_19) +// CHECK:STDOUT: %.loc7_22.2: type = value_of_initializer %int.make_type_signed.loc7_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_22.3: type = converted %int.make_type_signed.loc7_14, %.loc7_22.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_22.4: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] +// CHECK:STDOUT: %.loc7_22.5: type = converted %int.make_type_signed.loc7_19, %.loc7_22.4 [template = constants.%i32] // CHECK:STDOUT: %.loc7_22.6: type = converted %.loc7_22.1, constants.%tuple.type.8 [template = constants.%tuple.type.8] // CHECK:STDOUT: %X.param: %tuple.type.8 = value_param runtime_param // CHECK:STDOUT: %X.loc7_9.1: %tuple.type.8 = bind_symbolic_name X, 0, %X.param [symbolic = %X.loc7_9.2 (constants.%X)] @@ -170,20 +183,22 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %return.param_patt: %C.3 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc9_14: Core.IntLiteral = int_value 1 [template = constants.%.31] -// CHECK:STDOUT: %.loc9_17: Core.IntLiteral = int_value 2 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_14: Core.IntLiteral = int_value 1 [template = constants.%.29] +// CHECK:STDOUT: %.loc9_17: Core.IntLiteral = int_value 2 [template = constants.%.30] // CHECK:STDOUT: %.loc9_18.1: %tuple.type.12 = tuple_literal (%.loc9_14, %.loc9_17) -// CHECK:STDOUT: %.loc9_18.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_18.3: = bound_method %.loc9_14, %.loc9_18.2 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc9_18.1: init i32 = call %.loc9_18.3(%.loc9_14) [template = constants.%.35] -// CHECK:STDOUT: %.loc9_18.4: i32 = value_of_initializer %int.convert_checked.loc9_18.1 [template = constants.%.35] -// CHECK:STDOUT: %.loc9_18.5: i32 = converted %.loc9_14, %.loc9_18.4 [template = constants.%.35] -// CHECK:STDOUT: %.loc9_18.6: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc9_18.7: = bound_method %.loc9_17, %.loc9_18.6 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc9_18.2: init i32 = call %.loc9_18.7(%.loc9_17) [template = constants.%.37] -// CHECK:STDOUT: %.loc9_18.8: i32 = value_of_initializer %int.convert_checked.loc9_18.2 [template = constants.%.37] -// CHECK:STDOUT: %.loc9_18.9: i32 = converted %.loc9_17, %.loc9_18.8 [template = constants.%.37] -// CHECK:STDOUT: %tuple: %tuple.type.8 = tuple_value (%.loc9_18.5, %.loc9_18.9) [template = constants.%tuple.5] +// CHECK:STDOUT: %.loc9_18.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_18.3: = bound_method %.loc9_14, %.loc9_18.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc9_18.4: = specific_function %.loc9_18.3, @Convert.2(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc9_18.1: init %i32 = call %.loc9_18.4(%.loc9_14) [template = constants.%.34] +// CHECK:STDOUT: %.loc9_18.5: %i32 = value_of_initializer %int.convert_checked.loc9_18.1 [template = constants.%.34] +// CHECK:STDOUT: %.loc9_18.6: %i32 = converted %.loc9_14, %.loc9_18.5 [template = constants.%.34] +// CHECK:STDOUT: %.loc9_18.7: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc9_18.8: = bound_method %.loc9_17, %.loc9_18.7 [template = constants.%.35] +// CHECK:STDOUT: %.loc9_18.9: = specific_function %.loc9_18.8, @Convert.2(constants.%.1) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc9_18.2: init %i32 = call %.loc9_18.9(%.loc9_17) [template = constants.%.37] +// CHECK:STDOUT: %.loc9_18.10: %i32 = value_of_initializer %int.convert_checked.loc9_18.2 [template = constants.%.37] +// CHECK:STDOUT: %.loc9_18.11: %i32 = converted %.loc9_17, %.loc9_18.10 [template = constants.%.37] +// CHECK:STDOUT: %tuple: %tuple.type.8 = tuple_value (%.loc9_18.6, %.loc9_18.11) [template = constants.%tuple.5] // CHECK:STDOUT: %.loc9_12: %tuple.type.8 = converted %.loc9_18.1, %tuple [template = constants.%tuple.5] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple.5) [template = constants.%C.3] // CHECK:STDOUT: %return.param: ref %C.3 = out_param runtime_param0 @@ -198,7 +213,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc7_26: = complete_type_witness %.40 [template = constants.%.41] +// CHECK:STDOUT: %.loc7_26: = complete_type_witness %.41 [template = constants.%.42] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 @@ -209,55 +224,60 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc4_22: Core.IntLiteral = int_value 0 [template = constants.%.1] +// CHECK:STDOUT: %.loc4_22: Core.IntLiteral = int_value 0 [template = constants.%.2] // CHECK:STDOUT: %.loc4_24.1: %tuple.type.3 = tuple_literal (%.loc4_22) -// CHECK:STDOUT: %.loc4_24.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc4_24.3: = bound_method %.loc4_22, %.loc4_24.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc4: init i32 = call %.loc4_24.3(%.loc4_22) [template = constants.%.27] -// CHECK:STDOUT: %.loc4_24.4: init i32 = converted %.loc4_22, %int.convert_checked.loc4 [template = constants.%.27] -// CHECK:STDOUT: %.loc4_24.5: init %tuple.type.2 = tuple_init (%.loc4_24.4) to file.%a_ref.var [template = constants.%tuple.1] -// CHECK:STDOUT: %.loc4_25: init %tuple.type.2 = converted %.loc4_24.1, %.loc4_24.5 [template = constants.%tuple.1] +// CHECK:STDOUT: %.loc4_24.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc4_24.3: = bound_method %.loc4_22, %.loc4_24.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc4_24.4: = specific_function %.loc4_24.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %.loc4_24.4(%.loc4_22) [template = constants.%.25] +// CHECK:STDOUT: %.loc4_24.5: init %i32 = converted %.loc4_22, %int.convert_checked.loc4 [template = constants.%.25] +// CHECK:STDOUT: %.loc4_24.6: init %tuple.type.2 = tuple_init (%.loc4_24.5) to file.%a_ref.var [template = constants.%tuple.1] +// CHECK:STDOUT: %.loc4_25: init %tuple.type.2 = converted %.loc4_24.1, %.loc4_24.6 [template = constants.%tuple.1] // CHECK:STDOUT: assign file.%a_ref.var, %.loc4_25 -// CHECK:STDOUT: %.loc5_45: Core.IntLiteral = int_value 0 [template = constants.%.1] +// CHECK:STDOUT: %.loc5_45: Core.IntLiteral = int_value 0 [template = constants.%.2] // CHECK:STDOUT: %.loc5_47.1: %tuple.type.3 = tuple_literal (%.loc5_45) -// CHECK:STDOUT: %.loc5_50: Core.IntLiteral = int_value 1 [template = constants.%.31] +// CHECK:STDOUT: %.loc5_50: Core.IntLiteral = int_value 1 [template = constants.%.29] // CHECK:STDOUT: %.loc5_51.1: %tuple.type.11 = tuple_literal (%.loc5_47.1, %.loc5_50) -// CHECK:STDOUT: %.loc5_55: Core.IntLiteral = int_value 2 [template = constants.%.32] -// CHECK:STDOUT: %.loc5_58: Core.IntLiteral = int_value 3 [template = constants.%.33] +// CHECK:STDOUT: %.loc5_55: Core.IntLiteral = int_value 2 [template = constants.%.30] +// CHECK:STDOUT: %.loc5_58: Core.IntLiteral = int_value 3 [template = constants.%.31] // CHECK:STDOUT: %.loc5_59.1: %tuple.type.12 = tuple_literal (%.loc5_55, %.loc5_58) // CHECK:STDOUT: %.loc5_60.1: %tuple.type.13 = tuple_literal (%.loc5_51.1, %.loc5_59.1) -// CHECK:STDOUT: %.loc5_47.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc5_47.3: = bound_method %.loc5_45, %.loc5_47.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked.loc5_47: init i32 = call %.loc5_47.3(%.loc5_45) [template = constants.%.27] -// CHECK:STDOUT: %.loc5_47.4: init i32 = converted %.loc5_45, %int.convert_checked.loc5_47 [template = constants.%.27] +// CHECK:STDOUT: %.loc5_47.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc5_47.3: = bound_method %.loc5_45, %.loc5_47.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc5_47.4: = specific_function %.loc5_47.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked.loc5_47: init %i32 = call %.loc5_47.4(%.loc5_45) [template = constants.%.25] +// CHECK:STDOUT: %.loc5_47.5: init %i32 = converted %.loc5_45, %int.convert_checked.loc5_47 [template = constants.%.25] // CHECK:STDOUT: %.loc5_60.2: ref %tuple.type.7 = tuple_access file.%b_ref.var, element0 // CHECK:STDOUT: %.loc5_51.2: ref %tuple.type.2 = tuple_access %.loc5_60.2, element0 -// CHECK:STDOUT: %.loc5_47.5: init %tuple.type.2 = tuple_init (%.loc5_47.4) to %.loc5_51.2 [template = constants.%tuple.1] -// CHECK:STDOUT: %.loc5_51.3: init %tuple.type.2 = converted %.loc5_47.1, %.loc5_47.5 [template = constants.%tuple.1] +// CHECK:STDOUT: %.loc5_47.6: init %tuple.type.2 = tuple_init (%.loc5_47.5) to %.loc5_51.2 [template = constants.%tuple.1] +// CHECK:STDOUT: %.loc5_51.3: init %tuple.type.2 = converted %.loc5_47.1, %.loc5_47.6 [template = constants.%tuple.1] // CHECK:STDOUT: %.loc5_51.4: init %tuple.type.2 = initialize_from %.loc5_51.3 to %.loc5_51.2 [template = constants.%tuple.1] -// CHECK:STDOUT: %.loc5_51.5: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc5_51.6: = bound_method %.loc5_50, %.loc5_51.5 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc5_51: init i32 = call %.loc5_51.6(%.loc5_50) [template = constants.%.35] -// CHECK:STDOUT: %.loc5_51.7: init i32 = converted %.loc5_50, %int.convert_checked.loc5_51 [template = constants.%.35] -// CHECK:STDOUT: %.loc5_51.8: ref i32 = tuple_access %.loc5_60.2, element1 -// CHECK:STDOUT: %.loc5_51.9: init i32 = initialize_from %.loc5_51.7 to %.loc5_51.8 [template = constants.%.35] -// CHECK:STDOUT: %.loc5_51.10: init %tuple.type.7 = tuple_init (%.loc5_51.4, %.loc5_51.9) to %.loc5_60.2 [template = constants.%tuple.2] -// CHECK:STDOUT: %.loc5_60.3: init %tuple.type.7 = converted %.loc5_51.1, %.loc5_51.10 [template = constants.%tuple.2] -// CHECK:STDOUT: %.loc5_59.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc5_59.3: = bound_method %.loc5_55, %.loc5_59.2 [template = constants.%.36] -// CHECK:STDOUT: %int.convert_checked.loc5_59.1: init i32 = call %.loc5_59.3(%.loc5_55) [template = constants.%.37] -// CHECK:STDOUT: %.loc5_59.4: init i32 = converted %.loc5_55, %int.convert_checked.loc5_59.1 [template = constants.%.37] +// CHECK:STDOUT: %.loc5_51.5: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc5_51.6: = bound_method %.loc5_50, %.loc5_51.5 [template = constants.%.32] +// CHECK:STDOUT: %.loc5_51.7: = specific_function %.loc5_51.6, @Convert.2(constants.%.1) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc5_51: init %i32 = call %.loc5_51.7(%.loc5_50) [template = constants.%.34] +// CHECK:STDOUT: %.loc5_51.8: init %i32 = converted %.loc5_50, %int.convert_checked.loc5_51 [template = constants.%.34] +// CHECK:STDOUT: %.loc5_51.9: ref %i32 = tuple_access %.loc5_60.2, element1 +// CHECK:STDOUT: %.loc5_51.10: init %i32 = initialize_from %.loc5_51.8 to %.loc5_51.9 [template = constants.%.34] +// CHECK:STDOUT: %.loc5_51.11: init %tuple.type.7 = tuple_init (%.loc5_51.4, %.loc5_51.10) to %.loc5_60.2 [template = constants.%tuple.2] +// CHECK:STDOUT: %.loc5_60.3: init %tuple.type.7 = converted %.loc5_51.1, %.loc5_51.11 [template = constants.%tuple.2] +// CHECK:STDOUT: %.loc5_59.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc5_59.3: = bound_method %.loc5_55, %.loc5_59.2 [template = constants.%.35] +// CHECK:STDOUT: %.loc5_59.4: = specific_function %.loc5_59.3, @Convert.2(constants.%.1) [template = constants.%.36] +// CHECK:STDOUT: %int.convert_checked.loc5_59.1: init %i32 = call %.loc5_59.4(%.loc5_55) [template = constants.%.37] +// CHECK:STDOUT: %.loc5_59.5: init %i32 = converted %.loc5_55, %int.convert_checked.loc5_59.1 [template = constants.%.37] // CHECK:STDOUT: %.loc5_60.4: ref %tuple.type.8 = tuple_access file.%b_ref.var, element1 -// CHECK:STDOUT: %.loc5_59.5: ref i32 = tuple_access %.loc5_60.4, element0 -// CHECK:STDOUT: %.loc5_59.6: init i32 = initialize_from %.loc5_59.4 to %.loc5_59.5 [template = constants.%.37] -// CHECK:STDOUT: %.loc5_59.7: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc5_59.8: = bound_method %.loc5_58, %.loc5_59.7 [template = constants.%.38] -// CHECK:STDOUT: %int.convert_checked.loc5_59.2: init i32 = call %.loc5_59.8(%.loc5_58) [template = constants.%.39] -// CHECK:STDOUT: %.loc5_59.9: init i32 = converted %.loc5_58, %int.convert_checked.loc5_59.2 [template = constants.%.39] -// CHECK:STDOUT: %.loc5_59.10: ref i32 = tuple_access %.loc5_60.4, element1 -// CHECK:STDOUT: %.loc5_59.11: init i32 = initialize_from %.loc5_59.9 to %.loc5_59.10 [template = constants.%.39] -// CHECK:STDOUT: %.loc5_59.12: init %tuple.type.8 = tuple_init (%.loc5_59.6, %.loc5_59.11) to %.loc5_60.4 [template = constants.%tuple.3] -// CHECK:STDOUT: %.loc5_60.5: init %tuple.type.8 = converted %.loc5_59.1, %.loc5_59.12 [template = constants.%tuple.3] +// CHECK:STDOUT: %.loc5_59.6: ref %i32 = tuple_access %.loc5_60.4, element0 +// CHECK:STDOUT: %.loc5_59.7: init %i32 = initialize_from %.loc5_59.5 to %.loc5_59.6 [template = constants.%.37] +// CHECK:STDOUT: %.loc5_59.8: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc5_59.9: = bound_method %.loc5_58, %.loc5_59.8 [template = constants.%.38] +// CHECK:STDOUT: %.loc5_59.10: = specific_function %.loc5_59.9, @Convert.2(constants.%.1) [template = constants.%.39] +// CHECK:STDOUT: %int.convert_checked.loc5_59.2: init %i32 = call %.loc5_59.10(%.loc5_58) [template = constants.%.40] +// CHECK:STDOUT: %.loc5_59.11: init %i32 = converted %.loc5_58, %int.convert_checked.loc5_59.2 [template = constants.%.40] +// CHECK:STDOUT: %.loc5_59.12: ref %i32 = tuple_access %.loc5_60.4, element1 +// CHECK:STDOUT: %.loc5_59.13: init %i32 = initialize_from %.loc5_59.11 to %.loc5_59.12 [template = constants.%.40] +// CHECK:STDOUT: %.loc5_59.14: init %tuple.type.8 = tuple_init (%.loc5_59.7, %.loc5_59.13) to %.loc5_60.4 [template = constants.%tuple.3] +// CHECK:STDOUT: %.loc5_60.5: init %tuple.type.8 = converted %.loc5_59.1, %.loc5_59.14 [template = constants.%tuple.3] // CHECK:STDOUT: %.loc5_60.6: init %tuple.type.9 = tuple_init (%.loc5_60.3, %.loc5_60.5) to file.%b_ref.var [template = constants.%tuple.4] // CHECK:STDOUT: %.loc5_61: init %tuple.type.9 = converted %.loc5_60.1, %.loc5_60.6 [template = constants.%tuple.4] // CHECK:STDOUT: assign file.%b_ref.var, %.loc5_61 @@ -277,161 +297,148 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: --- implicit.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, imports.%import_ref.11 [symbolic] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.12 [template] -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %.5: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%.5)> [symbolic] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: = interface_witness (%Convert.2) [symbolic] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.3, @impl.2(%N) [symbolic] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic] -// CHECK:STDOUT: %.6: = interface_witness (%Convert.3) [symbolic] -// CHECK:STDOUT: %.7: type = int_type unsigned, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %.4: = interface_witness (%Convert.3) [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.4, @impl.3(%N) [symbolic] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] -// CHECK:STDOUT: %.8: = interface_witness (%Convert.4) [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %.5: = interface_witness (%Convert.4) [symbolic] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.5 [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.22 [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.5, %Convert.type.5 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.18 [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.5, @impl.4(%N) [symbolic] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] -// CHECK:STDOUT: %.11: = interface_witness (%Convert.6) [symbolic] -// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] -// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] -// CHECK:STDOUT: %.12: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %.8: = interface_witness (%Convert.6) [symbolic] // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] // CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%iN)> [symbolic] // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.9: type = assoc_entity_type %As.type.2, %Convert.type.7 [symbolic] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.28 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.7, @impl.5(%N) [symbolic] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] -// CHECK:STDOUT: %.13: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] -// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.35 [symbolic] -// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] -// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] -// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.36 [template] -// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.5)> [symbolic] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.8) [symbolic] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.8, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.9) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.9, @impl.7(%N) [symbolic] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] -// CHECK:STDOUT: %.17: = interface_witness (%Convert.10) [symbolic] -// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] -// CHECK:STDOUT: %.18: = interface_witness (%Convert.11) [symbolic] -// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] -// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] -// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.46 [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] -// CHECK:STDOUT: %.21: = interface_witness (%Convert.13) [symbolic] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] -// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %.14: type = assoc_entity_type %As.type.5, %Convert.type.11 [template] +// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.35 [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.12) [symbolic] +// CHECK:STDOUT: %.17: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.17 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32) [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%tuple.type.1, type) [template] // CHECK:STDOUT: %tuple.type.4: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.5: type = tuple_type (%tuple.type.3, %tuple.type.4) [template] -// CHECK:STDOUT: %tuple.type.6: type = tuple_type (%tuple.type.2, i32) [template] -// CHECK:STDOUT: %tuple.type.7: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %tuple.type.6: type = tuple_type (%tuple.type.2, %i32) [template] +// CHECK:STDOUT: %tuple.type.7: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %tuple.type.8: type = tuple_type (%tuple.type.6, %tuple.type.7) [template] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %X: %tuple.type.7 = bind_symbolic_name X, 0 [symbolic] // CHECK:STDOUT: %X.patt: %tuple.type.7 = symbolic_binding_pattern X, 0 [symbolic] -// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.23: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.24: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.10: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.30: %.1 = assoc_entity element0, imports.%import_ref.56 [symbolic] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.31: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.32: = bound_method %.28, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 1 [template] -// CHECK:STDOUT: %.34: = bound_method %.29, %Convert.15 [template] -// CHECK:STDOUT: %.35: i32 = int_value 2 [template] -// CHECK:STDOUT: %tuple: %tuple.type.7 = tuple_value (%.33, %.35) [template] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] +// CHECK:STDOUT: %.25: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.13 [template] +// CHECK:STDOUT: %.26: %.25 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %.27: %.1 = assoc_entity element0, imports.%import_ref.42 [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.17) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.28: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.29: = bound_method %.23, %Convert.14 [template] +// CHECK:STDOUT: %.30: = specific_function %.29, @Convert.2(%.17) [template] +// CHECK:STDOUT: %.31: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.32: = bound_method %.24, %Convert.14 [template] +// CHECK:STDOUT: %.33: = specific_function %.32, @Convert.2(%.17) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 2 [template] +// CHECK:STDOUT: %tuple: %tuple.type.7 = tuple_value (%.31, %.34) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%tuple) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: ref %tuple.type.2 = import_ref Implicit//default, inst+19, loaded -// CHECK:STDOUT: %import_ref.2: ref %tuple.type.8 = import_ref Implicit//default, inst+423, loaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+497, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+529, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1: ref %tuple.type.2 = import_ref Implicit//default, inst+26, loaded +// CHECK:STDOUT: %import_ref.2: ref %tuple.type.8 = import_ref Implicit//default, inst+406, loaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+489, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+523, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.53 -// CHECK:STDOUT: .ImplicitAs = %import_ref.55 +// CHECK:STDOUT: .Int = %import_ref.39 +// CHECK:STDOUT: .ImplicitAs = %import_ref.41 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+37, unloaded -// CHECK:STDOUT: %import_ref.6: @ImplicitAs.%.1 (%.1) = import_ref Implicit//default, inst+38, loaded [symbolic = @ImplicitAs.%.2 (constants.%.30)] -// CHECK:STDOUT: %import_ref.7 = import_ref Implicit//default, inst+39, unloaded -// CHECK:STDOUT: %import_ref.8: type = import_ref Implicit//default, inst+73, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.9: type = import_ref Implicit//default, inst+74, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.10: = import_ref Implicit//default, inst+75, loaded [template = constants.%.31] -// CHECK:STDOUT: %import_ref.11 = import_ref Implicit//default, inst+54, unloaded -// CHECK:STDOUT: %import_ref.13: type = import_ref Implicit//default, inst+85, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.14: type = import_ref Implicit//default, inst+86, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] -// CHECK:STDOUT: %import_ref.15 = import_ref Implicit//default, inst+87, unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref Implicit//default, inst+115, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.17: type = import_ref Implicit//default, inst+116, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.5)] -// CHECK:STDOUT: %import_ref.18 = import_ref Implicit//default, inst+117, unloaded -// CHECK:STDOUT: %import_ref.19: type = import_ref Implicit//default, inst+140, loaded [template = i32] -// CHECK:STDOUT: %import_ref.20: type = import_ref Implicit//default, inst+141, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.21 = import_ref Implicit//default, inst+142, unloaded -// CHECK:STDOUT: %import_ref.23: type = import_ref Implicit//default, inst+153, loaded [symbolic = @impl.5.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.24: type = import_ref Implicit//default, inst+154, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.25 = import_ref Implicit//default, inst+155, unloaded -// CHECK:STDOUT: %import_ref.26: type = import_ref Implicit//default, inst+180, loaded [symbolic = @impl.6.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.27: type = import_ref Implicit//default, inst+181, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.28 = import_ref Implicit//default, inst+182, unloaded -// CHECK:STDOUT: %import_ref.29 = import_ref Implicit//default, inst+212, unloaded -// CHECK:STDOUT: %import_ref.30 = import_ref Implicit//default, inst+213, unloaded -// CHECK:STDOUT: %import_ref.31 = import_ref Implicit//default, inst+214, unloaded -// CHECK:STDOUT: %import_ref.32: type = import_ref Implicit//default, inst+216, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.33: type = import_ref Implicit//default, inst+217, loaded [template = constants.%As.type.3] -// CHECK:STDOUT: %import_ref.34 = import_ref Implicit//default, inst+218, unloaded -// CHECK:STDOUT: %import_ref.35 = import_ref Implicit//default, inst+233, unloaded -// CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+255, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.38: type = import_ref Implicit//default, inst+256, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] -// CHECK:STDOUT: %import_ref.39 = import_ref Implicit//default, inst+257, unloaded -// CHECK:STDOUT: %import_ref.40: type = import_ref Implicit//default, inst+284, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.41: type = import_ref Implicit//default, inst+285, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] -// CHECK:STDOUT: %import_ref.42 = import_ref Implicit//default, inst+286, unloaded -// CHECK:STDOUT: %import_ref.43: type = import_ref Implicit//default, inst+309, loaded [template = i32] -// CHECK:STDOUT: %import_ref.44: type = import_ref Implicit//default, inst+310, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.45 = import_ref Implicit//default, inst+311, unloaded -// CHECK:STDOUT: %import_ref.47: type = import_ref Implicit//default, inst+322, loaded [symbolic = @impl.11.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.48: type = import_ref Implicit//default, inst+323, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.49 = import_ref Implicit//default, inst+324, unloaded -// CHECK:STDOUT: %import_ref.50: type = import_ref Implicit//default, inst+349, loaded [symbolic = @impl.12.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.51: type = import_ref Implicit//default, inst+350, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.52 = import_ref Implicit//default, inst+351, unloaded -// CHECK:STDOUT: %import_ref.54 = import_ref Implicit//default, inst+502, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+44, unloaded +// CHECK:STDOUT: %import_ref.6: @ImplicitAs.%.1 (%.1) = import_ref Implicit//default, inst+45, loaded [symbolic = @ImplicitAs.%.2 (constants.%.27)] +// CHECK:STDOUT: %import_ref.7 = import_ref Implicit//default, inst+46, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Implicit//default, inst+88, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Implicit//default, inst+89, loaded [symbolic = @impl.1.%ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: %import_ref.10: = import_ref Implicit//default, inst+90, loaded [symbolic = @impl.1.%.1 (constants.%.3)] +// CHECK:STDOUT: %import_ref.11 = import_ref Implicit//default, inst+61, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Implicit//default, inst+118, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Implicit//default, inst+119, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %import_ref.14 = import_ref Implicit//default, inst+120, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Implicit//default, inst+147, loaded [symbolic = @impl.3.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.16: type = import_ref Implicit//default, inst+148, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.17 = import_ref Implicit//default, inst+149, unloaded +// CHECK:STDOUT: %import_ref.19: type = import_ref Implicit//default, inst+179, loaded [symbolic = @impl.4.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.20: type = import_ref Implicit//default, inst+180, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.21 = import_ref Implicit//default, inst+181, unloaded +// CHECK:STDOUT: %import_ref.22 = import_ref Implicit//default, inst+211, unloaded +// CHECK:STDOUT: %import_ref.23 = import_ref Implicit//default, inst+212, unloaded +// CHECK:STDOUT: %import_ref.24 = import_ref Implicit//default, inst+213, unloaded +// CHECK:STDOUT: %import_ref.25: type = import_ref Implicit//default, inst+219, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.26: type = import_ref Implicit//default, inst+220, loaded [symbolic = @impl.5.%As.type (constants.%As.type.3)] +// CHECK:STDOUT: %import_ref.27 = import_ref Implicit//default, inst+221, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Implicit//default, inst+236, unloaded +// CHECK:STDOUT: %import_ref.29: type = import_ref Implicit//default, inst+273, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.30: type = import_ref Implicit//default, inst+274, loaded [symbolic = @impl.6.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.31 = import_ref Implicit//default, inst+275, unloaded +// CHECK:STDOUT: %import_ref.32: type = import_ref Implicit//default, inst+302, loaded [symbolic = @impl.7.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.33: type = import_ref Implicit//default, inst+303, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.34 = import_ref Implicit//default, inst+304, unloaded +// CHECK:STDOUT: %import_ref.36: type = import_ref Implicit//default, inst+334, loaded [symbolic = @impl.8.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+335, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.38 = import_ref Implicit//default, inst+336, unloaded +// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst+494, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -448,50 +455,57 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc4_13.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc4) -// CHECK:STDOUT: %.loc4_13.2: type = value_of_initializer %int.make_type_32.loc4 [template = i32] -// CHECK:STDOUT: %.loc4_13.3: type = converted %int.make_type_32.loc4, %.loc4_13.2 [template = i32] +// CHECK:STDOUT: %.loc4_9: Core.IntLiteral = int_value 32 [template = constants.%.17] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_13.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc4) +// CHECK:STDOUT: %.loc4_13.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_13.3: type = converted %int.make_type_signed.loc4, %.loc4_13.2 [template = constants.%i32] // CHECK:STDOUT: %.loc4_13.4: type = converted %.loc4_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_15: %tuple.type.1 = tuple_literal (%int.make_type_32.loc5_11) -// CHECK:STDOUT: %int.make_type_32.loc5_18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_21: %tuple.type.3 = tuple_literal (%.loc5_15, %int.make_type_32.loc5_18) -// CHECK:STDOUT: %int.make_type_32.loc5_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc5_30: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_33: %tuple.type.4 = tuple_literal (%int.make_type_32.loc5_25, %int.make_type_32.loc5_30) +// CHECK:STDOUT: %.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%.17] +// CHECK:STDOUT: %int.make_type_signed.loc5_11: init type = call constants.%Int(%.loc5_11) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_15: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc5_11) +// CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 32 [template = constants.%.17] +// CHECK:STDOUT: %int.make_type_signed.loc5_18: init type = call constants.%Int(%.loc5_18) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_21: %tuple.type.3 = tuple_literal (%.loc5_15, %int.make_type_signed.loc5_18) +// CHECK:STDOUT: %.loc5_25: Core.IntLiteral = int_value 32 [template = constants.%.17] +// CHECK:STDOUT: %int.make_type_signed.loc5_25: init type = call constants.%Int(%.loc5_25) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_30: Core.IntLiteral = int_value 32 [template = constants.%.17] +// CHECK:STDOUT: %int.make_type_signed.loc5_30: init type = call constants.%Int(%.loc5_30) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_33: %tuple.type.4 = tuple_literal (%int.make_type_signed.loc5_25, %int.make_type_signed.loc5_30) // CHECK:STDOUT: %.loc5_34.1: %tuple.type.5 = tuple_literal (%.loc5_21, %.loc5_33) -// CHECK:STDOUT: %.loc5_34.2: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] -// CHECK:STDOUT: %.loc5_34.3: type = converted %int.make_type_32.loc5_11, %.loc5_34.2 [template = i32] +// CHECK:STDOUT: %.loc5_34.2: type = value_of_initializer %int.make_type_signed.loc5_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_34.3: type = converted %int.make_type_signed.loc5_11, %.loc5_34.2 [template = constants.%i32] // CHECK:STDOUT: %.loc5_34.4: type = converted %.loc5_15, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc5_34.5: type = value_of_initializer %int.make_type_32.loc5_18 [template = i32] -// CHECK:STDOUT: %.loc5_34.6: type = converted %int.make_type_32.loc5_18, %.loc5_34.5 [template = i32] +// CHECK:STDOUT: %.loc5_34.5: type = value_of_initializer %int.make_type_signed.loc5_18 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_34.6: type = converted %int.make_type_signed.loc5_18, %.loc5_34.5 [template = constants.%i32] // CHECK:STDOUT: %.loc5_34.7: type = converted %.loc5_21, constants.%tuple.type.6 [template = constants.%tuple.type.6] -// CHECK:STDOUT: %.loc5_34.8: type = value_of_initializer %int.make_type_32.loc5_25 [template = i32] -// CHECK:STDOUT: %.loc5_34.9: type = converted %int.make_type_32.loc5_25, %.loc5_34.8 [template = i32] -// CHECK:STDOUT: %.loc5_34.10: type = value_of_initializer %int.make_type_32.loc5_30 [template = i32] -// CHECK:STDOUT: %.loc5_34.11: type = converted %int.make_type_32.loc5_30, %.loc5_34.10 [template = i32] +// CHECK:STDOUT: %.loc5_34.8: type = value_of_initializer %int.make_type_signed.loc5_25 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_34.9: type = converted %int.make_type_signed.loc5_25, %.loc5_34.8 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_34.10: type = value_of_initializer %int.make_type_signed.loc5_30 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_34.11: type = converted %int.make_type_signed.loc5_30, %.loc5_34.10 [template = constants.%i32] // CHECK:STDOUT: %.loc5_34.12: type = converted %.loc5_33, constants.%tuple.type.7 [template = constants.%tuple.type.7] // CHECK:STDOUT: %.loc5_34.13: type = converted %.loc5_34.1, constants.%tuple.type.8 [template = constants.%tuple.type.8] // CHECK:STDOUT: %b.var: ref %tuple.type.8 = var b // CHECK:STDOUT: %b: ref %tuple.type.8 = bind_name b, %b.var // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] -// CHECK:STDOUT: %.loc6_11: Core.IntLiteral = int_value 1 [template = constants.%.28] -// CHECK:STDOUT: %.loc6_14: Core.IntLiteral = int_value 2 [template = constants.%.29] +// CHECK:STDOUT: %.loc6_11: Core.IntLiteral = int_value 1 [template = constants.%.23] +// CHECK:STDOUT: %.loc6_14: Core.IntLiteral = int_value 2 [template = constants.%.24] // CHECK:STDOUT: %.loc6_15.1: %tuple.type.10 = tuple_literal (%.loc6_11, %.loc6_14) -// CHECK:STDOUT: %.loc6_15.2: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_15.3: = bound_method %.loc6_11, %.loc6_15.2 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc6_15.1: init i32 = call %.loc6_15.3(%.loc6_11) [template = constants.%.33] -// CHECK:STDOUT: %.loc6_15.4: i32 = value_of_initializer %int.convert_checked.loc6_15.1 [template = constants.%.33] -// CHECK:STDOUT: %.loc6_15.5: i32 = converted %.loc6_11, %.loc6_15.4 [template = constants.%.33] -// CHECK:STDOUT: %.loc6_15.6: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc6_15.7: = bound_method %.loc6_14, %.loc6_15.6 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc6_15.2: init i32 = call %.loc6_15.7(%.loc6_14) [template = constants.%.35] -// CHECK:STDOUT: %.loc6_15.8: i32 = value_of_initializer %int.convert_checked.loc6_15.2 [template = constants.%.35] -// CHECK:STDOUT: %.loc6_15.9: i32 = converted %.loc6_14, %.loc6_15.8 [template = constants.%.35] -// CHECK:STDOUT: %tuple: %tuple.type.7 = tuple_value (%.loc6_15.5, %.loc6_15.9) [template = constants.%tuple] +// CHECK:STDOUT: %.loc6_15.2: %Convert.type.13 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_15.3: = bound_method %.loc6_11, %.loc6_15.2 [template = constants.%.29] +// CHECK:STDOUT: %.loc6_15.4: = specific_function %.loc6_15.3, @Convert.2(constants.%.17) [template = constants.%.30] +// CHECK:STDOUT: %int.convert_checked.loc6_15.1: init %i32 = call %.loc6_15.4(%.loc6_11) [template = constants.%.31] +// CHECK:STDOUT: %.loc6_15.5: %i32 = value_of_initializer %int.convert_checked.loc6_15.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc6_15.6: %i32 = converted %.loc6_11, %.loc6_15.5 [template = constants.%.31] +// CHECK:STDOUT: %.loc6_15.7: %Convert.type.13 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc6_15.8: = bound_method %.loc6_14, %.loc6_15.7 [template = constants.%.32] +// CHECK:STDOUT: %.loc6_15.9: = specific_function %.loc6_15.8, @Convert.2(constants.%.17) [template = constants.%.33] +// CHECK:STDOUT: %int.convert_checked.loc6_15.2: init %i32 = call %.loc6_15.9(%.loc6_14) [template = constants.%.34] +// CHECK:STDOUT: %.loc6_15.10: %i32 = value_of_initializer %int.convert_checked.loc6_15.2 [template = constants.%.34] +// CHECK:STDOUT: %.loc6_15.11: %i32 = converted %.loc6_14, %.loc6_15.10 [template = constants.%.34] +// CHECK:STDOUT: %tuple: %tuple.type.7 = tuple_value (%.loc6_15.6, %.loc6_15.11) [template = constants.%tuple] // CHECK:STDOUT: %.loc6_9: %tuple.type.7 = converted %.loc6_15.1, %tuple [template = constants.%tuple] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple) [template = constants.%C.3] // CHECK:STDOUT: %c.var: ref %C.3 = var c @@ -525,168 +539,148 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] -// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.13)] -// CHECK:STDOUT: %.2: @As.%.1 (%.13) = assoc_entity element0, imports.%import_ref.35 [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.7) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %.2: @As.%.1 (%.9) = assoc_entity element0, imports.%import_ref.28 [symbolic = %.2 (constants.%.10)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.29 -// CHECK:STDOUT: .Convert = imports.%import_ref.30 -// CHECK:STDOUT: witness = (imports.%import_ref.31) +// CHECK:STDOUT: .Self = imports.%import_ref.22 +// CHECK:STDOUT: .Convert = imports.%import_ref.23 +// CHECK:STDOUT: witness = (imports.%import_ref.24) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: generic impl @impl.1(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.1(%N) [symbolic = %Convert.type (constants.%Convert.type.2)] +// CHECK:STDOUT: %Convert: @impl.1.%Convert.type (%Convert.type.2) = struct_value () [symbolic = %Convert (constants.%Convert.2)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] // CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.13 as imports.%import_ref.14 { +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.15 +// CHECK:STDOUT: witness = imports.%import_ref.14 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] // CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.16 as imports.%import_ref.17 { +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.18 +// CHECK:STDOUT: witness = imports.%import_ref.17 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.19 as imports.%import_ref.20 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.21 +// CHECK:STDOUT: generic impl @impl.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.4(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.4.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.19 as imports.%import_ref.20 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.21 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%iN)> [symbolic = %As.type (constants.%As.type.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] -// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.23 as imports.%import_ref.24 { +// CHECK:STDOUT: impl: imports.%import_ref.25 as imports.%import_ref.26 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.25 +// CHECK:STDOUT: witness = imports.%import_ref.27 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%uN)> [symbolic = %As.type (constants.%As.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] -// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.9)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.26 as imports.%import_ref.27 { +// CHECK:STDOUT: impl: imports.%import_ref.29 as imports.%import_ref.30 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.28 +// CHECK:STDOUT: witness = imports.%import_ref.31 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.7: imports.%import_ref.32 as imports.%import_ref.33 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.34 +// CHECK:STDOUT: generic impl @impl.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.7(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.7.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.32 as imports.%import_ref.33 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.34 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] -// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.12)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.12) = struct_value () [symbolic = %Convert (constants.%Convert.12)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.37 as imports.%import_ref.38 { +// CHECK:STDOUT: impl: imports.%import_ref.36 as imports.%import_ref.37 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.39 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] -// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.40 as imports.%import_ref.41 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.42 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.10: imports.%import_ref.43 as imports.%import_ref.44 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.45 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] -// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.47 as imports.%import_ref.48 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.49 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] -// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.50 as imports.%import_ref.51 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.52 +// CHECK:STDOUT: witness = imports.%import_ref.38 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -698,7 +692,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.54 +// CHECK:STDOUT: .Self = imports.%import_ref.40 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -712,38 +706,38 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { @@ -756,78 +750,76 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.11[%self.param_patt: Core.IntLiteral]() -> i32 = "int.convert_checked"; -// CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %C.3; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a_ref.ref: ref %tuple.type.2 = name_ref a_ref, imports.%import_ref.1 -// CHECK:STDOUT: %.loc4_17.1: ref i32 = tuple_access %a_ref.ref, element0 -// CHECK:STDOUT: %.loc4_17.2: i32 = bind_value %.loc4_17.1 +// CHECK:STDOUT: %.loc4_17.1: ref %i32 = tuple_access %a_ref.ref, element0 +// CHECK:STDOUT: %.loc4_17.2: %i32 = bind_value %.loc4_17.1 // CHECK:STDOUT: %.loc4_17.3: init %tuple.type.2 = tuple_init (%.loc4_17.2) to file.%a.var // CHECK:STDOUT: %.loc4_22: init %tuple.type.2 = converted %a_ref.ref, %.loc4_17.3 // CHECK:STDOUT: assign file.%a.var, %.loc4_22 // CHECK:STDOUT: %b_ref.ref: ref %tuple.type.8 = name_ref b_ref, imports.%import_ref.2 // CHECK:STDOUT: %.loc5_38.1: ref %tuple.type.6 = tuple_access %b_ref.ref, element0 // CHECK:STDOUT: %.loc5_38.2: ref %tuple.type.2 = tuple_access %.loc5_38.1, element0 -// CHECK:STDOUT: %.loc5_38.3: ref i32 = tuple_access %.loc5_38.2, element0 -// CHECK:STDOUT: %.loc5_38.4: i32 = bind_value %.loc5_38.3 +// CHECK:STDOUT: %.loc5_38.3: ref %i32 = tuple_access %.loc5_38.2, element0 +// CHECK:STDOUT: %.loc5_38.4: %i32 = bind_value %.loc5_38.3 // CHECK:STDOUT: %.loc5_38.5: ref %tuple.type.6 = tuple_access file.%b.var, element0 // CHECK:STDOUT: %.loc5_38.6: ref %tuple.type.2 = tuple_access %.loc5_38.5, element0 // CHECK:STDOUT: %.loc5_38.7: init %tuple.type.2 = tuple_init (%.loc5_38.4) to %.loc5_38.6 // CHECK:STDOUT: %.loc5_38.8: init %tuple.type.2 = converted %.loc5_38.2, %.loc5_38.7 // CHECK:STDOUT: %.loc5_38.9: init %tuple.type.2 = initialize_from %.loc5_38.8 to %.loc5_38.6 -// CHECK:STDOUT: %.loc5_38.10: ref i32 = tuple_access %.loc5_38.1, element1 -// CHECK:STDOUT: %.loc5_38.11: i32 = bind_value %.loc5_38.10 -// CHECK:STDOUT: %.loc5_38.12: ref i32 = tuple_access %.loc5_38.5, element1 -// CHECK:STDOUT: %.loc5_38.13: init i32 = initialize_from %.loc5_38.11 to %.loc5_38.12 +// CHECK:STDOUT: %.loc5_38.10: ref %i32 = tuple_access %.loc5_38.1, element1 +// CHECK:STDOUT: %.loc5_38.11: %i32 = bind_value %.loc5_38.10 +// CHECK:STDOUT: %.loc5_38.12: ref %i32 = tuple_access %.loc5_38.5, element1 +// CHECK:STDOUT: %.loc5_38.13: init %i32 = initialize_from %.loc5_38.11 to %.loc5_38.12 // CHECK:STDOUT: %.loc5_38.14: init %tuple.type.6 = tuple_init (%.loc5_38.9, %.loc5_38.13) to %.loc5_38.5 // CHECK:STDOUT: %.loc5_38.15: init %tuple.type.6 = converted %.loc5_38.1, %.loc5_38.14 // CHECK:STDOUT: %.loc5_38.16: ref %tuple.type.7 = tuple_access %b_ref.ref, element1 -// CHECK:STDOUT: %.loc5_38.17: ref i32 = tuple_access %.loc5_38.16, element0 -// CHECK:STDOUT: %.loc5_38.18: i32 = bind_value %.loc5_38.17 +// CHECK:STDOUT: %.loc5_38.17: ref %i32 = tuple_access %.loc5_38.16, element0 +// CHECK:STDOUT: %.loc5_38.18: %i32 = bind_value %.loc5_38.17 // CHECK:STDOUT: %.loc5_38.19: ref %tuple.type.7 = tuple_access file.%b.var, element1 -// CHECK:STDOUT: %.loc5_38.20: ref i32 = tuple_access %.loc5_38.19, element0 -// CHECK:STDOUT: %.loc5_38.21: init i32 = initialize_from %.loc5_38.18 to %.loc5_38.20 -// CHECK:STDOUT: %.loc5_38.22: ref i32 = tuple_access %.loc5_38.16, element1 -// CHECK:STDOUT: %.loc5_38.23: i32 = bind_value %.loc5_38.22 -// CHECK:STDOUT: %.loc5_38.24: ref i32 = tuple_access %.loc5_38.19, element1 -// CHECK:STDOUT: %.loc5_38.25: init i32 = initialize_from %.loc5_38.23 to %.loc5_38.24 +// CHECK:STDOUT: %.loc5_38.20: ref %i32 = tuple_access %.loc5_38.19, element0 +// CHECK:STDOUT: %.loc5_38.21: init %i32 = initialize_from %.loc5_38.18 to %.loc5_38.20 +// CHECK:STDOUT: %.loc5_38.22: ref %i32 = tuple_access %.loc5_38.16, element1 +// CHECK:STDOUT: %.loc5_38.23: %i32 = bind_value %.loc5_38.22 +// CHECK:STDOUT: %.loc5_38.24: ref %i32 = tuple_access %.loc5_38.19, element1 +// CHECK:STDOUT: %.loc5_38.25: init %i32 = initialize_from %.loc5_38.23 to %.loc5_38.24 // CHECK:STDOUT: %.loc5_38.26: init %tuple.type.7 = tuple_init (%.loc5_38.21, %.loc5_38.25) to %.loc5_38.19 // CHECK:STDOUT: %.loc5_38.27: init %tuple.type.7 = converted %.loc5_38.16, %.loc5_38.26 // CHECK:STDOUT: %.loc5_38.28: init %tuple.type.8 = tuple_init (%.loc5_38.15, %.loc5_38.27) to file.%b.var @@ -845,17 +837,9 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 -// CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 -// CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.1 => constants.%.3 -// CHECK:STDOUT: %.2 => constants.%.4 +// CHECK:STDOUT: specific @ImplicitAs(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(%Dest) { @@ -863,6 +847,25 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.1.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -874,62 +877,38 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @ImplicitAs(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { @@ -937,46 +916,46 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5 // CHECK:STDOUT: %Convert => constants.%Convert.5 -// CHECK:STDOUT: %.1 => constants.%.9 -// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: specific @impl.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: specific @impl.3(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: specific @impl.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(%N) { +// CHECK:STDOUT: specific @impl.4(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.5(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%Dest) { @@ -984,17 +963,9 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.3 -// CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 -// CHECK:STDOUT: %Convert => constants.%Convert.9 -// CHECK:STDOUT: %.1 => constants.%.15 -// CHECK:STDOUT: %.2 => constants.%.16 +// CHECK:STDOUT: specific @As(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(%Dest) { @@ -1002,6 +973,25 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.5.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @As(@Convert.6.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -1013,62 +1003,38 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.8.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.9.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(@impl.6.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: specific @impl.6(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(%N) { +// CHECK:STDOUT: specific @impl.6(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(Core.IntLiteral) { @@ -1076,46 +1042,46 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %As.type => constants.%As.type.5 // CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 -// CHECK:STDOUT: %Convert => constants.%Convert.12 -// CHECK:STDOUT: %.1 => constants.%.19 -// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.11 +// CHECK:STDOUT: %Convert => constants.%Convert.11 +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.2 => constants.%.15 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: specific @impl.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(%N) { +// CHECK:STDOUT: specific @impl.7(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.9(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: specific @impl.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(%N) { +// CHECK:STDOUT: specific @impl.8(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.10(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%X) { @@ -1123,6 +1089,38 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %X.patt => constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%i32) { +// CHECK:STDOUT: %Dest => constants.%i32 +// CHECK:STDOUT: %Dest.patt => constants.%i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.13 +// CHECK:STDOUT: %Convert => constants.%Convert.13 +// CHECK:STDOUT: %.1 => constants.%.25 +// CHECK:STDOUT: %.2 => constants.%.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(constants.%.17) { +// CHECK:STDOUT: %N => constants.%.17 +// CHECK:STDOUT: %N.patt => constants.%.17 +// CHECK:STDOUT: %iN => constants.%i32 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.14 +// CHECK:STDOUT: %Convert => constants.%Convert.14 +// CHECK:STDOUT: %.1 => constants.%.28 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%.17) { +// CHECK:STDOUT: %N => constants.%.17 +// CHECK:STDOUT: %iN => constants.%i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%tuple) { // CHECK:STDOUT: %X => constants.%tuple // CHECK:STDOUT: %X.patt => constants.%tuple @@ -1133,145 +1131,125 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: --- fail_bad_type.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, imports.%import_ref.11 [symbolic] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.12 [template] -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %.5: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%.5)> [symbolic] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: = interface_witness (%Convert.2) [symbolic] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.3, @impl.2(%N) [symbolic] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic] -// CHECK:STDOUT: %.6: = interface_witness (%Convert.3) [symbolic] -// CHECK:STDOUT: %.7: type = int_type unsigned, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %.4: = interface_witness (%Convert.3) [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.4, @impl.3(%N) [symbolic] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] -// CHECK:STDOUT: %.8: = interface_witness (%Convert.4) [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %.5: = interface_witness (%Convert.4) [symbolic] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.5 [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.22 [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.5, %Convert.type.5 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.18 [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.5, @impl.4(%N) [symbolic] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] -// CHECK:STDOUT: %.11: = interface_witness (%Convert.6) [symbolic] -// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] -// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] -// CHECK:STDOUT: %.12: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %.8: = interface_witness (%Convert.6) [symbolic] // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] // CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%iN)> [symbolic] // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.9: type = assoc_entity_type %As.type.2, %Convert.type.7 [symbolic] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.28 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.7, @impl.5(%N) [symbolic] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] -// CHECK:STDOUT: %.13: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] -// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.35 [symbolic] -// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] -// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] -// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.36 [template] -// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.5)> [symbolic] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.8) [symbolic] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.8, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.9) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.9, @impl.7(%N) [symbolic] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] -// CHECK:STDOUT: %.17: = interface_witness (%Convert.10) [symbolic] -// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] -// CHECK:STDOUT: %.18: = interface_witness (%Convert.11) [symbolic] -// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] -// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] -// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.46 [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] -// CHECK:STDOUT: %.21: = interface_witness (%Convert.13) [symbolic] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] -// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %.14: type = assoc_entity_type %As.type.5, %Convert.type.11 [template] +// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.35 [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.12) [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %.19: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.19 [template] +// CHECK:STDOUT: %tuple.type.1: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %X: %tuple.type.1 = bind_symbolic_name X, 0 [symbolic] // CHECK:STDOUT: %X.patt: %tuple.type.1 = symbolic_binding_pattern X, 0 [symbolic] -// CHECK:STDOUT: %.25: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.20: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.21: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %.22: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.29: i32 = int_value 2 [template] -// CHECK:STDOUT: %.30: i32 = int_value 1 [template] -// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.30, %.29) [template] +// CHECK:STDOUT: %.24: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.25: %i32 = int_value 1 [template] +// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.25, %.24) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+19, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+423, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+497, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+529, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+26, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+406, unloaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+489, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+523, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+37, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Implicit//default, inst+38, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Implicit//default, inst+39, unloaded -// CHECK:STDOUT: %import_ref.8: type = import_ref Implicit//default, inst+73, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.9: type = import_ref Implicit//default, inst+74, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.10 = import_ref Implicit//default, inst+75, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Implicit//default, inst+54, unloaded -// CHECK:STDOUT: %import_ref.13: type = import_ref Implicit//default, inst+85, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.14: type = import_ref Implicit//default, inst+86, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] -// CHECK:STDOUT: %import_ref.15 = import_ref Implicit//default, inst+87, unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref Implicit//default, inst+115, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.17: type = import_ref Implicit//default, inst+116, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.5)] -// CHECK:STDOUT: %import_ref.18 = import_ref Implicit//default, inst+117, unloaded -// CHECK:STDOUT: %import_ref.19: type = import_ref Implicit//default, inst+140, loaded [template = i32] -// CHECK:STDOUT: %import_ref.20: type = import_ref Implicit//default, inst+141, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.21 = import_ref Implicit//default, inst+142, unloaded -// CHECK:STDOUT: %import_ref.23: type = import_ref Implicit//default, inst+153, loaded [symbolic = @impl.5.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.24: type = import_ref Implicit//default, inst+154, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.25 = import_ref Implicit//default, inst+155, unloaded -// CHECK:STDOUT: %import_ref.26: type = import_ref Implicit//default, inst+180, loaded [symbolic = @impl.6.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.27: type = import_ref Implicit//default, inst+181, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.28 = import_ref Implicit//default, inst+182, unloaded -// CHECK:STDOUT: %import_ref.29 = import_ref Implicit//default, inst+212, unloaded -// CHECK:STDOUT: %import_ref.30 = import_ref Implicit//default, inst+213, unloaded -// CHECK:STDOUT: %import_ref.31 = import_ref Implicit//default, inst+214, unloaded -// CHECK:STDOUT: %import_ref.32: type = import_ref Implicit//default, inst+216, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.33: type = import_ref Implicit//default, inst+217, loaded [template = constants.%As.type.3] -// CHECK:STDOUT: %import_ref.34 = import_ref Implicit//default, inst+218, unloaded -// CHECK:STDOUT: %import_ref.35 = import_ref Implicit//default, inst+233, unloaded -// CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+255, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.38: type = import_ref Implicit//default, inst+256, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] -// CHECK:STDOUT: %import_ref.39 = import_ref Implicit//default, inst+257, unloaded -// CHECK:STDOUT: %import_ref.40: type = import_ref Implicit//default, inst+284, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.41: type = import_ref Implicit//default, inst+285, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] -// CHECK:STDOUT: %import_ref.42 = import_ref Implicit//default, inst+286, unloaded -// CHECK:STDOUT: %import_ref.43: type = import_ref Implicit//default, inst+309, loaded [template = i32] -// CHECK:STDOUT: %import_ref.44: type = import_ref Implicit//default, inst+310, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.45 = import_ref Implicit//default, inst+311, unloaded -// CHECK:STDOUT: %import_ref.47: type = import_ref Implicit//default, inst+322, loaded [symbolic = @impl.11.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.48: type = import_ref Implicit//default, inst+323, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.49 = import_ref Implicit//default, inst+324, unloaded -// CHECK:STDOUT: %import_ref.50: type = import_ref Implicit//default, inst+349, loaded [symbolic = @impl.12.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.51: type = import_ref Implicit//default, inst+350, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.52 = import_ref Implicit//default, inst+351, unloaded -// CHECK:STDOUT: %import_ref.53 = import_ref Implicit//default, inst+502, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+44, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Implicit//default, inst+45, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Implicit//default, inst+46, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Implicit//default, inst+88, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Implicit//default, inst+89, loaded [symbolic = @impl.1.%ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: %import_ref.10 = import_ref Implicit//default, inst+90, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Implicit//default, inst+61, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Implicit//default, inst+118, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Implicit//default, inst+119, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %import_ref.14 = import_ref Implicit//default, inst+120, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Implicit//default, inst+147, loaded [symbolic = @impl.3.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.16: type = import_ref Implicit//default, inst+148, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.17 = import_ref Implicit//default, inst+149, unloaded +// CHECK:STDOUT: %import_ref.19: type = import_ref Implicit//default, inst+179, loaded [symbolic = @impl.4.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.20: type = import_ref Implicit//default, inst+180, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.21 = import_ref Implicit//default, inst+181, unloaded +// CHECK:STDOUT: %import_ref.22 = import_ref Implicit//default, inst+211, unloaded +// CHECK:STDOUT: %import_ref.23 = import_ref Implicit//default, inst+212, unloaded +// CHECK:STDOUT: %import_ref.24 = import_ref Implicit//default, inst+213, unloaded +// CHECK:STDOUT: %import_ref.25: type = import_ref Implicit//default, inst+219, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.26: type = import_ref Implicit//default, inst+220, loaded [symbolic = @impl.5.%As.type (constants.%As.type.3)] +// CHECK:STDOUT: %import_ref.27 = import_ref Implicit//default, inst+221, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Implicit//default, inst+236, unloaded +// CHECK:STDOUT: %import_ref.29: type = import_ref Implicit//default, inst+273, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.30: type = import_ref Implicit//default, inst+274, loaded [symbolic = @impl.6.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.31 = import_ref Implicit//default, inst+275, unloaded +// CHECK:STDOUT: %import_ref.32: type = import_ref Implicit//default, inst+302, loaded [symbolic = @impl.7.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.33: type = import_ref Implicit//default, inst+303, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.34 = import_ref Implicit//default, inst+304, unloaded +// CHECK:STDOUT: %import_ref.36: type = import_ref Implicit//default, inst+334, loaded [symbolic = @impl.8.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+335, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.38 = import_ref Implicit//default, inst+336, unloaded +// CHECK:STDOUT: %import_ref.39 = import_ref Implicit//default, inst+494, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1287,9 +1265,9 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] -// CHECK:STDOUT: %.loc12_15: Core.IntLiteral = int_value 1 [template = constants.%.25] -// CHECK:STDOUT: %.loc12_18: Core.IntLiteral = int_value 2 [template = constants.%.26] -// CHECK:STDOUT: %.loc12_21: Core.IntLiteral = int_value 3 [template = constants.%.27] +// CHECK:STDOUT: %.loc12_15: Core.IntLiteral = int_value 1 [template = constants.%.20] +// CHECK:STDOUT: %.loc12_18: Core.IntLiteral = int_value 2 [template = constants.%.21] +// CHECK:STDOUT: %.loc12_21: Core.IntLiteral = int_value 3 [template = constants.%.22] // CHECK:STDOUT: %.loc12_22: %tuple.type.2 = tuple_literal (%.loc12_15, %.loc12_18, %.loc12_21) // CHECK:STDOUT: %c_bad.var: ref = var c_bad // CHECK:STDOUT: %c_bad: ref = bind_name c_bad, %c_bad.var @@ -1322,168 +1300,148 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] -// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.13)] -// CHECK:STDOUT: %.2: @As.%.1 (%.13) = assoc_entity element0, imports.%import_ref.35 [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.7) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %.2: @As.%.1 (%.9) = assoc_entity element0, imports.%import_ref.28 [symbolic = %.2 (constants.%.10)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.29 -// CHECK:STDOUT: .Convert = imports.%import_ref.30 -// CHECK:STDOUT: witness = (imports.%import_ref.31) +// CHECK:STDOUT: .Self = imports.%import_ref.22 +// CHECK:STDOUT: .Convert = imports.%import_ref.23 +// CHECK:STDOUT: witness = (imports.%import_ref.24) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: generic impl @impl.1(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.1(%N) [symbolic = %Convert.type (constants.%Convert.type.2)] +// CHECK:STDOUT: %Convert: @impl.1.%Convert.type (%Convert.type.2) = struct_value () [symbolic = %Convert (constants.%Convert.2)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] // CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.13 as imports.%import_ref.14 { +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.15 +// CHECK:STDOUT: witness = imports.%import_ref.14 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] // CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.16 as imports.%import_ref.17 { +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.18 +// CHECK:STDOUT: witness = imports.%import_ref.17 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.19 as imports.%import_ref.20 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.21 +// CHECK:STDOUT: generic impl @impl.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.4(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.4.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.19 as imports.%import_ref.20 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.21 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%iN)> [symbolic = %As.type (constants.%As.type.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] -// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.23 as imports.%import_ref.24 { +// CHECK:STDOUT: impl: imports.%import_ref.25 as imports.%import_ref.26 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.25 +// CHECK:STDOUT: witness = imports.%import_ref.27 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%uN)> [symbolic = %As.type (constants.%As.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] -// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.9)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.26 as imports.%import_ref.27 { +// CHECK:STDOUT: impl: imports.%import_ref.29 as imports.%import_ref.30 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.28 +// CHECK:STDOUT: witness = imports.%import_ref.31 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.7: imports.%import_ref.32 as imports.%import_ref.33 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.34 +// CHECK:STDOUT: generic impl @impl.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.7(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.7.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.32 as imports.%import_ref.33 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.34 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] -// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.12)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.12) = struct_value () [symbolic = %Convert (constants.%Convert.12)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.37 as imports.%import_ref.38 { +// CHECK:STDOUT: impl: imports.%import_ref.36 as imports.%import_ref.37 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.39 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] -// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.40 as imports.%import_ref.41 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.42 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.10: imports.%import_ref.43 as imports.%import_ref.44 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.45 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] -// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.47 as imports.%import_ref.48 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.49 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] -// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.50 as imports.%import_ref.51 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.52 +// CHECK:STDOUT: witness = imports.%import_ref.38 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1495,7 +1453,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.53 +// CHECK:STDOUT: .Self = imports.%import_ref.39 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1509,38 +1467,38 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { @@ -1553,38 +1511,38 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %C.3; @@ -1603,17 +1561,9 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 -// CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 -// CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.1 => constants.%.3 -// CHECK:STDOUT: %.2 => constants.%.4 +// CHECK:STDOUT: specific @ImplicitAs(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(%Dest) { @@ -1621,6 +1571,25 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.1.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -1632,62 +1601,38 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @ImplicitAs(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { @@ -1695,46 +1640,46 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5 // CHECK:STDOUT: %Convert => constants.%Convert.5 -// CHECK:STDOUT: %.1 => constants.%.9 -// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: specific @impl.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: specific @impl.3(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: specific @impl.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(%N) { +// CHECK:STDOUT: specific @impl.4(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.5(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%Dest) { @@ -1742,17 +1687,9 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.3 -// CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 -// CHECK:STDOUT: %Convert => constants.%Convert.9 -// CHECK:STDOUT: %.1 => constants.%.15 -// CHECK:STDOUT: %.2 => constants.%.16 +// CHECK:STDOUT: specific @As(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(%Dest) { @@ -1760,6 +1697,25 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.5.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @As(@Convert.6.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -1771,62 +1727,38 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.8.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.9.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(@impl.6.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: specific @impl.6(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(%N) { +// CHECK:STDOUT: specific @impl.6(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(Core.IntLiteral) { @@ -1834,46 +1766,46 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %As.type => constants.%As.type.5 // CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 -// CHECK:STDOUT: %Convert => constants.%Convert.12 -// CHECK:STDOUT: %.1 => constants.%.19 -// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.11 +// CHECK:STDOUT: %Convert => constants.%Convert.11 +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.2 => constants.%.15 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: specific @impl.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(%N) { +// CHECK:STDOUT: specific @impl.7(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.9(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: specific @impl.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(%N) { +// CHECK:STDOUT: specific @impl.8(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.10(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%X) { @@ -1891,160 +1823,147 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: --- fail_bad_value.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(i32)> [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, imports.%import_ref.11 [symbolic] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.12 [template] -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %.5: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%.5)> [symbolic] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2, @impl.2(%N) [symbolic] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic] +// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %.3: = interface_witness (%Convert.2) [symbolic] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.3, @impl.2(%N) [symbolic] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic] -// CHECK:STDOUT: %.6: = interface_witness (%Convert.3) [symbolic] -// CHECK:STDOUT: %.7: type = int_type unsigned, %N [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3, @impl.3(%N) [symbolic] +// CHECK:STDOUT: %.4: = interface_witness (%Convert.3) [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.4, @impl.3(%N) [symbolic] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic] -// CHECK:STDOUT: %.8: = interface_witness (%Convert.4) [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template] +// CHECK:STDOUT: %.5: = interface_witness (%Convert.4) [symbolic] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.5 [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.22 [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4, @impl.5(%N) [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.5, %Convert.type.5 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.18 [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.5, @impl.4(%N) [symbolic] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic] -// CHECK:STDOUT: %.11: = interface_witness (%Convert.6) [symbolic] -// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5, @impl.6(%N) [symbolic] -// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] -// CHECK:STDOUT: %.12: = interface_witness (%Convert.7) [symbolic] +// CHECK:STDOUT: %.8: = interface_witness (%Convert.6) [symbolic] // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic] // CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(i32)> [template] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%iN)> [symbolic] // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.6, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic] +// CHECK:STDOUT: %.9: type = assoc_entity_type %As.type.2, %Convert.type.7 [symbolic] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.28 [symbolic] +// CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.7, @impl.5(%N) [symbolic] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] -// CHECK:STDOUT: %.13: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] -// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.35 [symbolic] -// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.6, @As(i32) [template] -// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %.15: type = assoc_entity_type %As.type.3, %Convert.type.9 [template] -// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.36 [template] -// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%.5)> [symbolic] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.7, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.8) [symbolic] +// CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%uN)> [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.8, @impl.6(%N) [symbolic] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic] +// CHECK:STDOUT: %.12: = interface_witness (%Convert.9) [symbolic] +// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(Core.IntLiteral)> [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.9, @impl.7(%N) [symbolic] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic] -// CHECK:STDOUT: %.17: = interface_witness (%Convert.10) [symbolic] -// CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(%.7)> [symbolic] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.8, @impl.9(%N) [symbolic] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [symbolic] -// CHECK:STDOUT: %.18: = interface_witness (%Convert.11) [symbolic] -// CHECK:STDOUT: %As.type.6: type = facet_type <@As, @As(Core.IntLiteral)> [template] -// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %.19: type = assoc_entity_type %As.type.6, %Convert.type.12 [template] -// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.46 [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.9, @impl.11(%N) [symbolic] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] -// CHECK:STDOUT: %.21: = interface_witness (%Convert.13) [symbolic] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.10, @impl.12(%N) [symbolic] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [symbolic] -// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [symbolic] +// CHECK:STDOUT: %.13: = interface_witness (%Convert.10) [symbolic] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %.14: type = assoc_entity_type %As.type.5, %Convert.type.11 [template] +// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.35 [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10, @impl.8(%N) [symbolic] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.12) [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %.19: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.19 [template] +// CHECK:STDOUT: %tuple.type.1: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %X: %tuple.type.1 = bind_symbolic_name X, 0 [symbolic] // CHECK:STDOUT: %X.patt: %tuple.type.1 = symbolic_binding_pattern X, 0 [symbolic] -// CHECK:STDOUT: %.25: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %.26: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.20: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %.21: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.28: %.1 = assoc_entity element0, imports.%import_ref.55 [symbolic] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.25, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 3 [template] -// CHECK:STDOUT: %.32: = bound_method %.26, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 4 [template] -// CHECK:STDOUT: %tuple.1: %tuple.type.1 = tuple_value (%.31, %.33) [template] +// CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] +// CHECK:STDOUT: %.23: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.13 [template] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %.25: %.1 = assoc_entity element0, imports.%import_ref.41 [symbolic] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.19) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.20, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.19) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 3 [template] +// CHECK:STDOUT: %.30: = bound_method %.21, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.19) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 4 [template] +// CHECK:STDOUT: %tuple.1: %tuple.type.1 = tuple_value (%.29, %.32) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%tuple.1) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.35: i32 = int_value 2 [template] -// CHECK:STDOUT: %.36: i32 = int_value 1 [template] -// CHECK:STDOUT: %tuple.2: %tuple.type.1 = tuple_value (%.36, %.35) [template] +// CHECK:STDOUT: %.34: %i32 = int_value 2 [template] +// CHECK:STDOUT: %.35: %i32 = int_value 1 [template] +// CHECK:STDOUT: %tuple.2: %tuple.type.1 = tuple_value (%.35, %.34) [template] // CHECK:STDOUT: %C.4: type = class_type @C, @C(%tuple.2) [template] // CHECK:STDOUT: %ImplicitAs.type.7: type = facet_type <@ImplicitAs, @ImplicitAs(%C.3)> [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.1, @ImplicitAs(%C.3) [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %.37: type = assoc_entity_type %ImplicitAs.type.7, %Convert.type.16 [template] -// CHECK:STDOUT: %.38: %.37 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.1, @ImplicitAs(%C.3) [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %.36: type = assoc_entity_type %ImplicitAs.type.7, %Convert.type.15 [template] +// CHECK:STDOUT: %.37: %.36 = assoc_entity element0, imports.%import_ref.11 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+19, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+423, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+497, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+529, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+26, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+406, unloaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+489, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+523, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.54 +// CHECK:STDOUT: .ImplicitAs = %import_ref.40 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+37, unloaded -// CHECK:STDOUT: %import_ref.6: @ImplicitAs.%.1 (%.1) = import_ref Implicit//default, inst+38, loaded [symbolic = @ImplicitAs.%.2 (constants.%.28)] -// CHECK:STDOUT: %import_ref.7 = import_ref Implicit//default, inst+39, unloaded -// CHECK:STDOUT: %import_ref.8: type = import_ref Implicit//default, inst+73, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.9: type = import_ref Implicit//default, inst+74, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.10: = import_ref Implicit//default, inst+75, loaded [template = constants.%.29] -// CHECK:STDOUT: %import_ref.11 = import_ref Implicit//default, inst+54, unloaded -// CHECK:STDOUT: %import_ref.13: type = import_ref Implicit//default, inst+85, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.14: type = import_ref Implicit//default, inst+86, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] -// CHECK:STDOUT: %import_ref.15 = import_ref Implicit//default, inst+87, unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref Implicit//default, inst+115, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.17: type = import_ref Implicit//default, inst+116, loaded [symbolic = @impl.3.%ImplicitAs.type (constants.%ImplicitAs.type.5)] -// CHECK:STDOUT: %import_ref.18 = import_ref Implicit//default, inst+117, unloaded -// CHECK:STDOUT: %import_ref.19: type = import_ref Implicit//default, inst+140, loaded [template = i32] -// CHECK:STDOUT: %import_ref.20: type = import_ref Implicit//default, inst+141, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.21 = import_ref Implicit//default, inst+142, unloaded -// CHECK:STDOUT: %import_ref.23: type = import_ref Implicit//default, inst+153, loaded [symbolic = @impl.5.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.24: type = import_ref Implicit//default, inst+154, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.25 = import_ref Implicit//default, inst+155, unloaded -// CHECK:STDOUT: %import_ref.26: type = import_ref Implicit//default, inst+180, loaded [symbolic = @impl.6.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.27: type = import_ref Implicit//default, inst+181, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.28 = import_ref Implicit//default, inst+182, unloaded -// CHECK:STDOUT: %import_ref.29 = import_ref Implicit//default, inst+212, unloaded -// CHECK:STDOUT: %import_ref.30 = import_ref Implicit//default, inst+213, unloaded -// CHECK:STDOUT: %import_ref.31 = import_ref Implicit//default, inst+214, unloaded -// CHECK:STDOUT: %import_ref.32: type = import_ref Implicit//default, inst+216, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.33: type = import_ref Implicit//default, inst+217, loaded [template = constants.%As.type.3] -// CHECK:STDOUT: %import_ref.34 = import_ref Implicit//default, inst+218, unloaded -// CHECK:STDOUT: %import_ref.35 = import_ref Implicit//default, inst+233, unloaded -// CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+255, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.38: type = import_ref Implicit//default, inst+256, loaded [symbolic = @impl.8.%As.type (constants.%As.type.4)] -// CHECK:STDOUT: %import_ref.39 = import_ref Implicit//default, inst+257, unloaded -// CHECK:STDOUT: %import_ref.40: type = import_ref Implicit//default, inst+284, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.41: type = import_ref Implicit//default, inst+285, loaded [symbolic = @impl.9.%As.type (constants.%As.type.5)] -// CHECK:STDOUT: %import_ref.42 = import_ref Implicit//default, inst+286, unloaded -// CHECK:STDOUT: %import_ref.43: type = import_ref Implicit//default, inst+309, loaded [template = i32] -// CHECK:STDOUT: %import_ref.44: type = import_ref Implicit//default, inst+310, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.45 = import_ref Implicit//default, inst+311, unloaded -// CHECK:STDOUT: %import_ref.47: type = import_ref Implicit//default, inst+322, loaded [symbolic = @impl.11.%.1 (constants.%.5)] -// CHECK:STDOUT: %import_ref.48: type = import_ref Implicit//default, inst+323, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.49 = import_ref Implicit//default, inst+324, unloaded -// CHECK:STDOUT: %import_ref.50: type = import_ref Implicit//default, inst+349, loaded [symbolic = @impl.12.%.1 (constants.%.7)] -// CHECK:STDOUT: %import_ref.51: type = import_ref Implicit//default, inst+350, loaded [template = constants.%As.type.6] -// CHECK:STDOUT: %import_ref.52 = import_ref Implicit//default, inst+351, unloaded -// CHECK:STDOUT: %import_ref.53 = import_ref Implicit//default, inst+502, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+44, unloaded +// CHECK:STDOUT: %import_ref.6: @ImplicitAs.%.1 (%.1) = import_ref Implicit//default, inst+45, loaded [symbolic = @ImplicitAs.%.2 (constants.%.25)] +// CHECK:STDOUT: %import_ref.7 = import_ref Implicit//default, inst+46, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Implicit//default, inst+88, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Implicit//default, inst+89, loaded [symbolic = @impl.1.%ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: %import_ref.10: = import_ref Implicit//default, inst+90, loaded [symbolic = @impl.1.%.1 (constants.%.3)] +// CHECK:STDOUT: %import_ref.11 = import_ref Implicit//default, inst+61, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Implicit//default, inst+118, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.13: type = import_ref Implicit//default, inst+119, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %import_ref.14 = import_ref Implicit//default, inst+120, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Implicit//default, inst+147, loaded [symbolic = @impl.3.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.16: type = import_ref Implicit//default, inst+148, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.17 = import_ref Implicit//default, inst+149, unloaded +// CHECK:STDOUT: %import_ref.19: type = import_ref Implicit//default, inst+179, loaded [symbolic = @impl.4.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.20: type = import_ref Implicit//default, inst+180, loaded [template = constants.%ImplicitAs.type.5] +// CHECK:STDOUT: %import_ref.21 = import_ref Implicit//default, inst+181, unloaded +// CHECK:STDOUT: %import_ref.22 = import_ref Implicit//default, inst+211, unloaded +// CHECK:STDOUT: %import_ref.23 = import_ref Implicit//default, inst+212, unloaded +// CHECK:STDOUT: %import_ref.24 = import_ref Implicit//default, inst+213, unloaded +// CHECK:STDOUT: %import_ref.25: type = import_ref Implicit//default, inst+219, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.26: type = import_ref Implicit//default, inst+220, loaded [symbolic = @impl.5.%As.type (constants.%As.type.3)] +// CHECK:STDOUT: %import_ref.27 = import_ref Implicit//default, inst+221, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Implicit//default, inst+236, unloaded +// CHECK:STDOUT: %import_ref.29: type = import_ref Implicit//default, inst+273, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.30: type = import_ref Implicit//default, inst+274, loaded [symbolic = @impl.6.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.31 = import_ref Implicit//default, inst+275, unloaded +// CHECK:STDOUT: %import_ref.32: type = import_ref Implicit//default, inst+302, loaded [symbolic = @impl.7.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.33: type = import_ref Implicit//default, inst+303, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.34 = import_ref Implicit//default, inst+304, unloaded +// CHECK:STDOUT: %import_ref.36: type = import_ref Implicit//default, inst+334, loaded [symbolic = @impl.8.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+335, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.38 = import_ref Implicit//default, inst+336, unloaded +// CHECK:STDOUT: %import_ref.39 = import_ref Implicit//default, inst+494, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -2060,20 +1979,22 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] -// CHECK:STDOUT: %.loc10_15: Core.IntLiteral = int_value 3 [template = constants.%.25] -// CHECK:STDOUT: %.loc10_18: Core.IntLiteral = int_value 4 [template = constants.%.26] +// CHECK:STDOUT: %.loc10_15: Core.IntLiteral = int_value 3 [template = constants.%.20] +// CHECK:STDOUT: %.loc10_18: Core.IntLiteral = int_value 4 [template = constants.%.21] // CHECK:STDOUT: %.loc10_19.1: %tuple.type.2 = tuple_literal (%.loc10_15, %.loc10_18) -// CHECK:STDOUT: %.loc10_19.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_19.3: = bound_method %.loc10_15, %.loc10_19.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc10_19.1: init i32 = call %.loc10_19.3(%.loc10_15) [template = constants.%.31] -// CHECK:STDOUT: %.loc10_19.4: i32 = value_of_initializer %int.convert_checked.loc10_19.1 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_19.5: i32 = converted %.loc10_15, %.loc10_19.4 [template = constants.%.31] -// CHECK:STDOUT: %.loc10_19.6: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc10_19.7: = bound_method %.loc10_18, %.loc10_19.6 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc10_19.2: init i32 = call %.loc10_19.7(%.loc10_18) [template = constants.%.33] -// CHECK:STDOUT: %.loc10_19.8: i32 = value_of_initializer %int.convert_checked.loc10_19.2 [template = constants.%.33] -// CHECK:STDOUT: %.loc10_19.9: i32 = converted %.loc10_18, %.loc10_19.8 [template = constants.%.33] -// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.loc10_19.5, %.loc10_19.9) [template = constants.%tuple.1] +// CHECK:STDOUT: %.loc10_19.2: %Convert.type.13 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_19.3: = bound_method %.loc10_15, %.loc10_19.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc10_19.4: = specific_function %.loc10_19.3, @Convert.2(constants.%.19) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc10_19.1: init %i32 = call %.loc10_19.4(%.loc10_15) [template = constants.%.29] +// CHECK:STDOUT: %.loc10_19.5: %i32 = value_of_initializer %int.convert_checked.loc10_19.1 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_19.6: %i32 = converted %.loc10_15, %.loc10_19.5 [template = constants.%.29] +// CHECK:STDOUT: %.loc10_19.7: %Convert.type.13 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc10_19.8: = bound_method %.loc10_18, %.loc10_19.7 [template = constants.%.30] +// CHECK:STDOUT: %.loc10_19.9: = specific_function %.loc10_19.8, @Convert.2(constants.%.19) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc10_19.2: init %i32 = call %.loc10_19.9(%.loc10_18) [template = constants.%.32] +// CHECK:STDOUT: %.loc10_19.10: %i32 = value_of_initializer %int.convert_checked.loc10_19.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc10_19.11: %i32 = converted %.loc10_18, %.loc10_19.10 [template = constants.%.32] +// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.loc10_19.6, %.loc10_19.11) [template = constants.%tuple.1] // CHECK:STDOUT: %.loc10_13: %tuple.type.1 = converted %.loc10_19.1, %tuple [template = constants.%tuple.1] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple.1) [template = constants.%C.3] // CHECK:STDOUT: %c_bad.var: ref %C.3 = var c_bad @@ -2107,168 +2028,148 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)] // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] -// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] -// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.13)] -// CHECK:STDOUT: %.2: @As.%.1 (%.13) = assoc_entity element0, imports.%import_ref.35 [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.7)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] +// CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.7) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %.2: @As.%.1 (%.9) = assoc_entity element0, imports.%import_ref.28 [symbolic = %.2 (constants.%.10)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.29 -// CHECK:STDOUT: .Convert = imports.%import_ref.30 -// CHECK:STDOUT: witness = (imports.%import_ref.31) +// CHECK:STDOUT: .Self = imports.%import_ref.22 +// CHECK:STDOUT: .Convert = imports.%import_ref.23 +// CHECK:STDOUT: witness = (imports.%import_ref.24) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.8 as imports.%import_ref.9 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: generic impl @impl.1(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.1(%N) [symbolic = %Convert.type (constants.%Convert.type.2)] +// CHECK:STDOUT: %Convert: @impl.1.%Convert.type (%Convert.type.2) = struct_value () [symbolic = %Convert (constants.%Convert.2)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)] // CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.13 as imports.%import_ref.14 { +// CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.15 +// CHECK:STDOUT: witness = imports.%import_ref.14 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)] // CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.16 as imports.%import_ref.17 { +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.18 +// CHECK:STDOUT: witness = imports.%import_ref.17 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.19 as imports.%import_ref.20 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.21 +// CHECK:STDOUT: generic impl @impl.4(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.4(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] +// CHECK:STDOUT: %Convert: @impl.4.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.19 as imports.%import_ref.20 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.21 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%iN)> [symbolic = %As.type (constants.%As.type.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.6)] -// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.8)] +// CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.11)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.23 as imports.%import_ref.24 { +// CHECK:STDOUT: impl: imports.%import_ref.25 as imports.%import_ref.26 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.25 +// CHECK:STDOUT: witness = imports.%import_ref.27 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%uN)> [symbolic = %As.type (constants.%As.type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.7)] -// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.9)] +// CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.12)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.26 as imports.%import_ref.27 { +// CHECK:STDOUT: impl: imports.%import_ref.29 as imports.%import_ref.30 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.28 +// CHECK:STDOUT: witness = imports.%import_ref.31 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.7: imports.%import_ref.32 as imports.%import_ref.33 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.34 +// CHECK:STDOUT: generic impl @impl.7(constants.%N: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.7(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] +// CHECK:STDOUT: %Convert: @impl.7.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.32 as imports.%import_ref.33 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.34 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.4)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.10)] -// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.12)] +// CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.12) = struct_value () [symbolic = %Convert (constants.%Convert.12)] +// CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.37 as imports.%import_ref.38 { +// CHECK:STDOUT: impl: imports.%import_ref.36 as imports.%import_ref.37 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.39 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.9(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%.1)> [symbolic = %As.type (constants.%As.type.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.9(%N) [symbolic = %Convert.type (constants.%Convert.type.11)] -// CHECK:STDOUT: %Convert: @impl.9.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.18)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.40 as imports.%import_ref.41 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.42 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.10: imports.%import_ref.43 as imports.%import_ref.44 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.45 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.11(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.11(%N) [symbolic = %Convert.type (constants.%Convert.type.13)] -// CHECK:STDOUT: %Convert: @impl.11.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.21)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.47 as imports.%import_ref.48 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.49 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.12(constants.%N: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.12(%N) [symbolic = %Convert.type (constants.%Convert.type.14)] -// CHECK:STDOUT: %Convert: @impl.12.%Convert.type (%Convert.type.14) = struct_value () [symbolic = %Convert (constants.%Convert.14)] -// CHECK:STDOUT: %.2: = interface_witness (%Convert) [symbolic = %.2 (constants.%.22)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.50 as imports.%import_ref.51 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.52 +// CHECK:STDOUT: witness = imports.%import_ref.38 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2280,7 +2181,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.53 +// CHECK:STDOUT: .Self = imports.%import_ref.39 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2294,38 +2195,38 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) { @@ -2338,42 +2239,40 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%.1 (%.5) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%iN (%iN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%.1 (%.7) = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%uN (%uN) = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type signed, %N [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%.1 (%.5)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %.1: type = int_type unsigned, %N [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%.1 (%.7)]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.11[%self.param_patt: Core.IntLiteral]() -> i32 = "int.convert_checked"; -// CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %C.4; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -2391,17 +2290,9 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 -// CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 -// CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.1 => constants.%.3 -// CHECK:STDOUT: %.2 => constants.%.4 +// CHECK:STDOUT: specific @ImplicitAs(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(%Dest) { @@ -2409,6 +2300,25 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.1.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -2420,62 +2330,38 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @Convert.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 +// CHECK:STDOUT: specific @ImplicitAs(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@impl.2.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@impl.3.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.3(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { @@ -2483,46 +2369,46 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5 // CHECK:STDOUT: %Convert => constants.%Convert.5 -// CHECK:STDOUT: %.1 => constants.%.9 -// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: specific @impl.3(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: specific @impl.3(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(constants.%N) { +// CHECK:STDOUT: specific @impl.4(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(%N) { +// CHECK:STDOUT: specific @impl.4(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.5(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%Dest) { @@ -2530,17 +2416,9 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(i32) { -// CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %Dest.patt => i32 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.3 -// CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9 -// CHECK:STDOUT: %Convert => constants.%Convert.9 -// CHECK:STDOUT: %.1 => constants.%.15 -// CHECK:STDOUT: %.2 => constants.%.16 +// CHECK:STDOUT: specific @As(constants.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(%Dest) { @@ -2548,6 +2426,25 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@impl.5.%iN) { +// CHECK:STDOUT: %Dest => constants.%iN +// CHECK:STDOUT: %Dest.patt => constants.%iN +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.5(%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %As.type => constants.%As.type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @As(@Convert.6.%Dest) { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %Dest.patt => constants.%Dest @@ -2559,62 +2456,38 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.5) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.8.%.1) { -// CHECK:STDOUT: %Dest => constants.%.5 -// CHECK:STDOUT: %Dest.patt => constants.%.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 -// CHECK:STDOUT: %As.type => constants.%As.type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%.7) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(constants.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@impl.9.%.1) { -// CHECK:STDOUT: %Dest => constants.%.7 -// CHECK:STDOUT: %Dest.patt => constants.%.7 +// CHECK:STDOUT: specific @As(@impl.6.%uN) { +// CHECK:STDOUT: %Dest => constants.%uN +// CHECK:STDOUT: %Dest.patt => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(constants.%N) { +// CHECK:STDOUT: specific @impl.6(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.9(%N) { +// CHECK:STDOUT: specific @impl.6(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 -// CHECK:STDOUT: %As.type => constants.%As.type.5 +// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %As.type => constants.%As.type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(Core.IntLiteral) { @@ -2622,46 +2495,46 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest.patt => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type => constants.%As.type.6 +// CHECK:STDOUT: %As.type => constants.%As.type.5 // CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.12 -// CHECK:STDOUT: %Convert => constants.%Convert.12 -// CHECK:STDOUT: %.1 => constants.%.19 -// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.11 +// CHECK:STDOUT: %Convert => constants.%Convert.11 +// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.2 => constants.%.15 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(constants.%N) { +// CHECK:STDOUT: specific @impl.7(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.11(%N) { +// CHECK:STDOUT: specific @impl.7(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.9(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %iN => constants.%iN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(constants.%N) { +// CHECK:STDOUT: specific @impl.8(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.12(%N) { +// CHECK:STDOUT: specific @impl.8(%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.10(constants.%N) { // CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %uN => constants.%uN // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%X) { @@ -2669,6 +2542,38 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %X.patt => constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%i32) { +// CHECK:STDOUT: %Dest => constants.%i32 +// CHECK:STDOUT: %Dest.patt => constants.%i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: %Self => constants.%Self.2 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.13 +// CHECK:STDOUT: %Convert => constants.%Convert.13 +// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.2 => constants.%.24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.1(constants.%.19) { +// CHECK:STDOUT: %N => constants.%.19 +// CHECK:STDOUT: %N.patt => constants.%.19 +// CHECK:STDOUT: %iN => constants.%i32 +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.14 +// CHECK:STDOUT: %Convert => constants.%Convert.14 +// CHECK:STDOUT: %.1 => constants.%.26 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%.19) { +// CHECK:STDOUT: %N => constants.%.19 +// CHECK:STDOUT: %iN => constants.%i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%tuple.1) { // CHECK:STDOUT: %X => constants.%tuple.1 // CHECK:STDOUT: %X.patt => constants.%tuple.1 @@ -2690,9 +2595,9 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.7 // CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.16 -// CHECK:STDOUT: %Convert => constants.%Convert.16 -// CHECK:STDOUT: %.1 => constants.%.37 -// CHECK:STDOUT: %.2 => constants.%.38 +// CHECK:STDOUT: %Convert.type => constants.%Convert.type.15 +// CHECK:STDOUT: %Convert => constants.%Convert.15 +// CHECK:STDOUT: %.1 => constants.%.36 +// CHECK:STDOUT: %.2 => constants.%.37 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/tuple/nested_tuple.carbon b/toolchain/check/testdata/tuple/nested_tuple.carbon index 047650c19147..68b3fd427231 100644 --- a/toolchain/check/testdata/tuple/nested_tuple.carbon +++ b/toolchain/check/testdata/tuple/nested_tuple.carbon @@ -13,34 +13,39 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: --- nested_tuple.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%tuple.type.1, type) [template] -// CHECK:STDOUT: %tuple.type.3: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %tuple.type.4: type = tuple_type (%tuple.type.3, i32) [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 76 [template] +// CHECK:STDOUT: %tuple.type.3: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %tuple.type.4: type = tuple_type (%tuple.type.3, %i32) [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 76 [template] // CHECK:STDOUT: %tuple.type.6: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 6 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.7: type = tuple_type (%tuple.type.6, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 12 [template] -// CHECK:STDOUT: %.32: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 76 [template] -// CHECK:STDOUT: %tuple.1: %tuple.type.3 = tuple_value (%.31, %.33) [template] -// CHECK:STDOUT: %.34: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.35: i32 = int_value 6 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 12 [template] +// CHECK:STDOUT: %.30: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 76 [template] +// CHECK:STDOUT: %tuple.1: %tuple.type.3 = tuple_value (%.29, %.32) [template] +// CHECK:STDOUT: %.33: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.34: = specific_function %.33, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.35: %i32 = int_value 6 [template] // CHECK:STDOUT: %tuple.2: %tuple.type.4 = tuple_value (%tuple.1, %.35) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -53,18 +58,21 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_15: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_18: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_10, %int.make_type_32.loc11_15) -// CHECK:STDOUT: %int.make_type_32.loc11_21: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_24.1: %tuple.type.2 = tuple_literal (%.loc11_18, %int.make_type_32.loc11_21) -// CHECK:STDOUT: %.loc11_24.2: type = value_of_initializer %int.make_type_32.loc11_10 [template = i32] -// CHECK:STDOUT: %.loc11_24.3: type = converted %int.make_type_32.loc11_10, %.loc11_24.2 [template = i32] -// CHECK:STDOUT: %.loc11_24.4: type = value_of_initializer %int.make_type_32.loc11_15 [template = i32] -// CHECK:STDOUT: %.loc11_24.5: type = converted %int.make_type_32.loc11_15, %.loc11_24.4 [template = i32] +// CHECK:STDOUT: %.loc11_10: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_10: init type = call constants.%Int(%.loc11_10) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_15: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_15: init type = call constants.%Int(%.loc11_15) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_18: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_10, %int.make_type_signed.loc11_15) +// CHECK:STDOUT: %.loc11_21: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_21: init type = call constants.%Int(%.loc11_21) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_24.1: %tuple.type.2 = tuple_literal (%.loc11_18, %int.make_type_signed.loc11_21) +// CHECK:STDOUT: %.loc11_24.2: type = value_of_initializer %int.make_type_signed.loc11_10 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_24.3: type = converted %int.make_type_signed.loc11_10, %.loc11_24.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_24.4: type = value_of_initializer %int.make_type_signed.loc11_15 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_24.5: type = converted %int.make_type_signed.loc11_15, %.loc11_24.4 [template = constants.%i32] // CHECK:STDOUT: %.loc11_24.6: type = converted %.loc11_18, constants.%tuple.type.3 [template = constants.%tuple.type.3] -// CHECK:STDOUT: %.loc11_24.7: type = value_of_initializer %int.make_type_32.loc11_21 [template = i32] -// CHECK:STDOUT: %.loc11_24.8: type = converted %int.make_type_32.loc11_21, %.loc11_24.7 [template = i32] +// CHECK:STDOUT: %.loc11_24.7: type = value_of_initializer %int.make_type_signed.loc11_21 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_24.8: type = converted %int.make_type_signed.loc11_21, %.loc11_24.7 [template = constants.%i32] // CHECK:STDOUT: %.loc11_24.9: type = converted %.loc11_24.1, constants.%tuple.type.4 [template = constants.%tuple.type.4] // CHECK:STDOUT: %x.var: ref %tuple.type.4 = var x // CHECK:STDOUT: %x: ref %tuple.type.4 = bind_name x, %x.var @@ -72,34 +80,37 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_30: Core.IntLiteral = int_value 12 [template = constants.%.3] -// CHECK:STDOUT: %.loc11_34: Core.IntLiteral = int_value 76 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_30: Core.IntLiteral = int_value 12 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_34: Core.IntLiteral = int_value 76 [template = constants.%.5] // CHECK:STDOUT: %.loc11_36.1: %tuple.type.6 = tuple_literal (%.loc11_30, %.loc11_34) -// CHECK:STDOUT: %.loc11_39: Core.IntLiteral = int_value 6 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_39: Core.IntLiteral = int_value 6 [template = constants.%.6] // CHECK:STDOUT: %.loc11_40.1: %tuple.type.7 = tuple_literal (%.loc11_36.1, %.loc11_39) -// CHECK:STDOUT: %.loc11_36.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_36.3: = bound_method %.loc11_30, %.loc11_36.2 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_36.1: init i32 = call %.loc11_36.3(%.loc11_30) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_36.4: init i32 = converted %.loc11_30, %int.convert_checked.loc11_36.1 [template = constants.%.31] +// CHECK:STDOUT: %.loc11_36.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_36.3: = bound_method %.loc11_30, %.loc11_36.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_36.4: = specific_function %.loc11_36.3, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc11_36.1: init %i32 = call %.loc11_36.4(%.loc11_30) [template = constants.%.29] +// CHECK:STDOUT: %.loc11_36.5: init %i32 = converted %.loc11_30, %int.convert_checked.loc11_36.1 [template = constants.%.29] // CHECK:STDOUT: %.loc11_40.2: ref %tuple.type.3 = tuple_access file.%x.var, element0 -// CHECK:STDOUT: %.loc11_36.5: ref i32 = tuple_access %.loc11_40.2, element0 -// CHECK:STDOUT: %.loc11_36.6: init i32 = initialize_from %.loc11_36.4 to %.loc11_36.5 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_36.7: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_36.8: = bound_method %.loc11_34, %.loc11_36.7 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc11_36.2: init i32 = call %.loc11_36.8(%.loc11_34) [template = constants.%.33] -// CHECK:STDOUT: %.loc11_36.9: init i32 = converted %.loc11_34, %int.convert_checked.loc11_36.2 [template = constants.%.33] -// CHECK:STDOUT: %.loc11_36.10: ref i32 = tuple_access %.loc11_40.2, element1 -// CHECK:STDOUT: %.loc11_36.11: init i32 = initialize_from %.loc11_36.9 to %.loc11_36.10 [template = constants.%.33] -// CHECK:STDOUT: %.loc11_36.12: init %tuple.type.3 = tuple_init (%.loc11_36.6, %.loc11_36.11) to %.loc11_40.2 [template = constants.%tuple.1] -// CHECK:STDOUT: %.loc11_40.3: init %tuple.type.3 = converted %.loc11_36.1, %.loc11_36.12 [template = constants.%tuple.1] -// CHECK:STDOUT: %.loc11_40.4: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_40.5: = bound_method %.loc11_39, %.loc11_40.4 [template = constants.%.34] -// CHECK:STDOUT: %int.convert_checked.loc11_40: init i32 = call %.loc11_40.5(%.loc11_39) [template = constants.%.35] -// CHECK:STDOUT: %.loc11_40.6: init i32 = converted %.loc11_39, %int.convert_checked.loc11_40 [template = constants.%.35] -// CHECK:STDOUT: %.loc11_40.7: ref i32 = tuple_access file.%x.var, element1 -// CHECK:STDOUT: %.loc11_40.8: init i32 = initialize_from %.loc11_40.6 to %.loc11_40.7 [template = constants.%.35] -// CHECK:STDOUT: %.loc11_40.9: init %tuple.type.4 = tuple_init (%.loc11_40.3, %.loc11_40.8) to file.%x.var [template = constants.%tuple.2] -// CHECK:STDOUT: %.loc11_41: init %tuple.type.4 = converted %.loc11_40.1, %.loc11_40.9 [template = constants.%tuple.2] +// CHECK:STDOUT: %.loc11_36.6: ref %i32 = tuple_access %.loc11_40.2, element0 +// CHECK:STDOUT: %.loc11_36.7: init %i32 = initialize_from %.loc11_36.5 to %.loc11_36.6 [template = constants.%.29] +// CHECK:STDOUT: %.loc11_36.8: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_36.9: = bound_method %.loc11_34, %.loc11_36.8 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_36.10: = specific_function %.loc11_36.9, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc11_36.2: init %i32 = call %.loc11_36.10(%.loc11_34) [template = constants.%.32] +// CHECK:STDOUT: %.loc11_36.11: init %i32 = converted %.loc11_34, %int.convert_checked.loc11_36.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc11_36.12: ref %i32 = tuple_access %.loc11_40.2, element1 +// CHECK:STDOUT: %.loc11_36.13: init %i32 = initialize_from %.loc11_36.11 to %.loc11_36.12 [template = constants.%.32] +// CHECK:STDOUT: %.loc11_36.14: init %tuple.type.3 = tuple_init (%.loc11_36.7, %.loc11_36.13) to %.loc11_40.2 [template = constants.%tuple.1] +// CHECK:STDOUT: %.loc11_40.3: init %tuple.type.3 = converted %.loc11_36.1, %.loc11_36.14 [template = constants.%tuple.1] +// CHECK:STDOUT: %.loc11_40.4: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_40.5: = bound_method %.loc11_39, %.loc11_40.4 [template = constants.%.33] +// CHECK:STDOUT: %.loc11_40.6: = specific_function %.loc11_40.5, @Convert.2(constants.%.1) [template = constants.%.34] +// CHECK:STDOUT: %int.convert_checked.loc11_40: init %i32 = call %.loc11_40.6(%.loc11_39) [template = constants.%.35] +// CHECK:STDOUT: %.loc11_40.7: init %i32 = converted %.loc11_39, %int.convert_checked.loc11_40 [template = constants.%.35] +// CHECK:STDOUT: %.loc11_40.8: ref %i32 = tuple_access file.%x.var, element1 +// CHECK:STDOUT: %.loc11_40.9: init %i32 = initialize_from %.loc11_40.7 to %.loc11_40.8 [template = constants.%.35] +// CHECK:STDOUT: %.loc11_40.10: init %tuple.type.4 = tuple_init (%.loc11_40.3, %.loc11_40.9) to file.%x.var [template = constants.%tuple.2] +// CHECK:STDOUT: %.loc11_41: init %tuple.type.4 = converted %.loc11_40.1, %.loc11_40.10 [template = constants.%tuple.2] // CHECK:STDOUT: assign file.%x.var, %.loc11_41 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon b/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon index 269c9f955a32..508e3f86325d 100644 --- a/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon +++ b/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon @@ -21,10 +21,12 @@ fn H() { // CHECK:STDOUT: --- nested_tuple_in_place.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32, i32) [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32, %i32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -34,23 +36,25 @@ fn H() { // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] // CHECK:STDOUT: %tuple.type.6: type = tuple_type (type, %tuple.type.1, type) [template] -// CHECK:STDOUT: %tuple.type.7: type = tuple_type (i32, %tuple.type.2, i32) [template] -// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %tuple.type.7: type = tuple_type (%i32, %tuple.type.2, %i32) [template] +// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.9: type = tuple_type (Core.IntLiteral, %tuple.type.2, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.29: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.30: = bound_method %.4, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 1 [template] -// CHECK:STDOUT: %.32: = bound_method %.5, %Convert.15 [template] -// CHECK:STDOUT: %.33: i32 = int_value 2 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.26: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.27: = bound_method %.5, %Convert.14 [template] +// CHECK:STDOUT: %.28: = specific_function %.27, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.29: %i32 = int_value 1 [template] +// CHECK:STDOUT: %.30: = bound_method %.6, %Convert.14 [template] +// CHECK:STDOUT: %.31: = specific_function %.30, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.32: %i32 = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -69,16 +73,19 @@ fn H() { // CHECK:STDOUT: %return.patt: %tuple.type.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_25.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_12, %int.make_type_32.loc11_17, %int.make_type_32.loc11_22) -// CHECK:STDOUT: %.loc11_25.2: type = value_of_initializer %int.make_type_32.loc11_12 [template = i32] -// CHECK:STDOUT: %.loc11_25.3: type = converted %int.make_type_32.loc11_12, %.loc11_25.2 [template = i32] -// CHECK:STDOUT: %.loc11_25.4: type = value_of_initializer %int.make_type_32.loc11_17 [template = i32] -// CHECK:STDOUT: %.loc11_25.5: type = converted %int.make_type_32.loc11_17, %.loc11_25.4 [template = i32] -// CHECK:STDOUT: %.loc11_25.6: type = value_of_initializer %int.make_type_32.loc11_22 [template = i32] -// CHECK:STDOUT: %.loc11_25.7: type = converted %int.make_type_32.loc11_22, %.loc11_25.6 [template = i32] +// CHECK:STDOUT: %.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_12: init type = call constants.%Int(%.loc11_12) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_17: init type = call constants.%Int(%.loc11_17) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_22: init type = call constants.%Int(%.loc11_22) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_12, %int.make_type_signed.loc11_17, %int.make_type_signed.loc11_22) +// CHECK:STDOUT: %.loc11_25.2: type = value_of_initializer %int.make_type_signed.loc11_12 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.3: type = converted %int.make_type_signed.loc11_12, %.loc11_25.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.4: type = value_of_initializer %int.make_type_signed.loc11_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.5: type = converted %int.make_type_signed.loc11_17, %.loc11_25.4 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.6: type = value_of_initializer %int.make_type_signed.loc11_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.7: type = converted %int.make_type_signed.loc11_22, %.loc11_25.6 [template = constants.%i32] // CHECK:STDOUT: %.loc11_25.8: type = converted %.loc11_25.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param @@ -91,28 +98,34 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc14_12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_25: %tuple.type.1 = tuple_literal (%int.make_type_32.loc14_12, %int.make_type_32.loc14_17, %int.make_type_32.loc14_22) -// CHECK:STDOUT: %int.make_type_32.loc14_29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_34: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_39: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_42: %tuple.type.1 = tuple_literal (%int.make_type_32.loc14_29, %int.make_type_32.loc14_34, %int.make_type_32.loc14_39) +// CHECK:STDOUT: %.loc14_12: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_12: init type = call constants.%Int(%.loc14_12) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_17: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_17: init type = call constants.%Int(%.loc14_17) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_22: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_22: init type = call constants.%Int(%.loc14_22) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_25: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_12, %int.make_type_signed.loc14_17, %int.make_type_signed.loc14_22) +// CHECK:STDOUT: %.loc14_29: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_29: init type = call constants.%Int(%.loc14_29) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_34: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_34: init type = call constants.%Int(%.loc14_34) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_39: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_39: init type = call constants.%Int(%.loc14_39) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_42: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_29, %int.make_type_signed.loc14_34, %int.make_type_signed.loc14_39) // CHECK:STDOUT: %.loc14_43.1: %tuple.type.3 = tuple_literal (%.loc14_25, %.loc14_42) -// CHECK:STDOUT: %.loc14_43.2: type = value_of_initializer %int.make_type_32.loc14_12 [template = i32] -// CHECK:STDOUT: %.loc14_43.3: type = converted %int.make_type_32.loc14_12, %.loc14_43.2 [template = i32] -// CHECK:STDOUT: %.loc14_43.4: type = value_of_initializer %int.make_type_32.loc14_17 [template = i32] -// CHECK:STDOUT: %.loc14_43.5: type = converted %int.make_type_32.loc14_17, %.loc14_43.4 [template = i32] -// CHECK:STDOUT: %.loc14_43.6: type = value_of_initializer %int.make_type_32.loc14_22 [template = i32] -// CHECK:STDOUT: %.loc14_43.7: type = converted %int.make_type_32.loc14_22, %.loc14_43.6 [template = i32] +// CHECK:STDOUT: %.loc14_43.2: type = value_of_initializer %int.make_type_signed.loc14_12 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_43.3: type = converted %int.make_type_signed.loc14_12, %.loc14_43.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_43.4: type = value_of_initializer %int.make_type_signed.loc14_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_43.5: type = converted %int.make_type_signed.loc14_17, %.loc14_43.4 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_43.6: type = value_of_initializer %int.make_type_signed.loc14_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_43.7: type = converted %int.make_type_signed.loc14_22, %.loc14_43.6 [template = constants.%i32] // CHECK:STDOUT: %.loc14_43.8: type = converted %.loc14_25, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc14_43.9: type = value_of_initializer %int.make_type_32.loc14_29 [template = i32] -// CHECK:STDOUT: %.loc14_43.10: type = converted %int.make_type_32.loc14_29, %.loc14_43.9 [template = i32] -// CHECK:STDOUT: %.loc14_43.11: type = value_of_initializer %int.make_type_32.loc14_34 [template = i32] -// CHECK:STDOUT: %.loc14_43.12: type = converted %int.make_type_32.loc14_34, %.loc14_43.11 [template = i32] -// CHECK:STDOUT: %.loc14_43.13: type = value_of_initializer %int.make_type_32.loc14_39 [template = i32] -// CHECK:STDOUT: %.loc14_43.14: type = converted %int.make_type_32.loc14_39, %.loc14_43.13 [template = i32] +// CHECK:STDOUT: %.loc14_43.9: type = value_of_initializer %int.make_type_signed.loc14_29 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_43.10: type = converted %int.make_type_signed.loc14_29, %.loc14_43.9 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_43.11: type = value_of_initializer %int.make_type_signed.loc14_34 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_43.12: type = converted %int.make_type_signed.loc14_34, %.loc14_43.11 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_43.13: type = value_of_initializer %int.make_type_signed.loc14_39 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_43.14: type = converted %int.make_type_signed.loc14_39, %.loc14_43.13 [template = constants.%i32] // CHECK:STDOUT: %.loc14_43.15: type = converted %.loc14_42, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %.loc14_43.16: type = converted %.loc14_43.1, constants.%tuple.type.4 [template = constants.%tuple.type.4] // CHECK:STDOUT: %v.var: ref %tuple.type.4 = var v @@ -132,47 +145,54 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: fn @H() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int.make_type_32.loc18_11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc18_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc18_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc18_27: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_30: %tuple.type.1 = tuple_literal (%int.make_type_32.loc18_17, %int.make_type_32.loc18_22, %int.make_type_32.loc18_27) -// CHECK:STDOUT: %int.make_type_32.loc18_33: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc18_36.1: %tuple.type.6 = tuple_literal (%int.make_type_32.loc18_11, %.loc18_30, %int.make_type_32.loc18_33) -// CHECK:STDOUT: %.loc18_36.2: type = value_of_initializer %int.make_type_32.loc18_11 [template = i32] -// CHECK:STDOUT: %.loc18_36.3: type = converted %int.make_type_32.loc18_11, %.loc18_36.2 [template = i32] -// CHECK:STDOUT: %.loc18_36.4: type = value_of_initializer %int.make_type_32.loc18_17 [template = i32] -// CHECK:STDOUT: %.loc18_36.5: type = converted %int.make_type_32.loc18_17, %.loc18_36.4 [template = i32] -// CHECK:STDOUT: %.loc18_36.6: type = value_of_initializer %int.make_type_32.loc18_22 [template = i32] -// CHECK:STDOUT: %.loc18_36.7: type = converted %int.make_type_32.loc18_22, %.loc18_36.6 [template = i32] -// CHECK:STDOUT: %.loc18_36.8: type = value_of_initializer %int.make_type_32.loc18_27 [template = i32] -// CHECK:STDOUT: %.loc18_36.9: type = converted %int.make_type_32.loc18_27, %.loc18_36.8 [template = i32] +// CHECK:STDOUT: %.loc18_11: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18_11: init type = call constants.%Int(%.loc18_11) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_17: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18_17: init type = call constants.%Int(%.loc18_17) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_22: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18_22: init type = call constants.%Int(%.loc18_22) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_27: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18_27: init type = call constants.%Int(%.loc18_27) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_30: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc18_17, %int.make_type_signed.loc18_22, %int.make_type_signed.loc18_27) +// CHECK:STDOUT: %.loc18_33: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc18_33: init type = call constants.%Int(%.loc18_33) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_36.1: %tuple.type.6 = tuple_literal (%int.make_type_signed.loc18_11, %.loc18_30, %int.make_type_signed.loc18_33) +// CHECK:STDOUT: %.loc18_36.2: type = value_of_initializer %int.make_type_signed.loc18_11 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_36.3: type = converted %int.make_type_signed.loc18_11, %.loc18_36.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_36.4: type = value_of_initializer %int.make_type_signed.loc18_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_36.5: type = converted %int.make_type_signed.loc18_17, %.loc18_36.4 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_36.6: type = value_of_initializer %int.make_type_signed.loc18_22 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_36.7: type = converted %int.make_type_signed.loc18_22, %.loc18_36.6 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_36.8: type = value_of_initializer %int.make_type_signed.loc18_27 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_36.9: type = converted %int.make_type_signed.loc18_27, %.loc18_36.8 [template = constants.%i32] // CHECK:STDOUT: %.loc18_36.10: type = converted %.loc18_30, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc18_36.11: type = value_of_initializer %int.make_type_32.loc18_33 [template = i32] -// CHECK:STDOUT: %.loc18_36.12: type = converted %int.make_type_32.loc18_33, %.loc18_36.11 [template = i32] +// CHECK:STDOUT: %.loc18_36.11: type = value_of_initializer %int.make_type_signed.loc18_33 [template = constants.%i32] +// CHECK:STDOUT: %.loc18_36.12: type = converted %int.make_type_signed.loc18_33, %.loc18_36.11 [template = constants.%i32] // CHECK:STDOUT: %.loc18_36.13: type = converted %.loc18_36.1, constants.%tuple.type.7 [template = constants.%tuple.type.7] // CHECK:STDOUT: %v.var: ref %tuple.type.7 = var v // CHECK:STDOUT: %v: ref %tuple.type.7 = bind_name v, %v.var -// CHECK:STDOUT: %.loc18_41: Core.IntLiteral = int_value 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc18_41: Core.IntLiteral = int_value 1 [template = constants.%.5] // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %.loc18_50.1: ref %tuple.type.2 = tuple_access %v.var, element1 // CHECK:STDOUT: %F.call: init %tuple.type.2 = call %F.ref() to %.loc18_50.1 -// CHECK:STDOUT: %.loc18_49: Core.IntLiteral = int_value 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc18_49: Core.IntLiteral = int_value 2 [template = constants.%.6] // CHECK:STDOUT: %.loc18_50.2: %tuple.type.9 = tuple_literal (%.loc18_41, %F.call, %.loc18_49) -// CHECK:STDOUT: %.loc18_50.3: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_50.4: = bound_method %.loc18_41, %.loc18_50.3 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc18_50.1: init i32 = call %.loc18_50.4(%.loc18_41) [template = constants.%.31] -// CHECK:STDOUT: %.loc18_50.5: init i32 = converted %.loc18_41, %int.convert_checked.loc18_50.1 [template = constants.%.31] -// CHECK:STDOUT: %.loc18_50.6: ref i32 = tuple_access %v.var, element0 -// CHECK:STDOUT: %.loc18_50.7: init i32 = initialize_from %.loc18_50.5 to %.loc18_50.6 [template = constants.%.31] -// CHECK:STDOUT: %.loc18_50.8: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc18_50.9: = bound_method %.loc18_49, %.loc18_50.8 [template = constants.%.32] -// CHECK:STDOUT: %int.convert_checked.loc18_50.2: init i32 = call %.loc18_50.9(%.loc18_49) [template = constants.%.33] -// CHECK:STDOUT: %.loc18_50.10: init i32 = converted %.loc18_49, %int.convert_checked.loc18_50.2 [template = constants.%.33] -// CHECK:STDOUT: %.loc18_50.11: ref i32 = tuple_access %v.var, element2 -// CHECK:STDOUT: %.loc18_50.12: init i32 = initialize_from %.loc18_50.10 to %.loc18_50.11 [template = constants.%.33] -// CHECK:STDOUT: %.loc18_50.13: init %tuple.type.7 = tuple_init (%.loc18_50.7, %F.call, %.loc18_50.12) to %v.var -// CHECK:STDOUT: %.loc18_51: init %tuple.type.7 = converted %.loc18_50.2, %.loc18_50.13 +// CHECK:STDOUT: %.loc18_50.3: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_50.4: = bound_method %.loc18_41, %.loc18_50.3 [template = constants.%.27] +// CHECK:STDOUT: %.loc18_50.5: = specific_function %.loc18_50.4, @Convert.2(constants.%.1) [template = constants.%.28] +// CHECK:STDOUT: %int.convert_checked.loc18_50.1: init %i32 = call %.loc18_50.5(%.loc18_41) [template = constants.%.29] +// CHECK:STDOUT: %.loc18_50.6: init %i32 = converted %.loc18_41, %int.convert_checked.loc18_50.1 [template = constants.%.29] +// CHECK:STDOUT: %.loc18_50.7: ref %i32 = tuple_access %v.var, element0 +// CHECK:STDOUT: %.loc18_50.8: init %i32 = initialize_from %.loc18_50.6 to %.loc18_50.7 [template = constants.%.29] +// CHECK:STDOUT: %.loc18_50.9: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc18_50.10: = bound_method %.loc18_49, %.loc18_50.9 [template = constants.%.30] +// CHECK:STDOUT: %.loc18_50.11: = specific_function %.loc18_50.10, @Convert.2(constants.%.1) [template = constants.%.31] +// CHECK:STDOUT: %int.convert_checked.loc18_50.2: init %i32 = call %.loc18_50.11(%.loc18_49) [template = constants.%.32] +// CHECK:STDOUT: %.loc18_50.12: init %i32 = converted %.loc18_49, %int.convert_checked.loc18_50.2 [template = constants.%.32] +// CHECK:STDOUT: %.loc18_50.13: ref %i32 = tuple_access %v.var, element2 +// CHECK:STDOUT: %.loc18_50.14: init %i32 = initialize_from %.loc18_50.12 to %.loc18_50.13 [template = constants.%.32] +// CHECK:STDOUT: %.loc18_50.15: init %tuple.type.7 = tuple_init (%.loc18_50.8, %F.call, %.loc18_50.14) to %v.var +// CHECK:STDOUT: %.loc18_51: init %tuple.type.7 = converted %.loc18_50.2, %.loc18_50.15 // CHECK:STDOUT: assign %v.var, %.loc18_51 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/one_element.carbon b/toolchain/check/testdata/tuple/one_element.carbon index 536d5bb7bafc..70b40c35aef1 100644 --- a/toolchain/check/testdata/tuple/one_element.carbon +++ b/toolchain/check/testdata/tuple/one_element.carbon @@ -14,24 +14,27 @@ var y: (i32,) = x; // CHECK:STDOUT: --- one_element.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32) [template] -// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] +// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.25: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.26: = bound_method %.1, %Convert.15 [template] -// CHECK:STDOUT: %.27: i32 = int_value 4 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.27) [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.22: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.23: = bound_method %.2, %Convert.14 [template] +// CHECK:STDOUT: %.24: = specific_function %.23, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.25: %i32 = int_value 4 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.25) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -45,17 +48,19 @@ var y: (i32,) = x; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_13.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11) -// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_32.loc11 [template = i32] -// CHECK:STDOUT: %.loc11_13.3: type = converted %int.make_type_32.loc11, %.loc11_13.2 [template = i32] +// CHECK:STDOUT: %.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11) +// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.3: type = converted %int.make_type_signed.loc11, %.loc11_13.2 [template = constants.%i32] // CHECK:STDOUT: %.loc11_13.4: type = converted %.loc11_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var -// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_13.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc12) -// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_32.loc12 [template = i32] -// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_32.loc12, %.loc12_13.2 [template = i32] +// CHECK:STDOUT: %.loc12_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc12) +// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_signed.loc12, %.loc12_13.2 [template = constants.%i32] // CHECK:STDOUT: %.loc12_13.4: type = converted %.loc12_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %y.var: ref %tuple.type.2 = var y // CHECK:STDOUT: %y: ref %tuple.type.2 = bind_name y, %y.var @@ -63,18 +68,19 @@ var y: (i32,) = x; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_18: Core.IntLiteral = int_value 4 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_18: Core.IntLiteral = int_value 4 [template = constants.%.2] // CHECK:STDOUT: %.loc11_20.1: %tuple.type.3 = tuple_literal (%.loc11_18) -// CHECK:STDOUT: %.loc11_20.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_20.3: = bound_method %.loc11_18, %.loc11_20.2 [template = constants.%.26] -// CHECK:STDOUT: %int.convert_checked: init i32 = call %.loc11_20.3(%.loc11_18) [template = constants.%.27] -// CHECK:STDOUT: %.loc11_20.4: init i32 = converted %.loc11_18, %int.convert_checked [template = constants.%.27] -// CHECK:STDOUT: %.loc11_20.5: init %tuple.type.2 = tuple_init (%.loc11_20.4) to file.%x.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc11_21: init %tuple.type.2 = converted %.loc11_20.1, %.loc11_20.5 [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_20.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_20.3: = bound_method %.loc11_18, %.loc11_20.2 [template = constants.%.23] +// CHECK:STDOUT: %.loc11_20.4: = specific_function %.loc11_20.3, @Convert.2(constants.%.1) [template = constants.%.24] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc11_20.4(%.loc11_18) [template = constants.%.25] +// CHECK:STDOUT: %.loc11_20.5: init %i32 = converted %.loc11_18, %int.convert_checked [template = constants.%.25] +// CHECK:STDOUT: %.loc11_20.6: init %tuple.type.2 = tuple_init (%.loc11_20.5) to file.%x.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_21: init %tuple.type.2 = converted %.loc11_20.1, %.loc11_20.6 [template = constants.%tuple] // CHECK:STDOUT: assign file.%x.var, %.loc11_21 // CHECK:STDOUT: %x.ref: ref %tuple.type.2 = name_ref x, file.%x -// CHECK:STDOUT: %.loc12_17.1: ref i32 = tuple_access %x.ref, element0 -// CHECK:STDOUT: %.loc12_17.2: i32 = bind_value %.loc12_17.1 +// CHECK:STDOUT: %.loc12_17.1: ref %i32 = tuple_access %x.ref, element0 +// CHECK:STDOUT: %.loc12_17.2: %i32 = bind_value %.loc12_17.1 // CHECK:STDOUT: %.loc12_17.3: init %tuple.type.2 = tuple_init (%.loc12_17.2) to file.%y.var // CHECK:STDOUT: %.loc12_18: init %tuple.type.2 = converted %x.ref, %.loc12_17.3 // CHECK:STDOUT: assign file.%y.var, %.loc12_18 diff --git a/toolchain/check/testdata/tuple/two_elements.carbon b/toolchain/check/testdata/tuple/two_elements.carbon index 9e0cec189fa1..3c8e0698f381 100644 --- a/toolchain/check/testdata/tuple/two_elements.carbon +++ b/toolchain/check/testdata/tuple/two_elements.carbon @@ -17,27 +17,31 @@ var y: (i32, i32) = x; // CHECK:STDOUT: --- two_elements.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 102 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 102 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %.28: = bound_method %.2, %Convert.15 [template] -// CHECK:STDOUT: %.29: i32 = int_value 4 [template] -// CHECK:STDOUT: %.30: = bound_method %.3, %Convert.15 [template] -// CHECK:STDOUT: %.31: i32 = int_value 102 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.29, %.31) [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template] +// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] +// CHECK:STDOUT: %.24: = interface_witness (%Convert.14) [template] +// CHECK:STDOUT: %.25: = bound_method %.3, %Convert.14 [template] +// CHECK:STDOUT: %.26: = specific_function %.25, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.27: %i32 = int_value 4 [template] +// CHECK:STDOUT: %.28: = bound_method %.4, %Convert.14 [template] +// CHECK:STDOUT: %.29: = specific_function %.28, @Convert.2(%.1) [template] +// CHECK:STDOUT: %.30: %i32 = int_value 102 [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.27, %.30) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -53,39 +57,47 @@ var y: (i32, i32) = x; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] -// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_32.loc11_9, %.loc11_17.2 [template = i32] -// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] -// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_32.loc11_14, %.loc11_17.4 [template = i32] +// CHECK:STDOUT: %.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%.loc11_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14) +// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_9, %.loc11_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_signed.loc11_14, %.loc11_17.4 [template = constants.%i32] // CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %int.make_type_32.loc12_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc12_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_17.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc12_9, %int.make_type_32.loc12_14) -// CHECK:STDOUT: %.loc12_17.2: type = value_of_initializer %int.make_type_32.loc12_9 [template = i32] -// CHECK:STDOUT: %.loc12_17.3: type = converted %int.make_type_32.loc12_9, %.loc12_17.2 [template = i32] -// CHECK:STDOUT: %.loc12_17.4: type = value_of_initializer %int.make_type_32.loc12_14 [template = i32] -// CHECK:STDOUT: %.loc12_17.5: type = converted %int.make_type_32.loc12_14, %.loc12_17.4 [template = i32] +// CHECK:STDOUT: %.loc12_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_9: init type = call constants.%Int(%.loc12_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc12_14: init type = call constants.%Int(%.loc12_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc12_9, %int.make_type_signed.loc12_14) +// CHECK:STDOUT: %.loc12_17.2: type = value_of_initializer %int.make_type_signed.loc12_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_17.3: type = converted %int.make_type_signed.loc12_9, %.loc12_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_17.4: type = value_of_initializer %int.make_type_signed.loc12_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_17.5: type = converted %int.make_type_signed.loc12_14, %.loc12_17.4 [template = constants.%i32] // CHECK:STDOUT: %.loc12_17.6: type = converted %.loc12_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %int.make_type_32.loc14_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc14_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14_17.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc14_9, %int.make_type_32.loc14_14) -// CHECK:STDOUT: %.loc14_17.2: type = value_of_initializer %int.make_type_32.loc14_9 [template = i32] -// CHECK:STDOUT: %.loc14_17.3: type = converted %int.make_type_32.loc14_9, %.loc14_17.2 [template = i32] -// CHECK:STDOUT: %.loc14_17.4: type = value_of_initializer %int.make_type_32.loc14_14 [template = i32] -// CHECK:STDOUT: %.loc14_17.5: type = converted %int.make_type_32.loc14_14, %.loc14_17.4 [template = i32] +// CHECK:STDOUT: %.loc14_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_9: init type = call constants.%Int(%.loc14_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc14_14: init type = call constants.%Int(%.loc14_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_9, %int.make_type_signed.loc14_14) +// CHECK:STDOUT: %.loc14_17.2: type = value_of_initializer %int.make_type_signed.loc14_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_17.3: type = converted %int.make_type_signed.loc14_9, %.loc14_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_17.4: type = value_of_initializer %int.make_type_signed.loc14_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_17.5: type = converted %int.make_type_signed.loc14_14, %.loc14_17.4 [template = constants.%i32] // CHECK:STDOUT: %.loc14_17.6: type = converted %.loc14_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var -// CHECK:STDOUT: %int.make_type_32.loc15_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %int.make_type_32.loc15_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_17.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc15_9, %int.make_type_32.loc15_14) -// CHECK:STDOUT: %.loc15_17.2: type = value_of_initializer %int.make_type_32.loc15_9 [template = i32] -// CHECK:STDOUT: %.loc15_17.3: type = converted %int.make_type_32.loc15_9, %.loc15_17.2 [template = i32] -// CHECK:STDOUT: %.loc15_17.4: type = value_of_initializer %int.make_type_32.loc15_14 [template = i32] -// CHECK:STDOUT: %.loc15_17.5: type = converted %int.make_type_32.loc15_14, %.loc15_17.4 [template = i32] +// CHECK:STDOUT: %.loc15_9: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15_9: init type = call constants.%Int(%.loc15_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_14: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed.loc15_14: init type = call constants.%Int(%.loc15_14) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc15_9, %int.make_type_signed.loc15_14) +// CHECK:STDOUT: %.loc15_17.2: type = value_of_initializer %int.make_type_signed.loc15_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_17.3: type = converted %int.make_type_signed.loc15_9, %.loc15_17.2 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_17.4: type = value_of_initializer %int.make_type_signed.loc15_14 [template = constants.%i32] +// CHECK:STDOUT: %.loc15_17.5: type = converted %int.make_type_signed.loc15_14, %.loc15_17.4 [template = constants.%i32] // CHECK:STDOUT: %.loc15_17.6: type = converted %.loc15_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %y.var: ref %tuple.type.2 = var y // CHECK:STDOUT: %y: ref %tuple.type.2 = bind_name y, %y.var @@ -93,51 +105,55 @@ var y: (i32, i32) = x; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 4 [template = constants.%.2] -// CHECK:STDOUT: %.loc11_25: Core.IntLiteral = int_value 102 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 4 [template = constants.%.3] +// CHECK:STDOUT: %.loc11_25: Core.IntLiteral = int_value 102 [template = constants.%.4] // CHECK:STDOUT: %.loc11_28.1: %tuple.type.3 = tuple_literal (%.loc11_22, %.loc11_25) -// CHECK:STDOUT: %.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_28.3: = bound_method %.loc11_22, %.loc11_28.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init i32 = call %.loc11_28.3(%.loc11_22) [template = constants.%.29] -// CHECK:STDOUT: %.loc11_28.4: i32 = value_of_initializer %int.convert_checked.loc11_28.1 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_28.5: i32 = converted %.loc11_22, %.loc11_28.4 [template = constants.%.29] -// CHECK:STDOUT: %.loc11_28.6: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc11_28.7: = bound_method %.loc11_25, %.loc11_28.6 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init i32 = call %.loc11_28.7(%.loc11_25) [template = constants.%.31] -// CHECK:STDOUT: %.loc11_28.8: i32 = value_of_initializer %int.convert_checked.loc11_28.2 [template = constants.%.31] -// CHECK:STDOUT: %.loc11_28.9: i32 = converted %.loc11_25, %.loc11_28.8 [template = constants.%.31] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.loc11_28.5, %.loc11_28.9) [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_28.3: = bound_method %.loc11_22, %.loc11_28.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc11_28.4: = specific_function %.loc11_28.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %.loc11_28.4(%.loc11_22) [template = constants.%.27] +// CHECK:STDOUT: %.loc11_28.5: %i32 = value_of_initializer %int.convert_checked.loc11_28.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_28.6: %i32 = converted %.loc11_22, %.loc11_28.5 [template = constants.%.27] +// CHECK:STDOUT: %.loc11_28.7: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc11_28.8: = bound_method %.loc11_25, %.loc11_28.7 [template = constants.%.28] +// CHECK:STDOUT: %.loc11_28.9: = specific_function %.loc11_28.8, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %.loc11_28.9(%.loc11_25) [template = constants.%.30] +// CHECK:STDOUT: %.loc11_28.10: %i32 = value_of_initializer %int.convert_checked.loc11_28.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc11_28.11: %i32 = converted %.loc11_25, %.loc11_28.10 [template = constants.%.30] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.loc11_28.6, %.loc11_28.11) [template = constants.%tuple] // CHECK:STDOUT: %.loc11_29: %tuple.type.2 = converted %.loc11_28.1, %tuple [template = constants.%tuple] // CHECK:STDOUT: %v: %tuple.type.2 = bind_name v, %.loc11_29 // CHECK:STDOUT: %v.ref: %tuple.type.2 = name_ref v, %v // CHECK:STDOUT: %w: %tuple.type.2 = bind_name w, %v.ref -// CHECK:STDOUT: %.loc14_22: Core.IntLiteral = int_value 4 [template = constants.%.2] -// CHECK:STDOUT: %.loc14_25: Core.IntLiteral = int_value 102 [template = constants.%.3] +// CHECK:STDOUT: %.loc14_22: Core.IntLiteral = int_value 4 [template = constants.%.3] +// CHECK:STDOUT: %.loc14_25: Core.IntLiteral = int_value 102 [template = constants.%.4] // CHECK:STDOUT: %.loc14_28.1: %tuple.type.3 = tuple_literal (%.loc14_22, %.loc14_25) -// CHECK:STDOUT: %.loc14_28.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_28.3: = bound_method %.loc14_22, %.loc14_28.2 [template = constants.%.28] -// CHECK:STDOUT: %int.convert_checked.loc14_28.1: init i32 = call %.loc14_28.3(%.loc14_22) [template = constants.%.29] -// CHECK:STDOUT: %.loc14_28.4: init i32 = converted %.loc14_22, %int.convert_checked.loc14_28.1 [template = constants.%.29] -// CHECK:STDOUT: %.loc14_28.5: ref i32 = tuple_access file.%x.var, element0 -// CHECK:STDOUT: %.loc14_28.6: init i32 = initialize_from %.loc14_28.4 to %.loc14_28.5 [template = constants.%.29] -// CHECK:STDOUT: %.loc14_28.7: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15] -// CHECK:STDOUT: %.loc14_28.8: = bound_method %.loc14_25, %.loc14_28.7 [template = constants.%.30] -// CHECK:STDOUT: %int.convert_checked.loc14_28.2: init i32 = call %.loc14_28.8(%.loc14_25) [template = constants.%.31] -// CHECK:STDOUT: %.loc14_28.9: init i32 = converted %.loc14_25, %int.convert_checked.loc14_28.2 [template = constants.%.31] -// CHECK:STDOUT: %.loc14_28.10: ref i32 = tuple_access file.%x.var, element1 -// CHECK:STDOUT: %.loc14_28.11: init i32 = initialize_from %.loc14_28.9 to %.loc14_28.10 [template = constants.%.31] -// CHECK:STDOUT: %.loc14_28.12: init %tuple.type.2 = tuple_init (%.loc14_28.6, %.loc14_28.11) to file.%x.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc14_29: init %tuple.type.2 = converted %.loc14_28.1, %.loc14_28.12 [template = constants.%tuple] +// CHECK:STDOUT: %.loc14_28.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_28.3: = bound_method %.loc14_22, %.loc14_28.2 [template = constants.%.25] +// CHECK:STDOUT: %.loc14_28.4: = specific_function %.loc14_28.3, @Convert.2(constants.%.1) [template = constants.%.26] +// CHECK:STDOUT: %int.convert_checked.loc14_28.1: init %i32 = call %.loc14_28.4(%.loc14_22) [template = constants.%.27] +// CHECK:STDOUT: %.loc14_28.5: init %i32 = converted %.loc14_22, %int.convert_checked.loc14_28.1 [template = constants.%.27] +// CHECK:STDOUT: %.loc14_28.6: ref %i32 = tuple_access file.%x.var, element0 +// CHECK:STDOUT: %.loc14_28.7: init %i32 = initialize_from %.loc14_28.5 to %.loc14_28.6 [template = constants.%.27] +// CHECK:STDOUT: %.loc14_28.8: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %.loc14_28.9: = bound_method %.loc14_25, %.loc14_28.8 [template = constants.%.28] +// CHECK:STDOUT: %.loc14_28.10: = specific_function %.loc14_28.9, @Convert.2(constants.%.1) [template = constants.%.29] +// CHECK:STDOUT: %int.convert_checked.loc14_28.2: init %i32 = call %.loc14_28.10(%.loc14_25) [template = constants.%.30] +// CHECK:STDOUT: %.loc14_28.11: init %i32 = converted %.loc14_25, %int.convert_checked.loc14_28.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_28.12: ref %i32 = tuple_access file.%x.var, element1 +// CHECK:STDOUT: %.loc14_28.13: init %i32 = initialize_from %.loc14_28.11 to %.loc14_28.12 [template = constants.%.30] +// CHECK:STDOUT: %.loc14_28.14: init %tuple.type.2 = tuple_init (%.loc14_28.7, %.loc14_28.13) to file.%x.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc14_29: init %tuple.type.2 = converted %.loc14_28.1, %.loc14_28.14 [template = constants.%tuple] // CHECK:STDOUT: assign file.%x.var, %.loc14_29 // CHECK:STDOUT: %x.ref: ref %tuple.type.2 = name_ref x, file.%x -// CHECK:STDOUT: %.loc15_21.1: ref i32 = tuple_access %x.ref, element0 -// CHECK:STDOUT: %.loc15_21.2: i32 = bind_value %.loc15_21.1 -// CHECK:STDOUT: %.loc15_21.3: ref i32 = tuple_access file.%y.var, element0 -// CHECK:STDOUT: %.loc15_21.4: init i32 = initialize_from %.loc15_21.2 to %.loc15_21.3 -// CHECK:STDOUT: %.loc15_21.5: ref i32 = tuple_access %x.ref, element1 -// CHECK:STDOUT: %.loc15_21.6: i32 = bind_value %.loc15_21.5 -// CHECK:STDOUT: %.loc15_21.7: ref i32 = tuple_access file.%y.var, element1 -// CHECK:STDOUT: %.loc15_21.8: init i32 = initialize_from %.loc15_21.6 to %.loc15_21.7 +// CHECK:STDOUT: %.loc15_21.1: ref %i32 = tuple_access %x.ref, element0 +// CHECK:STDOUT: %.loc15_21.2: %i32 = bind_value %.loc15_21.1 +// CHECK:STDOUT: %.loc15_21.3: ref %i32 = tuple_access file.%y.var, element0 +// CHECK:STDOUT: %.loc15_21.4: init %i32 = initialize_from %.loc15_21.2 to %.loc15_21.3 +// CHECK:STDOUT: %.loc15_21.5: ref %i32 = tuple_access %x.ref, element1 +// CHECK:STDOUT: %.loc15_21.6: %i32 = bind_value %.loc15_21.5 +// CHECK:STDOUT: %.loc15_21.7: ref %i32 = tuple_access file.%y.var, element1 +// CHECK:STDOUT: %.loc15_21.8: init %i32 = initialize_from %.loc15_21.6 to %.loc15_21.7 // CHECK:STDOUT: %.loc15_21.9: init %tuple.type.2 = tuple_init (%.loc15_21.4, %.loc15_21.8) to file.%y.var // CHECK:STDOUT: %.loc15_22: init %tuple.type.2 = converted %x.ref, %.loc15_21.9 // CHECK:STDOUT: assign file.%y.var, %.loc15_22 diff --git a/toolchain/check/testdata/where_expr/constraints.carbon b/toolchain/check/testdata/where_expr/constraints.carbon index 58c0c308147a..daf60530c195 100644 --- a/toolchain/check/testdata/where_expr/constraints.carbon +++ b/toolchain/check/testdata/where_expr/constraints.carbon @@ -700,8 +700,10 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %type_where: type = facet_type [template] // CHECK:STDOUT: %U: %type_where = bind_symbolic_name U, 0 [symbolic] // CHECK:STDOUT: %U.patt: %type_where = symbolic_binding_pattern U, 0 [symbolic] @@ -711,7 +713,7 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -729,9 +731,10 @@ let B: type where .Self impls A = D; // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self] // CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_51.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_51.2: type = converted %int.make_type_32, %.loc8_51.1 [template = i32] +// CHECK:STDOUT: %.loc8_51.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_51.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_51.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_51.3: type = converted %int.make_type_signed, %.loc8_51.2 [template = constants.%i32] // CHECK:STDOUT: %.loc8_33: type = where_expr %.Self [template = constants.%type_where] { // CHECK:STDOUT: requirement_impls %.Self.ref, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/where_expr/fail_not_facet.carbon b/toolchain/check/testdata/where_expr/fail_not_facet.carbon index dc803f0173e7..b5c8802b4378 100644 --- a/toolchain/check/testdata/where_expr/fail_not_facet.carbon +++ b/toolchain/check/testdata/where_expr/fail_not_facet.carbon @@ -40,8 +40,10 @@ var v: e where .x = 3; // CHECK:STDOUT: --- fail_left_where_not_facet.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.1 [template] // CHECK:STDOUT: %.Self: = bind_symbolic_name .Self, 0 [symbolic] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] @@ -53,7 +55,7 @@ var v: e where .x = 3; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -70,9 +72,10 @@ var v: e where .x = 3; // CHECK:STDOUT: %T.patt.loc8_6.1: = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_6.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: = value_param_pattern %T.patt.loc8_6.1, runtime_param [symbolic = %T.patt.loc8_6.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc8_10.2: type = converted %int.make_type_32, %.loc8_10.1 [template = i32] +// CHECK:STDOUT: %.loc8_10.1: Core.IntLiteral = int_value 32 [template = constants.%.1] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_10.1) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc8_10.3: type = converted %int.make_type_signed, %.loc8_10.2 [template = constants.%i32] // CHECK:STDOUT: %.Self: = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self] // CHECK:STDOUT: %.Self.ref: = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] diff --git a/toolchain/check/testdata/where_expr/non_generic.carbon b/toolchain/check/testdata/where_expr/non_generic.carbon index 3652837c8771..c8d932e5375e 100644 --- a/toolchain/check/testdata/where_expr/non_generic.carbon +++ b/toolchain/check/testdata/where_expr/non_generic.carbon @@ -21,8 +21,10 @@ fn NotGenericF(U: I where .T == i32) {} // CHECK:STDOUT: %.1: type = assoc_entity_type %I.type.1, type [template] // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, @I.%T [template] // CHECK:STDOUT: %.Self: %I.type.1 = bind_symbolic_name .Self, 0 [symbolic] -// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %.3 [template] // CHECK:STDOUT: %I.type.2: type = facet_type <@I where TODO> [template] // CHECK:STDOUT: %NotGenericF.type: type = fn_type @NotGenericF [template] // CHECK:STDOUT: %NotGenericF: %NotGenericF.type = struct_value () [template] @@ -30,7 +32,7 @@ fn NotGenericF(U: I where .T == i32) {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -52,9 +54,10 @@ fn NotGenericF(U: I where .T == i32) {} // CHECK:STDOUT: %.Self: %I.type.1 = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self] // CHECK:STDOUT: %.Self.ref: %I.type.1 = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %T.ref: %.1 = name_ref T, @I.%.loc11 [template = constants.%.2] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc14: type = where_expr %.Self [template = constants.%I.type.2] { -// CHECK:STDOUT: requirement_equivalent %T.ref, %int.make_type_32 +// CHECK:STDOUT: %.loc14_33: Core.IntLiteral = int_value 32 [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc14_33) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_21: type = where_expr %.Self [template = constants.%I.type.2] { +// CHECK:STDOUT: requirement_equivalent %T.ref, %int.make_type_signed // CHECK:STDOUT: } // CHECK:STDOUT: %U.param: %I.type.2 = value_param runtime_param0 // CHECK:STDOUT: %U: %I.type.2 = bind_name U, %U.param diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index e7e8fd87f435..835a213b14f6 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -480,8 +480,6 @@ static auto BuildTypeForInst(FileContext& context, SemIR::BuiltinInst inst) return context.GetTypeType(); case SemIR::BuiltinInstKind::FloatType: return llvm::Type::getDoubleTy(context.llvm_context()); - case SemIR::BuiltinInstKind::IntType: - return llvm::Type::getInt32Ty(context.llvm_context()); case SemIR::BuiltinInstKind::BoolType: // TODO: We may want to have different representations for `bool` // storage diff --git a/toolchain/lower/handle_call.cpp b/toolchain/lower/handle_call.cpp index 00ccc0eddf1a..e738becf055e 100644 --- a/toolchain/lower/handle_call.cpp +++ b/toolchain/lower/handle_call.cpp @@ -96,7 +96,6 @@ static auto HandleBuiltinCall(FunctionContext& context, SemIR::InstId inst_id, case SemIR::BuiltinFunctionKind::BoolMakeType: case SemIR::BuiltinFunctionKind::FloatMakeType: case SemIR::BuiltinFunctionKind::IntLiteralMakeType: - case SemIR::BuiltinFunctionKind::IntMakeType32: case SemIR::BuiltinFunctionKind::IntMakeTypeSigned: case SemIR::BuiltinFunctionKind::IntMakeTypeUnsigned: context.SetLocal(inst_id, context.GetTypeAsValue()); diff --git a/toolchain/lower/mangler.cpp b/toolchain/lower/mangler.cpp index e157ef005808..a382f501d39a 100644 --- a/toolchain/lower/mangler.cpp +++ b/toolchain/lower/mangler.cpp @@ -6,6 +6,7 @@ #include "toolchain/base/kind_switch.h" #include "toolchain/sem_ir/entry_point.h" +#include "toolchain/sem_ir/ids.h" namespace Carbon::Lower { @@ -68,6 +69,15 @@ auto Mangler::MangleInverseQualifiedNameScope(llvm::raw_ostream& os, os << builtin_inst.builtin_inst_kind.label(); break; } + case CARBON_KIND(SemIR::IntType int_type): { + os << (int_type.int_kind == SemIR::IntKind::Signed ? "i" : "u") + << sem_ir().ints().Get( + sem_ir() + .insts() + .GetAs(int_type.bit_width_id) + .int_id); + break; + } default: CARBON_FATAL("Attempting to mangle unsupported SemIR."); break; diff --git a/toolchain/lower/testdata/array/array_in_place.carbon b/toolchain/lower/testdata/array/array_in_place.carbon index f446adac9069..503cf998ed3d 100644 --- a/toolchain/lower/testdata/array/array_in_place.carbon +++ b/toolchain/lower/testdata/array/array_in_place.carbon @@ -22,9 +22,9 @@ fn G() { // CHECK:STDOUT: define void @_CG.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %v.var = alloca [2 x { i32, i32, i32 }], align 8, !dbg !7 -// CHECK:STDOUT: %.loc14_42.2.array.index = getelementptr inbounds [2 x { i32, i32, i32 }], ptr %v.var, i32 0, i32 0, !dbg !8 +// CHECK:STDOUT: %.loc14_42.2.array.index = getelementptr inbounds [2 x { i32, i32, i32 }], ptr %v.var, i32 0, {} zeroinitializer, !dbg !8 // CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_42.2.array.index), !dbg !9 -// CHECK:STDOUT: %.loc14_42.5.array.index = getelementptr inbounds [2 x { i32, i32, i32 }], ptr %v.var, i32 0, i32 1, !dbg !8 +// CHECK:STDOUT: %.loc14_42.5.array.index = getelementptr inbounds [2 x { i32, i32, i32 }], ptr %v.var, i32 0, {} zeroinitializer, !dbg !8 // CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_42.5.array.index), !dbg !10 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/array/assign_return_value.carbon b/toolchain/lower/testdata/array/assign_return_value.carbon index 9ad452361c9d..3c7ec88d09c4 100644 --- a/toolchain/lower/testdata/array/assign_return_value.carbon +++ b/toolchain/lower/testdata/array/assign_return_value.carbon @@ -21,8 +21,8 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: define void @_CF.Main(ptr sret({ i32, i32 }) %return) !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_38.5.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !7 -// CHECK:STDOUT: %.loc11_38.10.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !7 +// CHECK:STDOUT: %.loc11_38.6.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !7 +// CHECK:STDOUT: %.loc11_38.12.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !7 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %return, ptr align 4 @tuple.loc11_39, i64 8, i1 false), !dbg !8 // CHECK:STDOUT: ret void, !dbg !8 // CHECK:STDOUT: } @@ -34,11 +34,11 @@ fn Run() { // CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_22.1.temp), !dbg !11 // CHECK:STDOUT: %.loc14_22.3.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc14_22.1.temp, i32 0, i32 0, !dbg !11 // CHECK:STDOUT: %.loc14_22.4 = load i32, ptr %.loc14_22.3.tuple.elem, align 4, !dbg !11 -// CHECK:STDOUT: %.loc14_22.6.array.index = getelementptr inbounds [2 x i32], ptr %t.var, i32 0, i32 0, !dbg !11 +// CHECK:STDOUT: %.loc14_22.6.array.index = getelementptr inbounds [2 x i32], ptr %t.var, i32 0, {} zeroinitializer, !dbg !11 // CHECK:STDOUT: store i32 %.loc14_22.4, ptr %.loc14_22.6.array.index, align 4, !dbg !11 // CHECK:STDOUT: %.loc14_22.8.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc14_22.1.temp, i32 0, i32 1, !dbg !11 // CHECK:STDOUT: %.loc14_22.9 = load i32, ptr %.loc14_22.8.tuple.elem, align 4, !dbg !11 -// CHECK:STDOUT: %.loc14_22.11.array.index = getelementptr inbounds [2 x i32], ptr %t.var, i32 0, i32 1, !dbg !11 +// CHECK:STDOUT: %.loc14_22.11.array.index = getelementptr inbounds [2 x i32], ptr %t.var, i32 0, {} zeroinitializer, !dbg !11 // CHECK:STDOUT: store i32 %.loc14_22.9, ptr %.loc14_22.11.array.index, align 4, !dbg !11 // CHECK:STDOUT: ret void, !dbg !12 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/array/base.carbon b/toolchain/lower/testdata/array/base.carbon index df8ff6db1c71..505d88ce3110 100644 --- a/toolchain/lower/testdata/array/base.carbon +++ b/toolchain/lower/testdata/array/base.carbon @@ -27,36 +27,36 @@ fn Run() { // CHECK:STDOUT: define void @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca [1 x i32], align 4, !dbg !7 -// CHECK:STDOUT: %.loc12_24.6.array.index = getelementptr inbounds [1 x i32], ptr %a.var, i32 0, i32 0, !dbg !8 +// CHECK:STDOUT: %.loc12_24.7.array.index = getelementptr inbounds [1 x i32], ptr %a.var, i32 0, {} zeroinitializer, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %a.var, ptr align 4 @array.1.loc12_25, i64 4, i1 false), !dbg !9 // CHECK:STDOUT: %b.var = alloca [2 x double], align 8, !dbg !10 -// CHECK:STDOUT: %.loc13_32.3.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: %.loc13_32.6.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, i32 1, !dbg !11 +// CHECK:STDOUT: %.loc13_32.3.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, {} zeroinitializer, !dbg !11 +// CHECK:STDOUT: %.loc13_32.6.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, {} zeroinitializer, !dbg !11 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %b.var, ptr align 8 @array.2.loc13_33, i64 16, i1 false), !dbg !12 // CHECK:STDOUT: %c.var = alloca [5 x {}], align 8, !dbg !13 -// CHECK:STDOUT: %.loc14_40.3.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i32 0, !dbg !14 -// CHECK:STDOUT: %.loc14_40.6.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i32 1, !dbg !14 -// CHECK:STDOUT: %.loc14_40.9.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i32 2, !dbg !14 -// CHECK:STDOUT: %.loc14_40.12.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i32 3, !dbg !14 -// CHECK:STDOUT: %.loc14_40.15.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i32 4, !dbg !14 +// CHECK:STDOUT: %.loc14_40.3.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, {} zeroinitializer, !dbg !14 +// CHECK:STDOUT: %.loc14_40.6.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, {} zeroinitializer, !dbg !14 +// CHECK:STDOUT: %.loc14_40.9.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, {} zeroinitializer, !dbg !14 +// CHECK:STDOUT: %.loc14_40.12.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, {} zeroinitializer, !dbg !14 +// CHECK:STDOUT: %.loc14_40.15.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, {} zeroinitializer, !dbg !14 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @array.3.loc14_41, i64 0, i1 false), !dbg !15 // CHECK:STDOUT: %d.var = alloca { i32, i32, i32 }, align 8, !dbg !16 -// CHECK:STDOUT: %.loc15_36.5.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 0, !dbg !17 -// CHECK:STDOUT: %.loc15_36.10.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 1, !dbg !17 -// CHECK:STDOUT: %.loc15_36.15.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 2, !dbg !17 +// CHECK:STDOUT: %.loc15_36.6.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 0, !dbg !17 +// CHECK:STDOUT: %.loc15_36.12.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 1, !dbg !17 +// CHECK:STDOUT: %.loc15_36.18.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 2, !dbg !17 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %d.var, ptr align 4 @tuple.loc15_37, i64 12, i1 false), !dbg !18 // CHECK:STDOUT: %e.var = alloca [3 x i32], align 4, !dbg !19 // CHECK:STDOUT: %.loc16_21.1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 0, !dbg !20 // CHECK:STDOUT: %.loc16_21.2 = load i32, ptr %.loc16_21.1.tuple.elem, align 4, !dbg !20 -// CHECK:STDOUT: %.loc16_21.4.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i32 0, !dbg !20 +// CHECK:STDOUT: %.loc16_21.4.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, {} zeroinitializer, !dbg !20 // CHECK:STDOUT: store i32 %.loc16_21.2, ptr %.loc16_21.4.array.index, align 4, !dbg !20 // CHECK:STDOUT: %.loc16_21.6.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 1, !dbg !20 // CHECK:STDOUT: %.loc16_21.7 = load i32, ptr %.loc16_21.6.tuple.elem, align 4, !dbg !20 -// CHECK:STDOUT: %.loc16_21.9.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i32 1, !dbg !20 +// CHECK:STDOUT: %.loc16_21.9.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, {} zeroinitializer, !dbg !20 // CHECK:STDOUT: store i32 %.loc16_21.7, ptr %.loc16_21.9.array.index, align 4, !dbg !20 // CHECK:STDOUT: %.loc16_21.11.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 2, !dbg !20 // CHECK:STDOUT: %.loc16_21.12 = load i32, ptr %.loc16_21.11.tuple.elem, align 4, !dbg !20 -// CHECK:STDOUT: %.loc16_21.14.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i32 2, !dbg !20 +// CHECK:STDOUT: %.loc16_21.14.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, {} zeroinitializer, !dbg !20 // CHECK:STDOUT: store i32 %.loc16_21.12, ptr %.loc16_21.14.array.index, align 4, !dbg !20 // CHECK:STDOUT: ret void, !dbg !21 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/array/function_param.carbon b/toolchain/lower/testdata/array/function_param.carbon index 470d300a743c..4422516eaef1 100644 --- a/toolchain/lower/testdata/array/function_param.carbon +++ b/toolchain/lower/testdata/array/function_param.carbon @@ -19,7 +19,7 @@ fn G() -> i32 { // CHECK:STDOUT: ; ModuleID = 'function_param.carbon' // CHECK:STDOUT: source_filename = "function_param.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @array.loc16_20.22 = internal constant [3 x i32] [i32 1, i32 2, i32 3] +// CHECK:STDOUT: @array.loc16_20.25 = internal constant [3 x i32] [i32 1, i32 2, i32 3] // CHECK:STDOUT: // CHECK:STDOUT: define i32 @_CF.Main(ptr %arr, i32 %i) !dbg !4 { // CHECK:STDOUT: entry: @@ -30,12 +30,12 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: define i32 @_CG.Main() !dbg !9 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc16_20.5.temp = alloca [3 x i32], align 4, !dbg !10 -// CHECK:STDOUT: %.loc16_20.7.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.5.temp, i32 0, i32 0, !dbg !10 -// CHECK:STDOUT: %.loc16_20.13.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.5.temp, i32 0, i32 1, !dbg !10 -// CHECK:STDOUT: %.loc16_20.19.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.5.temp, i32 0, i32 2, !dbg !10 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %.loc16_20.5.temp, ptr align 4 @array.loc16_20.22, i64 12, i1 false), !dbg !10 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main(ptr %.loc16_20.5.temp, i32 1), !dbg !11 +// CHECK:STDOUT: %.loc16_20.6.temp = alloca [3 x i32], align 4, !dbg !10 +// CHECK:STDOUT: %.loc16_20.8.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.6.temp, i32 0, {} zeroinitializer, !dbg !10 +// CHECK:STDOUT: %.loc16_20.15.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.6.temp, i32 0, {} zeroinitializer, !dbg !10 +// CHECK:STDOUT: %.loc16_20.22.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.6.temp, i32 0, {} zeroinitializer, !dbg !10 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %.loc16_20.6.temp, ptr align 4 @array.loc16_20.25, i64 12, i1 false), !dbg !10 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main(ptr %.loc16_20.6.temp, i32 1), !dbg !11 // CHECK:STDOUT: ret i32 %F.call, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/basics/numeric_literals.carbon b/toolchain/lower/testdata/basics/numeric_literals.carbon index 3de52d8217c9..0ce38adf3681 100644 --- a/toolchain/lower/testdata/basics/numeric_literals.carbon +++ b/toolchain/lower/testdata/basics/numeric_literals.carbon @@ -36,18 +36,18 @@ fn F() { // CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %ints.var = alloca [4 x i32], align 4, !dbg !7 -// CHECK:STDOUT: %.loc19_3.6.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, i32 0, !dbg !8 -// CHECK:STDOUT: %.loc19_3.12.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, i32 1, !dbg !8 -// CHECK:STDOUT: %.loc19_3.18.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, i32 2, !dbg !8 -// CHECK:STDOUT: %.loc19_3.24.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, i32 3, !dbg !8 +// CHECK:STDOUT: %.loc19_3.7.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, {} zeroinitializer, !dbg !8 +// CHECK:STDOUT: %.loc19_3.14.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, {} zeroinitializer, !dbg !8 +// CHECK:STDOUT: %.loc19_3.21.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, {} zeroinitializer, !dbg !8 +// CHECK:STDOUT: %.loc19_3.28.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, {} zeroinitializer, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %ints.var, ptr align 4 @array.1.loc19_4, i64 16, i1 false), !dbg !9 // CHECK:STDOUT: %floats.var = alloca [6 x double], align 8, !dbg !10 -// CHECK:STDOUT: %.loc27_3.3.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: %.loc27_3.6.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i32 1, !dbg !11 -// CHECK:STDOUT: %.loc27_3.9.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i32 2, !dbg !11 -// CHECK:STDOUT: %.loc27_3.12.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i32 3, !dbg !11 -// CHECK:STDOUT: %.loc27_3.15.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i32 4, !dbg !11 -// CHECK:STDOUT: %.loc27_3.18.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i32 5, !dbg !11 +// CHECK:STDOUT: %.loc27_3.3.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, {} zeroinitializer, !dbg !11 +// CHECK:STDOUT: %.loc27_3.6.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, {} zeroinitializer, !dbg !11 +// CHECK:STDOUT: %.loc27_3.9.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, {} zeroinitializer, !dbg !11 +// CHECK:STDOUT: %.loc27_3.12.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, {} zeroinitializer, !dbg !11 +// CHECK:STDOUT: %.loc27_3.15.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, {} zeroinitializer, !dbg !11 +// CHECK:STDOUT: %.loc27_3.18.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, {} zeroinitializer, !dbg !11 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %floats.var, ptr align 8 @array.2.loc27_4, i64 48, i1 false), !dbg !12 // CHECK:STDOUT: ret void, !dbg !13 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/builtins/types.carbon b/toolchain/lower/testdata/builtins/types.carbon index 25b716c6c55a..42c2b0f05c94 100644 --- a/toolchain/lower/testdata/builtins/types.carbon +++ b/toolchain/lower/testdata/builtins/types.carbon @@ -8,12 +8,13 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/builtins/types.carbon -fn Int() -> type = "int.make_type_32"; -fn Float(size: i32) -> type = "float.make_type"; +fn IntLiteral() -> type = "int_literal.make_type"; +fn Int(size: IntLiteral()) -> type = "int.make_type_signed"; +fn Float(size: IntLiteral()) -> type = "float.make_type"; fn Bool() -> type = "bool.make_type"; fn F() { - var i: Int() = 0; + var i: Int(32) = 0; var f: Float(64) = 0.0; var b: Bool() = false; } @@ -39,13 +40,13 @@ fn F() { // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !3 = !DIFile(filename: "types.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} -// CHECK:STDOUT: !7 = !DILocation(line: 16, column: 7, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 16, column: 3, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 17, column: 7, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 17, column: 3, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 18, column: 7, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 18, column: 3, scope: !4) -// CHECK:STDOUT: !13 = !DILocation(line: 15, column: 1, scope: !4) +// CHECK:STDOUT: !7 = !DILocation(line: 17, column: 7, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 17, column: 3, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 18, column: 7, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 18, column: 3, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 19, column: 7, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 19, column: 3, scope: !4) +// CHECK:STDOUT: !13 = !DILocation(line: 16, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/class/adapt.carbon b/toolchain/lower/testdata/class/adapt.carbon index d3304fd1abe4..bbe30843f8c5 100644 --- a/toolchain/lower/testdata/class/adapt.carbon +++ b/toolchain/lower/testdata/class/adapt.carbon @@ -58,8 +58,8 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: // CHECK:STDOUT: define void @_CMake.PairOfInts.Main(ptr sret({ i32, i32 }) %return) !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_27.5.a = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !7 -// CHECK:STDOUT: %.loc9_27.10.b = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !7 +// CHECK:STDOUT: %.loc9_27.6.a = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !7 +// CHECK:STDOUT: %.loc9_27.12.b = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !7 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %return, ptr align 4 @struct.loc9_28, i64 8, i1 false), !dbg !8 // CHECK:STDOUT: ret void, !dbg !8 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/class/base.carbon b/toolchain/lower/testdata/class/base.carbon index f3bd7591640e..74f4f2cd405b 100644 --- a/toolchain/lower/testdata/class/base.carbon +++ b/toolchain/lower/testdata/class/base.carbon @@ -38,8 +38,8 @@ fn Convert(p: Derived*) -> Base* { // CHECK:STDOUT: define void @_CMake.Main(ptr sret({ { i32 }, i32 }) %return) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc22_35.2.base = getelementptr inbounds nuw { { i32 }, i32 }, ptr %return, i32 0, i32 0, !dbg !7 -// CHECK:STDOUT: %.loc22_26.5.b = getelementptr inbounds nuw { i32 }, ptr %.loc22_35.2.base, i32 0, i32 0, !dbg !8 -// CHECK:STDOUT: %.loc22_35.7.d = getelementptr inbounds nuw { { i32 }, i32 }, ptr %return, i32 0, i32 1, !dbg !7 +// CHECK:STDOUT: %.loc22_26.6.b = getelementptr inbounds nuw { i32 }, ptr %.loc22_35.2.base, i32 0, i32 0, !dbg !8 +// CHECK:STDOUT: %.loc22_35.8.d = getelementptr inbounds nuw { { i32 }, i32 }, ptr %return, i32 0, i32 1, !dbg !7 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %return, ptr align 4 @struct.2.loc22_36, i64 8, i1 false), !dbg !9 // CHECK:STDOUT: ret void, !dbg !9 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/class/convert.carbon b/toolchain/lower/testdata/class/convert.carbon index 4f8d3ded2915..24cb224ffe58 100644 --- a/toolchain/lower/testdata/class/convert.carbon +++ b/toolchain/lower/testdata/class/convert.carbon @@ -43,7 +43,7 @@ fn DoIt() { // CHECK:STDOUT: define void @_CDoIt.Main() !dbg !11 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %w.var = alloca { i32 }, align 8, !dbg !12 -// CHECK:STDOUT: %.loc22_31.5.n = getelementptr inbounds nuw { i32 }, ptr %w.var, i32 0, i32 0, !dbg !13 +// CHECK:STDOUT: %.loc22_31.6.n = getelementptr inbounds nuw { i32 }, ptr %w.var, i32 0, i32 0, !dbg !13 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %w.var, ptr align 4 @struct.loc22_32, i64 4, i1 false), !dbg !14 // CHECK:STDOUT: %Convert.call = call i32 @"_CConvert.IntWrapper.Main:ImplicitAs.Core"(ptr %w.var), !dbg !15 // CHECK:STDOUT: call void @_CConsume.Main(i32 %Convert.call), !dbg !16 diff --git a/toolchain/lower/testdata/function/call/struct_param.carbon b/toolchain/lower/testdata/function/call/struct_param.carbon index e01f4e979b5e..60958663448f 100644 --- a/toolchain/lower/testdata/function/call/struct_param.carbon +++ b/toolchain/lower/testdata/function/call/struct_param.carbon @@ -17,7 +17,7 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'struct_param.carbon' // CHECK:STDOUT: source_filename = "struct_param.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @struct.3.loc14_34.10 = internal constant { i32, i32 } { i32 2, i32 3 } +// CHECK:STDOUT: @struct.3.loc14_34.12 = internal constant { i32, i32 } { i32 2, i32 3 } // CHECK:STDOUT: // CHECK:STDOUT: define void @_CF.Main({ i32 } %b, ptr %c) !dbg !4 { // CHECK:STDOUT: entry: @@ -26,7 +26,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main({ i32 } { i32 1 }, ptr @struct.3.loc14_34.10), !dbg !9 +// CHECK:STDOUT: call void @_CF.Main({ i32 } { i32 1 }, ptr @struct.3.loc14_34.12), !dbg !9 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/tuple_param.carbon b/toolchain/lower/testdata/function/call/tuple_param.carbon index 876c97ec6633..d2e04182f202 100644 --- a/toolchain/lower/testdata/function/call/tuple_param.carbon +++ b/toolchain/lower/testdata/function/call/tuple_param.carbon @@ -17,7 +17,7 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'tuple_param.carbon' // CHECK:STDOUT: source_filename = "tuple_param.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @tuple.2.loc14_20.10 = internal constant { i32, i32 } { i32 2, i32 3 } +// CHECK:STDOUT: @tuple.2.loc14_20.12 = internal constant { i32, i32 } { i32 2, i32 3 } // CHECK:STDOUT: // CHECK:STDOUT: define void @_CF.Main({ i32 } %b, ptr %c) !dbg !4 { // CHECK:STDOUT: entry: @@ -26,7 +26,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main({ i32 } { i32 1 }, ptr @tuple.2.loc14_20.10), !dbg !9 +// CHECK:STDOUT: call void @_CF.Main({ i32 } { i32 1 }, ptr @tuple.2.loc14_20.12), !dbg !9 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon b/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon index de0d0e886e28..fc426edd5b53 100644 --- a/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon +++ b/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon @@ -19,7 +19,7 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'tuple_param_with_return_slot.carbon' // CHECK:STDOUT: source_filename = "tuple_param_with_return_slot.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @tuple.2.loc16_20.10 = internal constant { i32, i32 } { i32 2, i32 3 } +// CHECK:STDOUT: @tuple.2.loc16_20.12 = internal constant { i32, i32 } { i32 2, i32 3 } // CHECK:STDOUT: // CHECK:STDOUT: define void @_CF.Main(ptr sret({ i32, i32, i32 }) %return, { i32 } %b, ptr %c) !dbg !4 { // CHECK:STDOUT: entry: @@ -40,7 +40,7 @@ fn Main() { // CHECK:STDOUT: define void @_CMain.Main() !dbg !12 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc16_4.1.temp = alloca { i32, i32, i32 }, align 8, !dbg !13 -// CHECK:STDOUT: call void @_CF.Main(ptr %.loc16_4.1.temp, { i32 } { i32 1 }, ptr @tuple.2.loc16_20.10), !dbg !13 +// CHECK:STDOUT: call void @_CF.Main(ptr %.loc16_4.1.temp, { i32 } { i32 1 }, ptr @tuple.2.loc16_20.12), !dbg !13 // CHECK:STDOUT: ret void, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call.carbon b/toolchain/lower/testdata/function/generic/call.carbon index 55e39e09c897..a4f4a12431d8 100644 --- a/toolchain/lower/testdata/function/generic/call.carbon +++ b/toolchain/lower/testdata/function/generic/call.carbon @@ -41,24 +41,24 @@ fn G() { // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %d.var, ptr align 1 @struct.2.loc19_16, i64 0, i1 false), !dbg !10 // CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !11 // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !12 -// CHECK:STDOUT: call void @_CF.Main.45(ptr %c.var), !dbg !13 -// CHECK:STDOUT: call void @_CF.Main.46(ptr %d.var), !dbg !14 +// CHECK:STDOUT: call void @_CF.Main.46(ptr %c.var), !dbg !13 +// CHECK:STDOUT: call void @_CF.Main.47(ptr %d.var), !dbg !14 // CHECK:STDOUT: %.loc24_5 = load i32, ptr %n.var, align 4, !dbg !15 -// CHECK:STDOUT: call void @_CF.Main.47(i32 %.loc24_5), !dbg !16 -// CHECK:STDOUT: call void @_CF.Main.48(%type zeroinitializer), !dbg !17 +// CHECK:STDOUT: call void @_CF.Main.48(i32 %.loc24_5), !dbg !16 +// CHECK:STDOUT: call void @_CF.Main.49(%type zeroinitializer), !dbg !17 // CHECK:STDOUT: ret void, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: -// CHECK:STDOUT: declare void @_CF.Main.45(ptr) -// CHECK:STDOUT: // CHECK:STDOUT: declare void @_CF.Main.46(ptr) // CHECK:STDOUT: -// CHECK:STDOUT: declare void @_CF.Main.47(i32) +// CHECK:STDOUT: declare void @_CF.Main.47(ptr) // CHECK:STDOUT: -// CHECK:STDOUT: declare void @_CF.Main.48(%type) +// CHECK:STDOUT: declare void @_CF.Main.48(i32) +// CHECK:STDOUT: +// CHECK:STDOUT: declare void @_CF.Main.49(%type) // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 1, 0 } diff --git a/toolchain/lower/testdata/function/generic/call_method.carbon b/toolchain/lower/testdata/function/generic/call_method.carbon index 890add72e408..a40ad538a96a 100644 --- a/toolchain/lower/testdata/function/generic/call_method.carbon +++ b/toolchain/lower/testdata/function/generic/call_method.carbon @@ -32,14 +32,14 @@ fn CallF() -> i32 { // CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !9 // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !10 // CHECK:STDOUT: %.loc20_14 = load i32, ptr %n.var, align 4, !dbg !11 -// CHECK:STDOUT: %F.call = call i32 @_CF.C.Main.45(ptr %c.var, i32 %.loc20_14), !dbg !12 +// CHECK:STDOUT: %F.call = call i32 @_CF.C.Main.46(ptr %c.var, i32 %.loc20_14), !dbg !12 // CHECK:STDOUT: ret i32 %F.call, !dbg !13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: -// CHECK:STDOUT: declare i32 @_CF.C.Main.45(ptr, i32) +// CHECK:STDOUT: declare i32 @_CF.C.Main.46(ptr, i32) // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/index/array_element_access.carbon b/toolchain/lower/testdata/index/array_element_access.carbon index a08a7f49296c..6ab956c79b09 100644 --- a/toolchain/lower/testdata/index/array_element_access.carbon +++ b/toolchain/lower/testdata/index/array_element_access.carbon @@ -26,16 +26,16 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: define void @_CA.Main(ptr sret({ i32, i32 }) %return) !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc10_36.5.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !7 -// CHECK:STDOUT: %.loc10_36.10.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !7 +// CHECK:STDOUT: %.loc10_36.6.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !7 +// CHECK:STDOUT: %.loc10_36.12.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !7 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %return, ptr align 4 @tuple.loc10_37, i64 8, i1 false), !dbg !8 // CHECK:STDOUT: ret void, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: define void @_CB.Main(ptr sret([2 x i32]) %return) !dbg !9 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc12_34.6.array.index = getelementptr inbounds [2 x i32], ptr %return, i32 0, i32 0, !dbg !10 -// CHECK:STDOUT: %.loc12_34.12.array.index = getelementptr inbounds [2 x i32], ptr %return, i32 0, i32 1, !dbg !10 +// CHECK:STDOUT: %.loc12_34.7.array.index = getelementptr inbounds [2 x i32], ptr %return, i32 0, {} zeroinitializer, !dbg !10 +// CHECK:STDOUT: %.loc12_34.14.array.index = getelementptr inbounds [2 x i32], ptr %return, i32 0, {} zeroinitializer, !dbg !10 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %return, ptr align 4 @array.loc12_35, i64 8, i1 false), !dbg !11 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } @@ -47,11 +47,11 @@ fn Run() { // CHECK:STDOUT: call void @_CA.Main(ptr %.loc15_22.1.temp), !dbg !14 // CHECK:STDOUT: %.loc15_22.3.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc15_22.1.temp, i32 0, i32 0, !dbg !14 // CHECK:STDOUT: %.loc15_22.4 = load i32, ptr %.loc15_22.3.tuple.elem, align 4, !dbg !14 -// CHECK:STDOUT: %.loc15_22.6.array.index = getelementptr inbounds [2 x i32], ptr %a.var, i32 0, i32 0, !dbg !14 +// CHECK:STDOUT: %.loc15_22.6.array.index = getelementptr inbounds [2 x i32], ptr %a.var, i32 0, {} zeroinitializer, !dbg !14 // CHECK:STDOUT: store i32 %.loc15_22.4, ptr %.loc15_22.6.array.index, align 4, !dbg !14 // CHECK:STDOUT: %.loc15_22.8.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc15_22.1.temp, i32 0, i32 1, !dbg !14 // CHECK:STDOUT: %.loc15_22.9 = load i32, ptr %.loc15_22.8.tuple.elem, align 4, !dbg !14 -// CHECK:STDOUT: %.loc15_22.11.array.index = getelementptr inbounds [2 x i32], ptr %a.var, i32 0, i32 1, !dbg !14 +// CHECK:STDOUT: %.loc15_22.11.array.index = getelementptr inbounds [2 x i32], ptr %a.var, i32 0, {} zeroinitializer, !dbg !14 // CHECK:STDOUT: store i32 %.loc15_22.9, ptr %.loc15_22.11.array.index, align 4, !dbg !14 // CHECK:STDOUT: %b.var = alloca i32, align 4, !dbg !15 // CHECK:STDOUT: store i32 1, ptr %b.var, align 4, !dbg !16 diff --git a/toolchain/lower/testdata/let/tuple.carbon b/toolchain/lower/testdata/let/tuple.carbon index 7160040a8fb2..627c01f62d75 100644 --- a/toolchain/lower/testdata/let/tuple.carbon +++ b/toolchain/lower/testdata/let/tuple.carbon @@ -24,13 +24,13 @@ fn F() -> i32 { // CHECK:STDOUT: define i32 @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca { i32, i32, i32 }, align 8, !dbg !7 -// CHECK:STDOUT: %.loc12_36.5.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !8 -// CHECK:STDOUT: %.loc12_36.10.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 1, !dbg !8 -// CHECK:STDOUT: %.loc12_36.15.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2, !dbg !8 +// CHECK:STDOUT: %.loc12_36.6.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !8 +// CHECK:STDOUT: %.loc12_36.12.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 1, !dbg !8 +// CHECK:STDOUT: %.loc12_36.18.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %a.var, ptr align 4 @tuple.1.loc12_37, i64 12, i1 false), !dbg !9 // CHECK:STDOUT: %b.var = alloca { i32, i32 }, align 8, !dbg !10 -// CHECK:STDOUT: %.loc13_28.5.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: %.loc13_28.10.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !11 +// CHECK:STDOUT: %.loc13_28.6.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !11 +// CHECK:STDOUT: %.loc13_28.12.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !11 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %b.var, ptr align 4 @tuple.2.loc13_29, i64 8, i1 false), !dbg !12 // CHECK:STDOUT: %.loc14_43.1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !13 // CHECK:STDOUT: %.loc14_43.2 = load i32, ptr %.loc14_43.1.tuple.elem, align 4, !dbg !13 diff --git a/toolchain/lower/testdata/operators/assignment.carbon b/toolchain/lower/testdata/operators/assignment.carbon index 15456762da30..b47c2a29d728 100644 --- a/toolchain/lower/testdata/operators/assignment.carbon +++ b/toolchain/lower/testdata/operators/assignment.carbon @@ -26,8 +26,8 @@ fn Main() { // CHECK:STDOUT: store i32 12, ptr %a.var, align 4, !dbg !8 // CHECK:STDOUT: store i32 9, ptr %a.var, align 4, !dbg !9 // CHECK:STDOUT: %b.var = alloca { i32, i32 }, align 8, !dbg !10 -// CHECK:STDOUT: %.loc15_12.5.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: %.loc15_12.10.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !11 +// CHECK:STDOUT: %.loc15_12.6.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !11 +// CHECK:STDOUT: %.loc15_12.12.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !11 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %b.var, ptr align 4 @tuple.loc15_5, i64 8, i1 false), !dbg !12 // CHECK:STDOUT: ret void, !dbg !13 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/pointer/address_of_field.carbon b/toolchain/lower/testdata/pointer/address_of_field.carbon index 1e7dc1db2751..4f69d3940f31 100644 --- a/toolchain/lower/testdata/pointer/address_of_field.carbon +++ b/toolchain/lower/testdata/pointer/address_of_field.carbon @@ -25,8 +25,8 @@ fn F() { // CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %s.var = alloca { i32, i32 }, align 8, !dbg !7 -// CHECK:STDOUT: %.loc14_46.5.a = getelementptr inbounds nuw { i32, i32 }, ptr %s.var, i32 0, i32 0, !dbg !8 -// CHECK:STDOUT: %.loc14_46.10.b = getelementptr inbounds nuw { i32, i32 }, ptr %s.var, i32 0, i32 1, !dbg !8 +// CHECK:STDOUT: %.loc14_46.6.a = getelementptr inbounds nuw { i32, i32 }, ptr %s.var, i32 0, i32 0, !dbg !8 +// CHECK:STDOUT: %.loc14_46.12.b = getelementptr inbounds nuw { i32, i32 }, ptr %s.var, i32 0, i32 1, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %s.var, ptr align 4 @struct.loc14_47, i64 8, i1 false), !dbg !9 // CHECK:STDOUT: %.loc15_7.b = getelementptr inbounds nuw { i32, i32 }, ptr %s.var, i32 0, i32 1, !dbg !10 // CHECK:STDOUT: call void @_CG.Main(ptr %.loc15_7.b), !dbg !11 diff --git a/toolchain/lower/testdata/return/return_var.carbon b/toolchain/lower/testdata/return/return_var.carbon index 1c82e72ea043..4a1ecba8f963 100644 --- a/toolchain/lower/testdata/return/return_var.carbon +++ b/toolchain/lower/testdata/return/return_var.carbon @@ -24,9 +24,9 @@ fn Make() -> C { // CHECK:STDOUT: // CHECK:STDOUT: define void @_CMake.Main(ptr sret({ i32, ptr }) %return) !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc18_30.5.data = getelementptr inbounds nuw { i32, ptr }, ptr %return, i32 0, i32 0, !dbg !7 -// CHECK:STDOUT: %.loc18_30.7.next = getelementptr inbounds nuw { i32, ptr }, ptr %return, i32 0, i32 1, !dbg !7 -// CHECK:STDOUT: store ptr %return, ptr %.loc18_30.7.next, align 8, !dbg !7 +// CHECK:STDOUT: %.loc18_30.6.data = getelementptr inbounds nuw { i32, ptr }, ptr %return, i32 0, i32 0, !dbg !7 +// CHECK:STDOUT: %.loc18_30.8.next = getelementptr inbounds nuw { i32, ptr }, ptr %return, i32 0, i32 1, !dbg !7 +// CHECK:STDOUT: store ptr %return, ptr %.loc18_30.8.next, align 8, !dbg !7 // CHECK:STDOUT: ret void, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/struct/member_access.carbon b/toolchain/lower/testdata/struct/member_access.carbon index 351fd4360aa2..3968ad26944a 100644 --- a/toolchain/lower/testdata/struct/member_access.carbon +++ b/toolchain/lower/testdata/struct/member_access.carbon @@ -24,7 +24,7 @@ fn Run() -> i32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca { double, i32 }, align 8, !dbg !7 // CHECK:STDOUT: %.loc12_48.2.a = getelementptr inbounds nuw { double, i32 }, ptr %x.var, i32 0, i32 0, !dbg !8 -// CHECK:STDOUT: %.loc12_48.7.b = getelementptr inbounds nuw { double, i32 }, ptr %x.var, i32 0, i32 1, !dbg !8 +// CHECK:STDOUT: %.loc12_48.8.b = getelementptr inbounds nuw { double, i32 }, ptr %x.var, i32 0, i32 1, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %x.var, ptr align 8 @struct.loc12_49, i64 16, i1 false), !dbg !9 // CHECK:STDOUT: %y.var = alloca i32, align 4, !dbg !10 // CHECK:STDOUT: %.loc13_17.1.b = getelementptr inbounds nuw { double, i32 }, ptr %x.var, i32 0, i32 1, !dbg !11 diff --git a/toolchain/lower/testdata/struct/two_entries.carbon b/toolchain/lower/testdata/struct/two_entries.carbon index a6aace7604ee..22397299ef2a 100644 --- a/toolchain/lower/testdata/struct/two_entries.carbon +++ b/toolchain/lower/testdata/struct/two_entries.carbon @@ -22,8 +22,8 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca { i32, i32 }, align 8, !dbg !7 -// CHECK:STDOUT: %.loc12_46.5.a = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0, !dbg !8 -// CHECK:STDOUT: %.loc12_46.10.b = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 1, !dbg !8 +// CHECK:STDOUT: %.loc12_46.6.a = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0, !dbg !8 +// CHECK:STDOUT: %.loc12_46.12.b = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 1, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %x.var, ptr align 4 @struct.loc12_47, i64 8, i1 false), !dbg !9 // CHECK:STDOUT: %y.var = alloca { i32, i32 }, align 8, !dbg !10 // CHECK:STDOUT: %.loc13_31.1.a = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0, !dbg !11 diff --git a/toolchain/lower/testdata/tuple/access/element_access.carbon b/toolchain/lower/testdata/tuple/access/element_access.carbon index 8e8575e3d0f7..40eb1ebb4367 100644 --- a/toolchain/lower/testdata/tuple/access/element_access.carbon +++ b/toolchain/lower/testdata/tuple/access/element_access.carbon @@ -23,9 +23,9 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca { i32, i32, i32 }, align 8, !dbg !7 -// CHECK:STDOUT: %.loc12_36.5.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !8 -// CHECK:STDOUT: %.loc12_36.10.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 1, !dbg !8 -// CHECK:STDOUT: %.loc12_36.15.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2, !dbg !8 +// CHECK:STDOUT: %.loc12_36.6.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !8 +// CHECK:STDOUT: %.loc12_36.12.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 1, !dbg !8 +// CHECK:STDOUT: %.loc12_36.18.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %a.var, ptr align 4 @tuple.loc12_37, i64 12, i1 false), !dbg !9 // CHECK:STDOUT: %b.var = alloca i32, align 4, !dbg !10 // CHECK:STDOUT: %.loc13_17.1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !11 diff --git a/toolchain/lower/testdata/tuple/access/return_value_access.carbon b/toolchain/lower/testdata/tuple/access/return_value_access.carbon index 815e8dd7fcf9..9756349c5749 100644 --- a/toolchain/lower/testdata/tuple/access/return_value_access.carbon +++ b/toolchain/lower/testdata/tuple/access/return_value_access.carbon @@ -21,8 +21,8 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: define void @_CF.Main(ptr sret({ i32, i32 }) %return) !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_38.5.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !7 -// CHECK:STDOUT: %.loc11_38.10.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !7 +// CHECK:STDOUT: %.loc11_38.6.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !7 +// CHECK:STDOUT: %.loc11_38.12.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !7 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %return, ptr align 4 @tuple.loc11_39, i64 8, i1 false), !dbg !8 // CHECK:STDOUT: ret void, !dbg !8 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/tuple/two_entries.carbon b/toolchain/lower/testdata/tuple/two_entries.carbon index 3ac2b4a0fa49..813cd6786dbd 100644 --- a/toolchain/lower/testdata/tuple/two_entries.carbon +++ b/toolchain/lower/testdata/tuple/two_entries.carbon @@ -22,8 +22,8 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca { i32, i32 }, align 8, !dbg !7 -// CHECK:STDOUT: %.loc12_29.5.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0, !dbg !8 -// CHECK:STDOUT: %.loc12_29.10.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 1, !dbg !8 +// CHECK:STDOUT: %.loc12_29.6.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0, !dbg !8 +// CHECK:STDOUT: %.loc12_29.12.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 1, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %x.var, ptr align 4 @tuple.loc12_30, i64 8, i1 false), !dbg !9 // CHECK:STDOUT: %y.var = alloca { i32, i32 }, align 8, !dbg !10 // CHECK:STDOUT: %.loc13_23.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0, !dbg !11 diff --git a/toolchain/sem_ir/builtin_function_kind.cpp b/toolchain/sem_ir/builtin_function_kind.cpp index 99c74cdf6223..7c3c53532c70 100644 --- a/toolchain/sem_ir/builtin_function_kind.cpp +++ b/toolchain/sem_ir/builtin_function_kind.cpp @@ -83,9 +83,6 @@ struct AnyInt { type_id)) { return true; } - if (BuiltinType::Check(sem_ir, state, type_id)) { - return true; - } return sem_ir.types().Is(type_id); } }; @@ -180,11 +177,6 @@ constexpr BuiltinInfo PrintInt = {"print.int", constexpr BuiltinInfo IntLiteralMakeType = {"int_literal.make_type", ValidateSignatureType>}; -// Returns the `i32` type. Doesn't take a bit size because we need an integer -// type as a basis for that. -constexpr BuiltinInfo IntMakeType32 = {"int.make_type_32", - ValidateSignatureType>}; - // Returns the `iN` type. // TODO: Should we use a more specific type as the type of the bit width? constexpr BuiltinInfo IntMakeTypeSigned = { diff --git a/toolchain/sem_ir/builtin_function_kind.def b/toolchain/sem_ir/builtin_function_kind.def index ab9344b05056..439ded7df887 100644 --- a/toolchain/sem_ir/builtin_function_kind.def +++ b/toolchain/sem_ir/builtin_function_kind.def @@ -21,7 +21,6 @@ CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(PrintInt) // Type factories. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntLiteralMakeType) -CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntMakeType32) CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntMakeTypeSigned) CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntMakeTypeUnsigned) CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(FloatMakeType) diff --git a/toolchain/sem_ir/builtin_inst_kind.def b/toolchain/sem_ir/builtin_inst_kind.def index 0b84ee0df8f0..8d4e2b7fa3f0 100644 --- a/toolchain/sem_ir/builtin_inst_kind.def +++ b/toolchain/sem_ir/builtin_inst_kind.def @@ -58,15 +58,12 @@ CARBON_SEM_IR_BUILTIN_INST_KIND(AutoType, "auto") // The type of bool literals and branch conditions, bool. CARBON_SEM_IR_BUILTIN_INST_KIND(BoolType, "bool") -// An arbitrary-precision integer type. This will eventually be used in the -// types of integer literals and as the parameter type of `Core.Int` and -// `Core.Float`. This type only provides compile-time operations, and is -// represented as an empty type at runtime. +// An arbitrary-precision integer type, which is used as the type of integer +// literals and as the parameter type of `Core.Int` and `Core.Float`. This type +// only provides compile-time operations, and is represented as an empty type at +// runtime. CARBON_SEM_IR_BUILTIN_INST_KIND(IntLiteralType, "Core.IntLiteral") -// The type of integer values and integer literals, currently always i32. -CARBON_SEM_IR_BUILTIN_INST_KIND(IntType, "i32") - // The type of floating point values and real literals, currently always f64. CARBON_SEM_IR_BUILTIN_INST_KIND(FloatType, "f64") diff --git a/toolchain/sem_ir/file.h b/toolchain/sem_ir/file.h index 1d6ff83af495..3324dd32be28 100644 --- a/toolchain/sem_ir/file.h +++ b/toolchain/sem_ir/file.h @@ -83,14 +83,9 @@ class File : public Printable { // instruction defined type. Uses IntId::Invalid for types that have an // invalid width. // - // TODO: When we don't have a builtin int type mixed with actual `IntType` - // instructions, clients should directly query the `IntType` instruction to - // compute this information. + // TODO: Move this to TypeStore. auto GetIntTypeInfo(TypeId int_type_id) const -> IntTypeInfo { auto inst_id = types().GetInstId(int_type_id); - if (inst_id == InstId::BuiltinIntType) { - return {.is_signed = true, .bit_width = ints().Lookup(32)}; - } if (inst_id == InstId::BuiltinIntLiteralType) { return {.is_signed = true, .bit_width = IntId::Invalid}; } diff --git a/toolchain/sem_ir/inst.h b/toolchain/sem_ir/inst.h index f1c4c84689c5..f2f3554b8979 100644 --- a/toolchain/sem_ir/inst.h +++ b/toolchain/sem_ir/inst.h @@ -166,8 +166,8 @@ class Inst : public Printable { requires Internal::InstLikeType auto As() const -> TypedInst { using Info = Internal::InstLikeTypeInfo; - CARBON_CHECK(Is(), "Casting inst of kind {0} to wrong kind {1}", - kind(), Info::DebugName()); + CARBON_CHECK(Is(), "Casting inst {0} to wrong kind {1}", *this, + Info::DebugName()); auto build_with_type_id_onwards = [&](auto... type_id_onwards) { if constexpr (Internal::HasKindMemberAsField) { return TypedInst{kind(), type_id_onwards...}; diff --git a/toolchain/sem_ir/inst_namer.cpp b/toolchain/sem_ir/inst_namer.cpp index 470048cfbd2b..f9bda5b49d33 100644 --- a/toolchain/sem_ir/inst_namer.cpp +++ b/toolchain/sem_ir/inst_namer.cpp @@ -395,6 +395,18 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, add_inst_name( (sem_ir_.names().GetIRBaseName(name_id).str() + suffix).str()); }; + auto add_int_or_float_type_name = [&](char type_literal_prefix, + SemIR::InstId bit_width_id) { + std::string name; + llvm::raw_string_ostream out(name); + out << type_literal_prefix; + if (auto bit_width = sem_ir_.insts().TryGetAs(bit_width_id)) { + out << sem_ir_.ints().Get(bit_width->int_id); + } else { + out << "N"; + } + add_inst_name(std::move(name)); + }; if (auto branch = untyped_inst.TryAs()) { AddBlockLabel(scope_id, sem_ir_.insts().GetLocId(inst_id), *branch); @@ -471,6 +483,10 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, } continue; } + case CARBON_KIND(FloatType inst): { + add_int_or_float_type_name('f', inst.bit_width_id); + continue; + } case CARBON_KIND(FunctionDecl inst): { const auto& function_info = sem_ir_.functions().Get(inst.function_id); add_inst_name_id(function_info.name_id, ".decl"); @@ -533,6 +549,11 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, CollectNamesInBlock(interface_scope_id, inst.decl_block_id); continue; } + case CARBON_KIND(IntType inst): { + add_int_or_float_type_name(inst.int_kind == IntKind::Signed ? 'i' : 'u', + inst.bit_width_id); + continue; + } case CARBON_KIND(NameRef inst): { add_inst_name_id(inst.name_id, ".ref"); continue; diff --git a/toolchain/sem_ir/type.h b/toolchain/sem_ir/type.h index 71bf163421a1..50a8e6e6dd2f 100644 --- a/toolchain/sem_ir/type.h +++ b/toolchain/sem_ir/type.h @@ -99,14 +99,9 @@ class TypeStore : public Yaml::Printable { } // Determines whether the given type is a signed integer type. - // - // TODO: When we don't have a builtin int type mixed with actual `IntType` - // instructions, clients should directly query the `IntType` instruction to - // compute this information. auto IsSignedInt(TypeId int_type_id) const -> bool { auto inst_id = GetInstId(int_type_id); - if (inst_id == InstId::BuiltinIntType || - inst_id == InstId::BuiltinIntLiteralType) { + if (inst_id == InstId::BuiltinIntLiteralType) { return true; } auto int_type = insts_->TryGetAs(inst_id);